linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2021-12-04 18:11 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-12-04 18:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: kbuild-all, linux-kernel, Dinh Nguyen

Hi Krzysztof,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   12119cfa1052d512a92524e90ebee85029a918f8
commit: 4483397b03536506535d611b0cb28a81a69e8edf ARM: socfpga: drop ARCH_SOCFPGA
date:   9 months ago
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20211205/202112050248.97q4WQ5F-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4483397b03536506535d611b0cb28a81a69e8edf
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 4483397b03536506535d611b0cb28a81a69e8edf
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash arch/arm/mach-socfpga/ drivers/dma/ drivers/edac/ drivers/gpu/drm/msm/ drivers/gpu/drm/tegra/ drivers/interconnect/qcom/ drivers/net/ethernet/mediatek/ drivers/net/vmxnet3/ drivers/net/wireless/mediatek/mt76/mt7915/ drivers/remoteproc/ drivers/scsi/bnx2fc/ drivers/scsi/lpfc/ drivers/staging/ fs/proc/

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


sparse warnings: (new ones prefixed by >>)
>> arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *dest @@     got void [noderef] __iomem *[assigned] suspend_ocram_base @@
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     expected void *dest
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     got void [noderef] __iomem *[assigned] suspend_ocram_base
--
>> drivers/edac/altera_edac.c:886:28: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __be32 const [usertype] *p @@     got unsigned int const [usertype] *handle @@
   drivers/edac/altera_edac.c:886:28: sparse:     expected restricted __be32 const [usertype] *p
   drivers/edac/altera_edac.c:886:28: sparse:     got unsigned int const [usertype] *handle

vim +75 arch/arm/mach-socfpga/pm.c

44fd8c7d4005f6 Alan Tull          2015-06-05  24  
44fd8c7d4005f6 Alan Tull          2015-06-05  25  static int socfpga_setup_ocram_self_refresh(void)
44fd8c7d4005f6 Alan Tull          2015-06-05  26  {
44fd8c7d4005f6 Alan Tull          2015-06-05  27  	struct platform_device *pdev;
44fd8c7d4005f6 Alan Tull          2015-06-05  28  	phys_addr_t ocram_pbase;
44fd8c7d4005f6 Alan Tull          2015-06-05  29  	struct device_node *np;
44fd8c7d4005f6 Alan Tull          2015-06-05  30  	struct gen_pool *ocram_pool;
44fd8c7d4005f6 Alan Tull          2015-06-05  31  	unsigned long ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  32  	void __iomem *suspend_ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  33  	int ret = 0;
44fd8c7d4005f6 Alan Tull          2015-06-05  34  
44fd8c7d4005f6 Alan Tull          2015-06-05  35  	np = of_find_compatible_node(NULL, NULL, "mmio-sram");
44fd8c7d4005f6 Alan Tull          2015-06-05  36  	if (!np) {
44fd8c7d4005f6 Alan Tull          2015-06-05  37  		pr_err("%s: Unable to find mmio-sram in dtb\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  38  		return -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  39  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  40  
44fd8c7d4005f6 Alan Tull          2015-06-05  41  	pdev = of_find_device_by_node(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  42  	if (!pdev) {
44fd8c7d4005f6 Alan Tull          2015-06-05  43  		pr_warn("%s: failed to find ocram device!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  44  		ret = -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  45  		goto put_node;
44fd8c7d4005f6 Alan Tull          2015-06-05  46  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  47  
73858173593c31 Vladimir Zapolskiy 2015-09-04  48  	ocram_pool = gen_pool_get(&pdev->dev, NULL);
44fd8c7d4005f6 Alan Tull          2015-06-05  49  	if (!ocram_pool) {
44fd8c7d4005f6 Alan Tull          2015-06-05  50  		pr_warn("%s: ocram pool unavailable!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  51  		ret = -ENODEV;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  52  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  53  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  54  
44fd8c7d4005f6 Alan Tull          2015-06-05  55  	ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  56  	if (!ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  57  		pr_warn("%s: unable to alloc ocram!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  58  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  59  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  60  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  61  
44fd8c7d4005f6 Alan Tull          2015-06-05  62  	ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
44fd8c7d4005f6 Alan Tull          2015-06-05  63  
44fd8c7d4005f6 Alan Tull          2015-06-05  64  	suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
44fd8c7d4005f6 Alan Tull          2015-06-05  65  						socfpga_sdram_self_refresh_sz,
44fd8c7d4005f6 Alan Tull          2015-06-05  66  						false);
44fd8c7d4005f6 Alan Tull          2015-06-05  67  	if (!suspend_ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  68  		pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  69  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  70  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  71  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  72  
44fd8c7d4005f6 Alan Tull          2015-06-05  73  	/* Copy the code that puts DDR in self refresh to ocram */
44fd8c7d4005f6 Alan Tull          2015-06-05  74  	socfpga_sdram_self_refresh_in_ocram =
44fd8c7d4005f6 Alan Tull          2015-06-05 @75  		(void *)fncpy(suspend_ocram_base,
44fd8c7d4005f6 Alan Tull          2015-06-05  76  			      &socfpga_sdram_self_refresh,
44fd8c7d4005f6 Alan Tull          2015-06-05  77  			      socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  78  
44fd8c7d4005f6 Alan Tull          2015-06-05  79  	WARN(!socfpga_sdram_self_refresh_in_ocram,
44fd8c7d4005f6 Alan Tull          2015-06-05  80  	     "could not copy function to ocram");
44fd8c7d4005f6 Alan Tull          2015-06-05  81  	if (!socfpga_sdram_self_refresh_in_ocram)
44fd8c7d4005f6 Alan Tull          2015-06-05  82  		ret = -EFAULT;
44fd8c7d4005f6 Alan Tull          2015-06-05  83  
3ad7b4e8f89d6b Yu Kuai            2020-07-21  84  put_device:
3ad7b4e8f89d6b Yu Kuai            2020-07-21  85  	put_device(&pdev->dev);
44fd8c7d4005f6 Alan Tull          2015-06-05  86  put_node:
44fd8c7d4005f6 Alan Tull          2015-06-05  87  	of_node_put(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  88  
44fd8c7d4005f6 Alan Tull          2015-06-05  89  	return ret;
44fd8c7d4005f6 Alan Tull          2015-06-05  90  }
44fd8c7d4005f6 Alan Tull          2015-06-05  91  

:::::: The code at line 75 was first introduced by commit
:::::: 44fd8c7d4005f660f48679439f0a54225ba234a4 ARM: socfpga: support suspend to ram

:::::: TO: Alan Tull <atull@opensource.altera.com>
:::::: CC: Kevin Hilman <khilman@linaro.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2021-12-12  4:54 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-12-12  4:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: kbuild-all, linux-kernel, Dinh Nguyen

Hi Krzysztof,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a763d5a5abd65797aec3dd1bf01fe2ccbec32967
commit: 4483397b03536506535d611b0cb28a81a69e8edf ARM: socfpga: drop ARCH_SOCFPGA
date:   9 months ago
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20211212/202112121223.N7ibZbQg-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4483397b03536506535d611b0cb28a81a69e8edf
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 4483397b03536506535d611b0cb28a81a69e8edf
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash arch/arm/mach-socfpga/ drivers/dma/ drivers/edac/ drivers/gpu/drm/msm/ drivers/gpu/drm/tegra/ drivers/interconnect/qcom/ drivers/net/ethernet/mediatek/ drivers/net/vmxnet3/ drivers/net/wireless/mediatek/mt76/mt7915/ drivers/remoteproc/ drivers/scsi/bnx2fc/ drivers/scsi/lpfc/ drivers/staging/ fs/proc/

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


sparse warnings: (new ones prefixed by >>)
>> arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *dest @@     got void [noderef] __iomem *[assigned] suspend_ocram_base @@
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     expected void *dest
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     got void [noderef] __iomem *[assigned] suspend_ocram_base
--
>> drivers/edac/altera_edac.c:886:28: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __be32 const [usertype] *p @@     got unsigned int const [usertype] *handle @@
   drivers/edac/altera_edac.c:886:28: sparse:     expected restricted __be32 const [usertype] *p
   drivers/edac/altera_edac.c:886:28: sparse:     got unsigned int const [usertype] *handle

vim +75 arch/arm/mach-socfpga/pm.c

44fd8c7d4005f6 Alan Tull          2015-06-05  24  
44fd8c7d4005f6 Alan Tull          2015-06-05  25  static int socfpga_setup_ocram_self_refresh(void)
44fd8c7d4005f6 Alan Tull          2015-06-05  26  {
44fd8c7d4005f6 Alan Tull          2015-06-05  27  	struct platform_device *pdev;
44fd8c7d4005f6 Alan Tull          2015-06-05  28  	phys_addr_t ocram_pbase;
44fd8c7d4005f6 Alan Tull          2015-06-05  29  	struct device_node *np;
44fd8c7d4005f6 Alan Tull          2015-06-05  30  	struct gen_pool *ocram_pool;
44fd8c7d4005f6 Alan Tull          2015-06-05  31  	unsigned long ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  32  	void __iomem *suspend_ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  33  	int ret = 0;
44fd8c7d4005f6 Alan Tull          2015-06-05  34  
44fd8c7d4005f6 Alan Tull          2015-06-05  35  	np = of_find_compatible_node(NULL, NULL, "mmio-sram");
44fd8c7d4005f6 Alan Tull          2015-06-05  36  	if (!np) {
44fd8c7d4005f6 Alan Tull          2015-06-05  37  		pr_err("%s: Unable to find mmio-sram in dtb\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  38  		return -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  39  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  40  
44fd8c7d4005f6 Alan Tull          2015-06-05  41  	pdev = of_find_device_by_node(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  42  	if (!pdev) {
44fd8c7d4005f6 Alan Tull          2015-06-05  43  		pr_warn("%s: failed to find ocram device!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  44  		ret = -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  45  		goto put_node;
44fd8c7d4005f6 Alan Tull          2015-06-05  46  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  47  
73858173593c31 Vladimir Zapolskiy 2015-09-04  48  	ocram_pool = gen_pool_get(&pdev->dev, NULL);
44fd8c7d4005f6 Alan Tull          2015-06-05  49  	if (!ocram_pool) {
44fd8c7d4005f6 Alan Tull          2015-06-05  50  		pr_warn("%s: ocram pool unavailable!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  51  		ret = -ENODEV;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  52  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  53  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  54  
44fd8c7d4005f6 Alan Tull          2015-06-05  55  	ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  56  	if (!ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  57  		pr_warn("%s: unable to alloc ocram!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  58  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  59  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  60  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  61  
44fd8c7d4005f6 Alan Tull          2015-06-05  62  	ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
44fd8c7d4005f6 Alan Tull          2015-06-05  63  
44fd8c7d4005f6 Alan Tull          2015-06-05  64  	suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
44fd8c7d4005f6 Alan Tull          2015-06-05  65  						socfpga_sdram_self_refresh_sz,
44fd8c7d4005f6 Alan Tull          2015-06-05  66  						false);
44fd8c7d4005f6 Alan Tull          2015-06-05  67  	if (!suspend_ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  68  		pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  69  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  70  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  71  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  72  
44fd8c7d4005f6 Alan Tull          2015-06-05  73  	/* Copy the code that puts DDR in self refresh to ocram */
44fd8c7d4005f6 Alan Tull          2015-06-05  74  	socfpga_sdram_self_refresh_in_ocram =
44fd8c7d4005f6 Alan Tull          2015-06-05 @75  		(void *)fncpy(suspend_ocram_base,
44fd8c7d4005f6 Alan Tull          2015-06-05  76  			      &socfpga_sdram_self_refresh,
44fd8c7d4005f6 Alan Tull          2015-06-05  77  			      socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  78  
44fd8c7d4005f6 Alan Tull          2015-06-05  79  	WARN(!socfpga_sdram_self_refresh_in_ocram,
44fd8c7d4005f6 Alan Tull          2015-06-05  80  	     "could not copy function to ocram");
44fd8c7d4005f6 Alan Tull          2015-06-05  81  	if (!socfpga_sdram_self_refresh_in_ocram)
44fd8c7d4005f6 Alan Tull          2015-06-05  82  		ret = -EFAULT;
44fd8c7d4005f6 Alan Tull          2015-06-05  83  
3ad7b4e8f89d6b Yu Kuai            2020-07-21  84  put_device:
3ad7b4e8f89d6b Yu Kuai            2020-07-21  85  	put_device(&pdev->dev);
44fd8c7d4005f6 Alan Tull          2015-06-05  86  put_node:
44fd8c7d4005f6 Alan Tull          2015-06-05  87  	of_node_put(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  88  
44fd8c7d4005f6 Alan Tull          2015-06-05  89  	return ret;
44fd8c7d4005f6 Alan Tull          2015-06-05  90  }
44fd8c7d4005f6 Alan Tull          2015-06-05  91  

:::::: The code at line 75 was first introduced by commit
:::::: 44fd8c7d4005f660f48679439f0a54225ba234a4 ARM: socfpga: support suspend to ram

:::::: TO: Alan Tull <atull@opensource.altera.com>
:::::: CC: Kevin Hilman <khilman@linaro.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2021-07-24 22:05 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-07-24 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: kbuild-all, linux-kernel, Dinh Nguyen

[-- Attachment #1: Type: text/plain, Size: 7021 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f0fddcec6b6254b4b3611388786bbafb703ad257
commit: 4483397b03536506535d611b0cb28a81a69e8edf ARM: socfpga: drop ARCH_SOCFPGA
date:   4 months ago
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.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-341-g8af24329-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4483397b03536506535d611b0cb28a81a69e8edf
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 4483397b03536506535d611b0cb28a81a69e8edf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

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


sparse warnings: (new ones prefixed by >>)
>> arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *p @@     got void [noderef] __iomem *[assigned] suspend_ocram_base @@
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     expected void *p
   arch/arm/mach-socfpga/pm.c:75:25: sparse:     got void [noderef] __iomem *[assigned] suspend_ocram_base

vim +75 arch/arm/mach-socfpga/pm.c

44fd8c7d4005f6 Alan Tull          2015-06-05  24  
44fd8c7d4005f6 Alan Tull          2015-06-05  25  static int socfpga_setup_ocram_self_refresh(void)
44fd8c7d4005f6 Alan Tull          2015-06-05  26  {
44fd8c7d4005f6 Alan Tull          2015-06-05  27  	struct platform_device *pdev;
44fd8c7d4005f6 Alan Tull          2015-06-05  28  	phys_addr_t ocram_pbase;
44fd8c7d4005f6 Alan Tull          2015-06-05  29  	struct device_node *np;
44fd8c7d4005f6 Alan Tull          2015-06-05  30  	struct gen_pool *ocram_pool;
44fd8c7d4005f6 Alan Tull          2015-06-05  31  	unsigned long ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  32  	void __iomem *suspend_ocram_base;
44fd8c7d4005f6 Alan Tull          2015-06-05  33  	int ret = 0;
44fd8c7d4005f6 Alan Tull          2015-06-05  34  
44fd8c7d4005f6 Alan Tull          2015-06-05  35  	np = of_find_compatible_node(NULL, NULL, "mmio-sram");
44fd8c7d4005f6 Alan Tull          2015-06-05  36  	if (!np) {
44fd8c7d4005f6 Alan Tull          2015-06-05  37  		pr_err("%s: Unable to find mmio-sram in dtb\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  38  		return -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  39  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  40  
44fd8c7d4005f6 Alan Tull          2015-06-05  41  	pdev = of_find_device_by_node(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  42  	if (!pdev) {
44fd8c7d4005f6 Alan Tull          2015-06-05  43  		pr_warn("%s: failed to find ocram device!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  44  		ret = -ENODEV;
44fd8c7d4005f6 Alan Tull          2015-06-05  45  		goto put_node;
44fd8c7d4005f6 Alan Tull          2015-06-05  46  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  47  
73858173593c31 Vladimir Zapolskiy 2015-09-04  48  	ocram_pool = gen_pool_get(&pdev->dev, NULL);
44fd8c7d4005f6 Alan Tull          2015-06-05  49  	if (!ocram_pool) {
44fd8c7d4005f6 Alan Tull          2015-06-05  50  		pr_warn("%s: ocram pool unavailable!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  51  		ret = -ENODEV;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  52  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  53  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  54  
44fd8c7d4005f6 Alan Tull          2015-06-05  55  	ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  56  	if (!ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  57  		pr_warn("%s: unable to alloc ocram!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  58  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  59  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  60  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  61  
44fd8c7d4005f6 Alan Tull          2015-06-05  62  	ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
44fd8c7d4005f6 Alan Tull          2015-06-05  63  
44fd8c7d4005f6 Alan Tull          2015-06-05  64  	suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
44fd8c7d4005f6 Alan Tull          2015-06-05  65  						socfpga_sdram_self_refresh_sz,
44fd8c7d4005f6 Alan Tull          2015-06-05  66  						false);
44fd8c7d4005f6 Alan Tull          2015-06-05  67  	if (!suspend_ocram_base) {
44fd8c7d4005f6 Alan Tull          2015-06-05  68  		pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
44fd8c7d4005f6 Alan Tull          2015-06-05  69  		ret = -ENOMEM;
3ad7b4e8f89d6b Yu Kuai            2020-07-21  70  		goto put_device;
44fd8c7d4005f6 Alan Tull          2015-06-05  71  	}
44fd8c7d4005f6 Alan Tull          2015-06-05  72  
44fd8c7d4005f6 Alan Tull          2015-06-05  73  	/* Copy the code that puts DDR in self refresh to ocram */
44fd8c7d4005f6 Alan Tull          2015-06-05  74  	socfpga_sdram_self_refresh_in_ocram =
44fd8c7d4005f6 Alan Tull          2015-06-05 @75  		(void *)fncpy(suspend_ocram_base,
44fd8c7d4005f6 Alan Tull          2015-06-05  76  			      &socfpga_sdram_self_refresh,
44fd8c7d4005f6 Alan Tull          2015-06-05  77  			      socfpga_sdram_self_refresh_sz);
44fd8c7d4005f6 Alan Tull          2015-06-05  78  
44fd8c7d4005f6 Alan Tull          2015-06-05  79  	WARN(!socfpga_sdram_self_refresh_in_ocram,
44fd8c7d4005f6 Alan Tull          2015-06-05  80  	     "could not copy function to ocram");
44fd8c7d4005f6 Alan Tull          2015-06-05  81  	if (!socfpga_sdram_self_refresh_in_ocram)
44fd8c7d4005f6 Alan Tull          2015-06-05  82  		ret = -EFAULT;
44fd8c7d4005f6 Alan Tull          2015-06-05  83  
3ad7b4e8f89d6b Yu Kuai            2020-07-21  84  put_device:
3ad7b4e8f89d6b Yu Kuai            2020-07-21  85  	put_device(&pdev->dev);
44fd8c7d4005f6 Alan Tull          2015-06-05  86  put_node:
44fd8c7d4005f6 Alan Tull          2015-06-05  87  	of_node_put(np);
44fd8c7d4005f6 Alan Tull          2015-06-05  88  
44fd8c7d4005f6 Alan Tull          2015-06-05  89  	return ret;
44fd8c7d4005f6 Alan Tull          2015-06-05  90  }
44fd8c7d4005f6 Alan Tull          2015-06-05  91  

:::::: The code at line 75 was first introduced by commit
:::::: 44fd8c7d4005f660f48679439f0a54225ba234a4 ARM: socfpga: support suspend to ram

:::::: TO: Alan Tull <atull@opensource.altera.com>
:::::: CC: Kevin Hilman <khilman@linaro.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 77353 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-12  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 18:11 arch/arm/mach-socfpga/pm.c:75:25: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-12-12  4:54 kernel test robot
2021-07-24 22:05 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).