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]
Date:   Mon, 24 Aug 2020 23:55:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/ata/ahci_xgene.c:196:41: sparse: sparse: incorrect type in
 initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d012a7190fc1fd72ed48911e77ca97ba4521bccd
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   10 weeks ago
config: powerpc64-randconfig-s031-20200824 (attached as .config)
compiler: powerpc-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.2-191-g10164920-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # 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=powerpc64 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/ata/ahci_xgene.c:196:41: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *port_mmio @@     got void [noderef] __iomem * @@
   drivers/ata/ahci_xgene.c:196:41: sparse:     expected void *port_mmio
>> drivers/ata/ahci_xgene.c:196:41: sparse:     got void [noderef] __iomem *
>> drivers/ata/ahci_xgene.c:203:44: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
>> drivers/ata/ahci_xgene.c:203:44: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:203:44: sparse:     got void *
>> drivers/ata/ahci_xgene.c:206:44: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
>> drivers/ata/ahci_xgene.c:206:44: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:206:44: sparse:     got void *
   drivers/ata/ahci_xgene.c:262:33: sparse: sparse: invalid assignment: &=
   drivers/ata/ahci_xgene.c:262:33: sparse:    left side has type unsigned short
   drivers/ata/ahci_xgene.c:262:33: sparse:    right side has type restricted __le16
   drivers/ata/ahci_xgene.c:457:41: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *port_mmio @@     got void [noderef] __iomem * @@
   drivers/ata/ahci_xgene.c:457:41: sparse:     expected void *port_mmio
   drivers/ata/ahci_xgene.c:457:41: sparse:     got void [noderef] __iomem *
   drivers/ata/ahci_xgene.c:464:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:464:36: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:464:36: sparse:     got void *
   drivers/ata/ahci_xgene.c:467:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:467:36: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:467:36: sparse:     got void *
   drivers/ata/ahci_xgene.c:502:41: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *port_mmio @@     got void [noderef] __iomem * @@
   drivers/ata/ahci_xgene.c:502:41: sparse:     expected void *port_mmio
   drivers/ata/ahci_xgene.c:502:41: sparse:     got void [noderef] __iomem *
   drivers/ata/ahci_xgene.c:508:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:508:41: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:508:41: sparse:     got void *
   drivers/ata/ahci_xgene.c:514:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:514:36: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:514:36: sparse:     got void *
   drivers/ata/ahci_xgene.c:517:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:517:36: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:517:36: sparse:     got void *
   drivers/ata/ahci_xgene.c:530:57: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   drivers/ata/ahci_xgene.c:530:57: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/ata/ahci_xgene.c:530:57: sparse:     got void *
   drivers/ata/ahci_xgene.c:718:9: sparse: sparse: Initializer entry defined twice
   drivers/ata/ahci_xgene.c:718:9: sparse:   also defined here
--
   drivers/usb/host/ehci-hcd.c: note: in included file:
   drivers/usb/host/ehci-q.c:1389:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __hc32 [usertype] old_current @@     got int @@
   drivers/usb/host/ehci-q.c:1389:27: sparse:     expected restricted __hc32 [usertype] old_current
   drivers/usb/host/ehci-q.c:1389:27: sparse:     got int
   drivers/usb/host/ehci-hcd.c: note: in included file:
   drivers/usb/host/ehci-mem.c:188:24: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __hc32 [usertype] *periodic @@     got restricted __le32 [usertype] * @@
   drivers/usb/host/ehci-mem.c:188:24: sparse:     expected restricted __hc32 [usertype] *periodic
   drivers/usb/host/ehci-mem.c:188:24: sparse:     got restricted __le32 [usertype] *
   drivers/usb/host/ehci-hcd.c:566:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __hc32 [usertype] old_current @@     got int @@
   drivers/usb/host/ehci-hcd.c:566:27: sparse:     expected restricted __hc32 [usertype] old_current
   drivers/usb/host/ehci-hcd.c:566:27: sparse:     got int
   drivers/usb/host/ehci-hcd.c: note: in included file:
   drivers/usb/host/ehci-ppc-of.c:140:47: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected restricted __hc32 [usertype] *ohci_hcctrl_reg @@     got void [noderef] __iomem * @@
   drivers/usb/host/ehci-ppc-of.c:140:47: sparse:     expected restricted __hc32 [usertype] *ohci_hcctrl_reg
   drivers/usb/host/ehci-ppc-of.c:140:47: sparse:     got void [noderef] __iomem *
   drivers/usb/host/ehci-hcd.c: note: in included file:
>> drivers/usb/host/ehci.h:787:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:787:36: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:787:36: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
>> drivers/usb/host/ehci.h:793:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:793:35: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:793:35: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
   drivers/usb/host/ehci.h:794:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
   drivers/usb/host/ehci.h:794:29: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:794:29: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
>> drivers/usb/host/ehci.h:787:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:787:36: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:787:36: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
>> drivers/usb/host/ehci.h:793:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:793:35: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:793:35: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
   drivers/usb/host/ehci.h:794:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
   drivers/usb/host/ehci.h:794:29: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:794:29: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
>> drivers/usb/host/ehci.h:787:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:787:36: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:787:36: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
>> drivers/usb/host/ehci.h:793:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
>> drivers/usb/host/ehci.h:793:35: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:793:35: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg
   drivers/usb/host/ehci.h:794:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got restricted __hc32 [usertype] *ohci_hcctrl_reg @@
   drivers/usb/host/ehci.h:794:29: sparse:     expected void const volatile [noderef] __iomem *addr
   drivers/usb/host/ehci.h:794:29: sparse:     got restricted __hc32 [usertype] *ohci_hcctrl_reg

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=670d0a4b10704667765f7d18f7592993d02783aa
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
vim +196 drivers/ata/ahci_xgene.c

2a0bdff6b958d1b Suman Tripathi 2014-07-07  172  
2a0bdff6b958d1b Suman Tripathi 2014-07-07  173  /**
2a0bdff6b958d1b Suman Tripathi 2014-07-07  174   * xgene_ahci_qc_issue - Issue commands to the device
2a0bdff6b958d1b Suman Tripathi 2014-07-07  175   * @qc: Command to issue
2a0bdff6b958d1b Suman Tripathi 2014-07-07  176   *
a3a84bc7c885eee Suman Tripathi 2015-01-06  177   * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot
a3a84bc7c885eee Suman Tripathi 2015-01-06  178   * clear the BSY bit after receiving the PIO setup FIS. This results in the dma
a3a84bc7c885eee Suman Tripathi 2015-01-06  179   * state machine goes into the CMFatalErrorUpdate state and locks up. By
a3a84bc7c885eee Suman Tripathi 2015-01-06  180   * restarting the dma engine, it removes the controller out of lock up state.
a3a84bc7c885eee Suman Tripathi 2015-01-06  181   *
a3a84bc7c885eee Suman Tripathi 2015-01-06  182   * Due to H/W errata, the controller is unable to save the PMP
a3a84bc7c885eee Suman Tripathi 2015-01-06  183   * field fetched from command header before sending the H2D FIS.
a3a84bc7c885eee Suman Tripathi 2015-01-06  184   * When the device returns the PMP port field in the D2H FIS, there is
a3a84bc7c885eee Suman Tripathi 2015-01-06  185   * a mismatch and results in command completion failure. The
a3a84bc7c885eee Suman Tripathi 2015-01-06  186   * workaround is to write the pmp value to PxFBS.DEV field before issuing
a3a84bc7c885eee Suman Tripathi 2015-01-06  187   * any command to PMP.
2a0bdff6b958d1b Suman Tripathi 2014-07-07  188   */
2a0bdff6b958d1b Suman Tripathi 2014-07-07  189  static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
2a0bdff6b958d1b Suman Tripathi 2014-07-07  190  {
2a0bdff6b958d1b Suman Tripathi 2014-07-07  191  	struct ata_port *ap = qc->ap;
2a0bdff6b958d1b Suman Tripathi 2014-07-07  192  	struct ahci_host_priv *hpriv = ap->host->private_data;
2a0bdff6b958d1b Suman Tripathi 2014-07-07  193  	struct xgene_ahci_context *ctx = hpriv->plat_data;
2a0bdff6b958d1b Suman Tripathi 2014-07-07  194  	int rc = 0;
a3a84bc7c885eee Suman Tripathi 2015-01-06  195  	u32 port_fbs;
a3a84bc7c885eee Suman Tripathi 2015-01-06 @196  	void *port_mmio = ahci_port_base(ap);
a3a84bc7c885eee Suman Tripathi 2015-01-06  197  
a3a84bc7c885eee Suman Tripathi 2015-01-06  198  	/*
a3a84bc7c885eee Suman Tripathi 2015-01-06  199  	 * Write the pmp value to PxFBS.DEV
a3a84bc7c885eee Suman Tripathi 2015-01-06  200  	 * for case of Port Mulitplier.
a3a84bc7c885eee Suman Tripathi 2015-01-06  201  	 */
a3a84bc7c885eee Suman Tripathi 2015-01-06  202  	if (ctx->class[ap->port_no] == ATA_DEV_PMP) {
a3a84bc7c885eee Suman Tripathi 2015-01-06 @203  		port_fbs = readl(port_mmio + PORT_FBS);
a3a84bc7c885eee Suman Tripathi 2015-01-06  204  		port_fbs &= ~PORT_FBS_DEV_MASK;
a3a84bc7c885eee Suman Tripathi 2015-01-06  205  		port_fbs |= qc->dev->link->pmp << PORT_FBS_DEV_OFFSET;
a3a84bc7c885eee Suman Tripathi 2015-01-06 @206  		writel(port_fbs, port_mmio + PORT_FBS);
a3a84bc7c885eee Suman Tripathi 2015-01-06  207  	}
2a0bdff6b958d1b Suman Tripathi 2014-07-07  208  
1102407bb714dce Suman Tripathi 2014-12-29  209  	if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) ||
09c32aaa3683cbc Suman Tripathi 2015-02-02  210  	    (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET) ||
09c32aaa3683cbc Suman Tripathi 2015-02-02  211  	    (ctx->last_cmd[ap->port_no] == ATA_CMD_SMART)))
2a0bdff6b958d1b Suman Tripathi 2014-07-07  212  		xgene_ahci_restart_engine(ap);
2a0bdff6b958d1b Suman Tripathi 2014-07-07  213  
2a0bdff6b958d1b Suman Tripathi 2014-07-07  214  	rc = ahci_qc_issue(qc);
2a0bdff6b958d1b Suman Tripathi 2014-07-07  215  
2a0bdff6b958d1b Suman Tripathi 2014-07-07  216  	/* Save the last command issued */
2a0bdff6b958d1b Suman Tripathi 2014-07-07  217  	ctx->last_cmd[ap->port_no] = qc->tf.command;
2a0bdff6b958d1b Suman Tripathi 2014-07-07  218  
2a0bdff6b958d1b Suman Tripathi 2014-07-07  219  	return rc;
2a0bdff6b958d1b Suman Tripathi 2014-07-07  220  }
2a0bdff6b958d1b Suman Tripathi 2014-07-07  221  

:::::: The code at line 196 was first introduced by commit
:::::: a3a84bc7c885eee954f1971c43e36a3587fbf565 ahci_xgene: Implement the workaround to support PMP enumeration and discovery.

:::::: TO: Suman Tripathi <stripathi@....com>
:::::: CC: Tejun Heo <tj@...nel.org>

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

Download attachment ".config.gz" of type "application/gzip" (34018 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ