lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210022350.AAAEGzki-lkp@intel.com>
Date:   Sun, 2 Oct 2022 23:18:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: arch/arm/mach-imx/pm-imx6.c:513:9: sparse: sparse: incorrect type in
 argument 1 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b357fd1c2afc1a3e1b73dc4574bb7ac0e3bd4193
commit: 28e77cc1c0686621a4d416f599cee5ab369daa0a fortify: Detect struct member overflows in memset() at compile-time
date:   8 months ago
config: arm-randconfig-s031-20221002
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=28e77cc1c0686621a4d416f599cee5ab369daa0a
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 28e77cc1c0686621a4d416f599cee5ab369daa0a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
   arch/arm/mach-imx/pm-imx6.c:373:24: sparse: sparse: cast removes address space '__iomem' of expression
>> arch/arm/mach-imx/pm-imx6.c:513:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base @@
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     expected void const *
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base
>> arch/arm/mach-imx/pm-imx6.c:513:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base @@
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     expected void const *
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base
>> arch/arm/mach-imx/pm-imx6.c:513:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void * @@     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base @@
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     expected void *
   arch/arm/mach-imx/pm-imx6.c:513:9: sparse:     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base
   arch/arm/mach-imx/pm-imx6.c:514:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct imx6_cpu_pm_info *pm_info @@     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base @@
   arch/arm/mach-imx/pm-imx6.c:514:17: sparse:     expected struct imx6_cpu_pm_info *pm_info
   arch/arm/mach-imx/pm-imx6.c:514:17: sparse:     got void [noderef] __iomem *static [assigned] [toplevel] suspend_ocram_base
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __iomem * @@
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     expected void const *
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     got void [noderef] __iomem *
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __iomem * @@
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     expected void const *
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     got void [noderef] __iomem *
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     expected void *
   arch/arm/mach-imx/pm-imx6.c:570:36: sparse:     got void [noderef] __iomem *

vim +513 arch/arm/mach-imx/pm-imx6.c

9e8147bb5ec5d1 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2013-09-25  361  
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  362  static int imx6q_suspend_finish(unsigned long val)
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  363  {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  364  	if (!imx6_suspend_in_ocram_fn) {
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  365  		cpu_do_idle();
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  366  	} else {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  367  		/*
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  368  		 * call low level suspend function in ocram,
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  369  		 * as we need to float DDR IO.
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  370  		 */
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  371  		local_flush_tlb_all();
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  372  		/* check if need to flush internal L2 cache */
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05 @373  		if (!((struct imx6_cpu_pm_info *)
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  374  			suspend_ocram_base)->l2_base.vbase)
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  375  			flush_cache_all();
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  376  		imx6_suspend_in_ocram_fn(suspend_ocram_base);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  377  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  378  
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  379  	return 0;
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  380  }
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  381  
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  382  static int imx6q_pm_enter(suspend_state_t state)
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  383  {
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  384  	switch (state) {
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  385  	case PM_SUSPEND_STANDBY:
8fb76a07e2cb08 arch/arm/mach-imx/pm-imx6.c  Shawn Guo              2015-04-25  386  		imx6_set_lpm(STOP_POWER_ON);
8765caa5cb6054 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2016-08-29  387  		imx6_set_int_mem_clk_lpm(true);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  388  		imx_gpc_pre_suspend(false);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  389  		if (cpu_is_imx6sl())
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  390  			imx6sl_set_wait_clk(true);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  391  		/* Zzz ... */
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  392  		cpu_do_idle();
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  393  		if (cpu_is_imx6sl())
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  394  			imx6sl_set_wait_clk(false);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  395  		imx_gpc_post_resume();
8fb76a07e2cb08 arch/arm/mach-imx/pm-imx6.c  Shawn Guo              2015-04-25  396  		imx6_set_lpm(WAIT_CLOCKED);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  397  		break;
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  398  	case PM_SUSPEND_MEM:
8fb76a07e2cb08 arch/arm/mach-imx/pm-imx6.c  Shawn Guo              2015-04-25  399  		imx6_set_lpm(STOP_POWER_OFF);
8765caa5cb6054 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2016-08-29  400  		imx6_set_int_mem_clk_lpm(false);
1d674a73c59211 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2013-10-09  401  		imx6q_enable_wb(true);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  402  		/*
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  403  		 * For suspend into ocram, asm code already take care of
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  404  		 * RBC setting, so we do NOT need to do that here.
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  405  		 */
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  406  		if (!imx6_suspend_in_ocram_fn)
05136f0897b526 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-12-17  407  			imx6_enable_rbc(true);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  408  		imx_gpc_pre_suspend(true);
e95dddb34c896f arch/arm/mach-imx/pm-imx6q.c Anson Huang            2013-03-20  409  		imx_anatop_pre_suspend();
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  410  		/* Zzz ... */
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  411  		cpu_suspend(0, imx6q_suspend_finish);
9ba64fe3eb461b arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2013-10-17  412  		if (cpu_is_imx6q() || cpu_is_imx6dl())
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  413  			imx_smp_prepare();
e95dddb34c896f arch/arm/mach-imx/pm-imx6q.c Anson Huang            2013-03-20  414  		imx_anatop_post_resume();
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  415  		imx_gpc_post_resume();
05136f0897b526 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-12-17  416  		imx6_enable_rbc(false);
1d674a73c59211 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2013-10-09  417  		imx6q_enable_wb(false);
8765caa5cb6054 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2016-08-29  418  		imx6_set_int_mem_clk_lpm(true);
8fb76a07e2cb08 arch/arm/mach-imx/pm-imx6.c  Shawn Guo              2015-04-25  419  		imx6_set_lpm(WAIT_CLOCKED);
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  420  		break;
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  421  	default:
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  422  		return -EINVAL;
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  423  	}
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  424  
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  425  	return 0;
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  426  }
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  427  
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  428  static int imx6q_pm_valid(suspend_state_t state)
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  429  {
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  430  	return (state == PM_SUSPEND_STANDBY || state == PM_SUSPEND_MEM);
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  431  }
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  432  
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  433  static const struct platform_suspend_ops imx6q_pm_ops = {
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  434  	.enter = imx6q_pm_enter,
80c0ecdce802bd arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-06-23  435  	.valid = imx6q_pm_valid,
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  436  };
a1f1c7efb0c1c7 arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2011-09-06  437  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  438  static int __init imx6_pm_get_base(struct imx6_pm_base *base,
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  439  				const char *compat)
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  440  {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  441  	struct device_node *node;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  442  	struct resource res;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  443  	int ret = 0;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  444  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  445  	node = of_find_compatible_node(NULL, NULL, compat);
258172f96fcfa4 arch/arm/mach-imx/pm-imx6.c  Fabio Estevam          2018-02-23  446  	if (!node)
258172f96fcfa4 arch/arm/mach-imx/pm-imx6.c  Fabio Estevam          2018-02-23  447  		return -ENODEV;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  448  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  449  	ret = of_address_to_resource(node, 0, &res);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  450  	if (ret)
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  451  		goto put_node;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  452  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  453  	base->pbase = res.start;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  454  	base->vbase = ioremap(res.start, resource_size(&res));
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  455  	if (!base->vbase)
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  456  		ret = -ENOMEM;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  457  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  458  put_node:
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  459  	of_node_put(node);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  460  	return ret;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  461  }
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  462  
afc51f4643063c arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2014-02-26  463  static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  464  {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  465  	phys_addr_t ocram_pbase;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  466  	struct device_node *node;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  467  	struct platform_device *pdev;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  468  	struct imx6_cpu_pm_info *pm_info;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  469  	struct gen_pool *ocram_pool;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  470  	unsigned long ocram_base;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  471  	int i, ret = 0;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  472  	const u32 *mmdc_offset_array;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  473  
afc51f4643063c arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2014-02-26  474  	suspend_set_ops(&imx6q_pm_ops);
afc51f4643063c arch/arm/mach-imx/pm-imx6q.c Shawn Guo              2014-02-26  475  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  476  	if (!socdata) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  477  		pr_warn("%s: invalid argument!\n", __func__);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  478  		return -EINVAL;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  479  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  480  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  481  	node = of_find_compatible_node(NULL, NULL, "mmio-sram");
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  482  	if (!node) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  483  		pr_warn("%s: failed to find ocram node!\n", __func__);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  484  		return -ENODEV;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  485  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  486  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  487  	pdev = of_find_device_by_node(node);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  488  	if (!pdev) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  489  		pr_warn("%s: failed to find ocram device!\n", __func__);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  490  		ret = -ENODEV;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  491  		goto put_node;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  492  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  493  
73858173593c31 arch/arm/mach-imx/pm-imx6.c  Vladimir Zapolskiy     2015-09-04  494  	ocram_pool = gen_pool_get(&pdev->dev, NULL);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  495  	if (!ocram_pool) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  496  		pr_warn("%s: ocram pool unavailable!\n", __func__);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  497  		ret = -ENODEV;
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  498  		goto put_device;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  499  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  500  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  501  	ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  502  	if (!ocram_base) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  503  		pr_warn("%s: unable to alloc ocram!\n", __func__);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  504  		ret = -ENOMEM;
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  505  		goto put_device;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  506  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  507  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  508  	ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  509  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  510  	suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  511  		MX6Q_SUSPEND_OCRAM_SIZE, false);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  512  
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05 @513  	memset(suspend_ocram_base, 0, sizeof(*pm_info));
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  514  	pm_info = suspend_ocram_base;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  515  	pm_info->pbase = ocram_pbase;
64fc2a947a9873 arch/arm/mach-imx/pm-imx6.c  Florian Fainelli       2017-01-15  516  	pm_info->resume_addr = __pa_symbol(v7_cpu_resume);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  517  	pm_info->pm_info_size = sizeof(*pm_info);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  518  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  519  	/*
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  520  	 * ccm physical address is not used by asm code currently,
f0b478b5d42ee9 arch/arm/mach-imx/pm-imx6.c  Shawn Guo              2015-04-25  521  	 * so get ccm virtual address directly.
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  522  	 */
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  523  	pm_info->ccm_base.vbase = ccm_base;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  524  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  525  	ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  526  	if (ret) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  527  		pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  528  		goto put_device;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  529  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  530  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  531  	ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  532  	if (ret) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  533  		pr_warn("%s: failed to get src base %d!\n", __func__, ret);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  534  		goto src_map_failed;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  535  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  536  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  537  	ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  538  	if (ret) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  539  		pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  540  		goto iomuxc_map_failed;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  541  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  542  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  543  	ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  544  	if (ret) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  545  		pr_warn("%s: failed to get gpc base %d!\n", __func__, ret);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  546  		goto gpc_map_failed;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  547  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  548  
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  549  	if (socdata->pl310_compat) {
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  550  		ret = imx6_pm_get_base(&pm_info->l2_base, socdata->pl310_compat);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  551  		if (ret) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  552  			pr_warn("%s: failed to get pl310-cache base %d!\n",
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  553  				__func__, ret);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  554  			goto pl310_cache_map_failed;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  555  		}
ee4a5f838c8437 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2015-08-05  556  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  557  
ec336b28413661 arch/arm/mach-imx/pm-imx6.c  Anson Huang            2014-09-17  558  	pm_info->ddr_type = imx_mmdc_get_ddr_type();
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  559  	pm_info->mmdc_io_num = socdata->mmdc_io_num;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  560  	mmdc_offset_array = socdata->mmdc_io_offset;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  561  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  562  	for (i = 0; i < pm_info->mmdc_io_num; i++) {
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  563  		pm_info->mmdc_io_val[i][0] =
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  564  			mmdc_offset_array[i];
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  565  		pm_info->mmdc_io_val[i][1] =
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  566  			readl_relaxed(pm_info->iomuxc_base.vbase +
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  567  			mmdc_offset_array[i]);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  568  	}
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  569  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  570  	imx6_suspend_in_ocram_fn = fncpy(
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  571  		suspend_ocram_base + sizeof(*pm_info),
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  572  		&imx6_suspend,
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  573  		MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  574  
4aede550f10415 arch/arm/mach-imx/pm-imx6.c  Russell King (Oracle   2021-09-21  575) 	__arm_iomem_set_ro(suspend_ocram_base, MX6Q_SUSPEND_OCRAM_SIZE);
4aede550f10415 arch/arm/mach-imx/pm-imx6.c  Russell King (Oracle   2021-09-21  576) 
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  577  	goto put_device;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  578  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  579  pl310_cache_map_failed:
cfefb762ad2963 arch/arm/mach-imx/pm-imx6.c  Jean-Christophe Dubois 2015-12-26  580  	iounmap(pm_info->gpc_base.vbase);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  581  gpc_map_failed:
cfefb762ad2963 arch/arm/mach-imx/pm-imx6.c  Jean-Christophe Dubois 2015-12-26  582  	iounmap(pm_info->iomuxc_base.vbase);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  583  iomuxc_map_failed:
cfefb762ad2963 arch/arm/mach-imx/pm-imx6.c  Jean-Christophe Dubois 2015-12-26  584  	iounmap(pm_info->src_base.vbase);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  585  src_map_failed:
cfefb762ad2963 arch/arm/mach-imx/pm-imx6.c  Jean-Christophe Dubois 2015-12-26  586  	iounmap(pm_info->mmdc_base.vbase);
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  587  put_device:
4845446036fc9c arch/arm/mach-imx/pm-imx6.c  yu kuai                2020-06-04  588  	put_device(&pdev->dev);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  589  put_node:
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  590  	of_node_put(node);
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  591  
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  592  	return ret;
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  593  }
df595746fa69db arch/arm/mach-imx/pm-imx6q.c Anson Huang            2014-01-17  594  

:::::: The code at line 513 was first introduced by commit
:::::: ee4a5f838c8437484c9387e9ef9256332f07f3dd ARM: imx: add suspend/resume support for i.mx6ul

:::::: TO: Anson Huang <b20788@...escale.com>
:::::: CC: Shawn Guo <shawnguo@...nel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (175014 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ