drivers/mmc/host/sdhci-of-esdhc.c:900:33: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Mon Dec 14 2020 - 11:16:45 EST


Hi Krzysztof,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: 54d8454436a205682bd89d66d8d9eedbc8452d15 mmc: host: Enable compile testing of multiple drivers
date: 3 months ago
config: openrisc-randconfig-s031-20201214 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-184-g1b896707-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=54d8454436a205682bd89d66d8d9eedbc8452d15
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 54d8454436a205682bd89d66d8d9eedbc8452d15
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/mmc/host/sdhci-of-esdhc.c:900:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] __iomem *[assigned] scfg_base @@
drivers/mmc/host/sdhci-of-esdhc.c:900:33: sparse: expected void *addr
drivers/mmc/host/sdhci-of-esdhc.c:900:33: sparse: got void [noderef] __iomem *[assigned] scfg_base

vim +900 drivers/mmc/host/sdhci-of-esdhc.c

ea35645a3c66a74 yangbo lu 2017-04-20 858
ea35645a3c66a74 yangbo lu 2017-04-20 859 static int esdhc_signal_voltage_switch(struct mmc_host *mmc,
ea35645a3c66a74 yangbo lu 2017-04-20 860 struct mmc_ios *ios)
ea35645a3c66a74 yangbo lu 2017-04-20 861 {
ea35645a3c66a74 yangbo lu 2017-04-20 862 struct sdhci_host *host = mmc_priv(mmc);
ea35645a3c66a74 yangbo lu 2017-04-20 863 struct device_node *scfg_node;
ea35645a3c66a74 yangbo lu 2017-04-20 864 void __iomem *scfg_base = NULL;
ea35645a3c66a74 yangbo lu 2017-04-20 865 u32 sdhciovselcr;
ea35645a3c66a74 yangbo lu 2017-04-20 866 u32 val;
ea35645a3c66a74 yangbo lu 2017-04-20 867
ea35645a3c66a74 yangbo lu 2017-04-20 868 /*
ea35645a3c66a74 yangbo lu 2017-04-20 869 * Signal Voltage Switching is only applicable for Host Controllers
ea35645a3c66a74 yangbo lu 2017-04-20 870 * v3.00 and above.
ea35645a3c66a74 yangbo lu 2017-04-20 871 */
ea35645a3c66a74 yangbo lu 2017-04-20 872 if (host->version < SDHCI_SPEC_300)
ea35645a3c66a74 yangbo lu 2017-04-20 873 return 0;
ea35645a3c66a74 yangbo lu 2017-04-20 874
ea35645a3c66a74 yangbo lu 2017-04-20 875 val = sdhci_readl(host, ESDHC_PROCTL);
ea35645a3c66a74 yangbo lu 2017-04-20 876
ea35645a3c66a74 yangbo lu 2017-04-20 877 switch (ios->signal_voltage) {
ea35645a3c66a74 yangbo lu 2017-04-20 878 case MMC_SIGNAL_VOLTAGE_330:
ea35645a3c66a74 yangbo lu 2017-04-20 879 val &= ~ESDHC_VOLT_SEL;
ea35645a3c66a74 yangbo lu 2017-04-20 880 sdhci_writel(host, val, ESDHC_PROCTL);
ea35645a3c66a74 yangbo lu 2017-04-20 881 return 0;
ea35645a3c66a74 yangbo lu 2017-04-20 882 case MMC_SIGNAL_VOLTAGE_180:
ea35645a3c66a74 yangbo lu 2017-04-20 883 scfg_node = of_find_matching_node(NULL, scfg_device_ids);
ea35645a3c66a74 yangbo lu 2017-04-20 884 if (scfg_node)
ea35645a3c66a74 yangbo lu 2017-04-20 885 scfg_base = of_iomap(scfg_node, 0);
ea35645a3c66a74 yangbo lu 2017-04-20 886 if (scfg_base) {
ea35645a3c66a74 yangbo lu 2017-04-20 887 sdhciovselcr = SDHCIOVSELCR_TGLEN |
ea35645a3c66a74 yangbo lu 2017-04-20 888 SDHCIOVSELCR_VSELVAL;
ea35645a3c66a74 yangbo lu 2017-04-20 889 iowrite32be(sdhciovselcr,
ea35645a3c66a74 yangbo lu 2017-04-20 890 scfg_base + SCFG_SDHCIOVSELCR);
ea35645a3c66a74 yangbo lu 2017-04-20 891
ea35645a3c66a74 yangbo lu 2017-04-20 892 val |= ESDHC_VOLT_SEL;
ea35645a3c66a74 yangbo lu 2017-04-20 893 sdhci_writel(host, val, ESDHC_PROCTL);
ea35645a3c66a74 yangbo lu 2017-04-20 894 mdelay(5);
ea35645a3c66a74 yangbo lu 2017-04-20 895
ea35645a3c66a74 yangbo lu 2017-04-20 896 sdhciovselcr = SDHCIOVSELCR_TGLEN |
ea35645a3c66a74 yangbo lu 2017-04-20 897 SDHCIOVSELCR_SDHC_VS;
ea35645a3c66a74 yangbo lu 2017-04-20 898 iowrite32be(sdhciovselcr,
ea35645a3c66a74 yangbo lu 2017-04-20 899 scfg_base + SCFG_SDHCIOVSELCR);
ea35645a3c66a74 yangbo lu 2017-04-20 @900 iounmap(scfg_base);
ea35645a3c66a74 yangbo lu 2017-04-20 901 } else {
ea35645a3c66a74 yangbo lu 2017-04-20 902 val |= ESDHC_VOLT_SEL;
ea35645a3c66a74 yangbo lu 2017-04-20 903 sdhci_writel(host, val, ESDHC_PROCTL);
ea35645a3c66a74 yangbo lu 2017-04-20 904 }
ea35645a3c66a74 yangbo lu 2017-04-20 905 return 0;
ea35645a3c66a74 yangbo lu 2017-04-20 906 default:
ea35645a3c66a74 yangbo lu 2017-04-20 907 return 0;
ea35645a3c66a74 yangbo lu 2017-04-20 908 }
ea35645a3c66a74 yangbo lu 2017-04-20 909 }
ea35645a3c66a74 yangbo lu 2017-04-20 910

:::::: The code at line 900 was first introduced by commit
:::::: ea35645a3c66a74af92d3bbb4eb131220fc3e58a mmc: sdhci-of-esdhc: add support for signal voltage switch

:::::: TO: yangbo lu <yangbo.lu@xxxxxxx>
:::::: CC: Ulf Hansson <ulf.hansson@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip