All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/scsi/fnic/vnic_dev.c:332:32: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Thu, 24 Dec 2020 02:44:36 +0800	[thread overview]
Message-ID: <202012240229.hlb4fyMv-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb5894306cfa2c7d9b6168182876ff5948735
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date:   4 months ago
config: i386-randconfig-s001-20201220 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # 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=8f28ca6bd8211214faf717677bbffe375c2a6072
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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 >>)"
>> drivers/scsi/fnic/vnic_dev.c:332:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:332:32: sparse:     expected void const [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:332:32: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse:     expected void const [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse:     expected void [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct vnic_wq_ctrl *wq_ctrl @@     got struct vnic_wq_ctrl [noderef] __iomem *ctrl @@
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse:     expected struct vnic_wq_ctrl *wq_ctrl
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse:     got struct vnic_wq_ctrl [noderef] __iomem *ctrl
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *p @@     got void [noderef] __iomem * @@
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse:     expected void *p
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse:     got void [noderef] __iomem *

vim +332 drivers/scsi/fnic/vnic_dev.c

5df6d737dd4b0fe Abhijeet Joglekar 2009-04-17  318  
363f4d937501ba4 Jason Yan         2020-04-15  319  static int vnic_dev_cmd2(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  320  		int wait)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  321  {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  322  	struct devcmd2_controller *dc2c = vdev->devcmd2;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  323  	struct devcmd2_result *result;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  324  	u8 color;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  325  	unsigned int i;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  326  	int delay;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  327  	int err;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  328  	u32 fetch_index;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  329  	u32 posted;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  330  	u32 new_posted;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  331  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18 @332  	posted = ioread32(&dc2c->wq_ctrl->posted_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  333  	fetch_index = ioread32(&dc2c->wq_ctrl->fetch_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  334  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  335  	if (posted == 0xFFFFFFFF || fetch_index == 0xFFFFFFFF) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  336  		/* Hardware surprise removal: return error */
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  337  		pr_err("%s: devcmd2 invalid posted or fetch index on cmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  338  				pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  339  		pr_err("%s: fetch index: %u, posted index: %u\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  340  				pci_name(vdev->pdev), fetch_index, posted);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  341  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  342  		return -ENODEV;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  343  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  344  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  345  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  346  	new_posted = (posted + 1) % DEVCMD2_RING_SIZE;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  347  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  348  	if (new_posted == fetch_index) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  349  		pr_err("%s: devcmd2 wq full while issuing cmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  350  				pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  351  		pr_err("%s: fetch index: %u, posted index: %u\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  352  				pci_name(vdev->pdev), fetch_index, posted);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  353  		return -EBUSY;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  354  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  355  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  356  	dc2c->cmd_ring[posted].cmd = cmd;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  357  	dc2c->cmd_ring[posted].flags = 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  358  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  359  	if ((_CMD_FLAGS(cmd) & _CMD_FLAGS_NOWAIT))
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  360  		dc2c->cmd_ring[posted].flags |= DEVCMD2_FNORESULT;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  361  	if (_CMD_DIR(cmd) & _CMD_DIR_WRITE) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  362  		for (i = 0; i < VNIC_DEVCMD_NARGS; i++)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  363  			dc2c->cmd_ring[posted].args[i] = vdev->args[i];
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  364  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  365  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  366  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  367  	/* Adding write memory barrier prevents compiler and/or CPU
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  368  	 * reordering, thus avoiding descriptor posting before
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  369  	 * descriptor is initialized. Otherwise, hardware can read
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  370  	 * stale descriptor fields.
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  371  	 */
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  372  	wmb();
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  373  	iowrite32(new_posted, &dc2c->wq_ctrl->posted_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  374  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  375  	if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  376  		return 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  377  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  378  	result = dc2c->result + dc2c->next_result;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  379  	color = dc2c->color;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  380  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  381  	dc2c->next_result++;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  382  	if (dc2c->next_result == dc2c->result_size) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  383  		dc2c->next_result = 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  384  		dc2c->color = dc2c->color ? 0 : 1;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  385  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  386  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  387  	for (delay = 0; delay < wait; delay++) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  388  		udelay(100);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  389  		if (result->color == color) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  390  			if (result->error) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  391  				err = -(int) result->error;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  392  				if (err != ERR_ECMDUNKNOWN ||
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  393  						cmd != CMD_CAPABILITY)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  394  					pr_err("%s:Error %d devcmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  395  						pci_name(vdev->pdev),
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  396  						err, _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  397  				return err;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  398  			}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  399  			if (_CMD_DIR(cmd) & _CMD_DIR_READ) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  400  				rmb(); /*prevent reorder while reding result*/
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  401  				for (i = 0; i < VNIC_DEVCMD_NARGS; i++)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  402  					vdev->args[i] = result->results[i];
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  403  			}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  404  			return 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  405  		}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  406  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  407  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  408  	pr_err("%s:Timed out devcmd %d\n", pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  409  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  410  	return -ETIMEDOUT;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  411  }
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  412  

:::::: The code at line 332 was first introduced by commit
:::::: 0a2fdd2215e1fa3b417792bd6e9cb719822cbfb6 scsi: fnic: Adding devcmd2 init and posting interfaces

:::::: TO: Satish Kharat <satishkh@cisco.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Arnd Bergmann <arnd@arndb.de>
Subject: drivers/scsi/fnic/vnic_dev.c:332:32: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Thu, 24 Dec 2020 02:44:36 +0800	[thread overview]
Message-ID: <202012240229.hlb4fyMv-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb5894306cfa2c7d9b6168182876ff5948735
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date:   4 months ago
config: i386-randconfig-s001-20201220 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # 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=8f28ca6bd8211214faf717677bbffe375c2a6072
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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 >>)"
>> drivers/scsi/fnic/vnic_dev.c:332:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:332:32: sparse:     expected void const [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:332:32: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse:     expected void const [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:333:37: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem * @@     got unsigned int * @@
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse:     expected void [noderef] __iomem *
   drivers/scsi/fnic/vnic_dev.c:373:36: sparse:     got unsigned int *
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct vnic_wq_ctrl *wq_ctrl @@     got struct vnic_wq_ctrl [noderef] __iomem *ctrl @@
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse:     expected struct vnic_wq_ctrl *wq_ctrl
   drivers/scsi/fnic/vnic_dev.c:469:32: sparse:     got struct vnic_wq_ctrl [noderef] __iomem *ctrl
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *p @@     got void [noderef] __iomem * @@
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse:     expected void *p
   drivers/scsi/fnic/vnic_dev.c:943:11: sparse:     got void [noderef] __iomem *

vim +332 drivers/scsi/fnic/vnic_dev.c

5df6d737dd4b0fe Abhijeet Joglekar 2009-04-17  318  
363f4d937501ba4 Jason Yan         2020-04-15  319  static int vnic_dev_cmd2(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  320  		int wait)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  321  {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  322  	struct devcmd2_controller *dc2c = vdev->devcmd2;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  323  	struct devcmd2_result *result;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  324  	u8 color;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  325  	unsigned int i;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  326  	int delay;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  327  	int err;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  328  	u32 fetch_index;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  329  	u32 posted;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  330  	u32 new_posted;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  331  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18 @332  	posted = ioread32(&dc2c->wq_ctrl->posted_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  333  	fetch_index = ioread32(&dc2c->wq_ctrl->fetch_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  334  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  335  	if (posted == 0xFFFFFFFF || fetch_index == 0xFFFFFFFF) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  336  		/* Hardware surprise removal: return error */
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  337  		pr_err("%s: devcmd2 invalid posted or fetch index on cmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  338  				pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  339  		pr_err("%s: fetch index: %u, posted index: %u\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  340  				pci_name(vdev->pdev), fetch_index, posted);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  341  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  342  		return -ENODEV;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  343  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  344  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  345  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  346  	new_posted = (posted + 1) % DEVCMD2_RING_SIZE;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  347  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  348  	if (new_posted == fetch_index) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  349  		pr_err("%s: devcmd2 wq full while issuing cmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  350  				pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  351  		pr_err("%s: fetch index: %u, posted index: %u\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  352  				pci_name(vdev->pdev), fetch_index, posted);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  353  		return -EBUSY;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  354  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  355  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  356  	dc2c->cmd_ring[posted].cmd = cmd;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  357  	dc2c->cmd_ring[posted].flags = 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  358  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  359  	if ((_CMD_FLAGS(cmd) & _CMD_FLAGS_NOWAIT))
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  360  		dc2c->cmd_ring[posted].flags |= DEVCMD2_FNORESULT;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  361  	if (_CMD_DIR(cmd) & _CMD_DIR_WRITE) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  362  		for (i = 0; i < VNIC_DEVCMD_NARGS; i++)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  363  			dc2c->cmd_ring[posted].args[i] = vdev->args[i];
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  364  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  365  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  366  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  367  	/* Adding write memory barrier prevents compiler and/or CPU
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  368  	 * reordering, thus avoiding descriptor posting before
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  369  	 * descriptor is initialized. Otherwise, hardware can read
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  370  	 * stale descriptor fields.
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  371  	 */
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  372  	wmb();
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  373  	iowrite32(new_posted, &dc2c->wq_ctrl->posted_index);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  374  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  375  	if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  376  		return 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  377  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  378  	result = dc2c->result + dc2c->next_result;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  379  	color = dc2c->color;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  380  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  381  	dc2c->next_result++;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  382  	if (dc2c->next_result == dc2c->result_size) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  383  		dc2c->next_result = 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  384  		dc2c->color = dc2c->color ? 0 : 1;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  385  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  386  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  387  	for (delay = 0; delay < wait; delay++) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  388  		udelay(100);
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  389  		if (result->color == color) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  390  			if (result->error) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  391  				err = -(int) result->error;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  392  				if (err != ERR_ECMDUNKNOWN ||
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  393  						cmd != CMD_CAPABILITY)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  394  					pr_err("%s:Error %d devcmd %d\n",
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  395  						pci_name(vdev->pdev),
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  396  						err, _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  397  				return err;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  398  			}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  399  			if (_CMD_DIR(cmd) & _CMD_DIR_READ) {
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  400  				rmb(); /*prevent reorder while reding result*/
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  401  				for (i = 0; i < VNIC_DEVCMD_NARGS; i++)
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  402  					vdev->args[i] = result->results[i];
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  403  			}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  404  			return 0;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  405  		}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  406  	}
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  407  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  408  	pr_err("%s:Timed out devcmd %d\n", pci_name(vdev->pdev), _CMD_N(cmd));
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  409  
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  410  	return -ETIMEDOUT;
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  411  }
0a2fdd2215e1fa3 Satish Kharat     2019-01-18  412  

:::::: The code at line 332 was first introduced by commit
:::::: 0a2fdd2215e1fa3b417792bd6e9cb719822cbfb6 scsi: fnic: Adding devcmd2 init and posting interfaces

:::::: TO: Satish Kharat <satishkh@cisco.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
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: 38067 bytes --]

             reply	other threads:[~2020-12-23 18:44 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 18:44 kernel test robot [this message]
2020-12-23 18:44 ` drivers/scsi/fnic/vnic_dev.c:332:32: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-12-09 12:06 kernel test robot
2023-12-08 19:29 kernel test robot
2023-12-07 18:32 kernel test robot
2023-12-05 20:41 kernel test robot
2023-12-04 23:49 kernel test robot
2023-11-16  1:29 kernel test robot
2023-11-15 19:01 kernel test robot
2021-04-12 22:02 kernel test robot
2021-04-12 22:02 ` kernel test robot
2021-03-07  6:14 kernel test robot
2021-03-07  6:14 ` kernel test robot
2021-02-12 23:27 kernel test robot
2021-02-12 23:27 ` kernel test robot
2021-01-06 10:13 kernel test robot
2021-01-06 10:13 ` kernel test robot
2020-12-26 12:00 kernel test robot
2020-12-26 12:00 ` kernel test robot
2020-12-25 12:37 kernel test robot
2020-12-25 12:37 ` kernel test robot
2020-12-24 17:09 kernel test robot
2020-12-24 17:09 ` kernel test robot
2020-12-24 12:23 kernel test robot
2020-12-24 12:23 ` kernel test robot
2020-12-23 23:32 kernel test robot
2020-12-23 23:32 ` kernel test robot
2020-12-23 15:11 kernel test robot
2020-12-23 15:11 ` kernel test robot
2020-12-21 18:45 kernel test robot
2020-12-21 18:45 ` kernel test robot
2020-10-22  8:14 kernel test robot
2020-10-22  8:14 ` kernel test robot
2020-08-06  0:02 kernel test robot
2020-08-06  0:02 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202012240229.hlb4fyMv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.