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: <202108160328.EWUQtIJz-lkp@intel.com>
Date:   Mon, 16 Aug 2021 03:22:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Arnd Bergmann <arnd@...db.de>
Subject: drivers/scsi/mvumi.c:407:40: 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:   0aa78d17099b04fd9d36fe338af48ad6fe2d7fca
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date:   1 year ago
config: alpha-randconfig-s031-20210816 (attached as .config)
compiler: alpha-linux-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.3-348-gf0e6938b-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
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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/scsi/mvumi.c:81:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
   drivers/scsi/mvumi.c:81:52: sparse:     expected void [noderef] __iomem *
   drivers/scsi/mvumi.c:81:52: sparse:     got void *
   drivers/scsi/mvumi.c:90:39: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   drivers/scsi/mvumi.c:90:39: sparse:     expected void *
   drivers/scsi/mvumi.c:90:39: sparse:     got void [noderef] __iomem *
   drivers/scsi/mvumi.c:210:34: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] baseaddr_l @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:210:34: sparse:     expected unsigned int [usertype] baseaddr_l
   drivers/scsi/mvumi.c:210:34: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:211:34: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] baseaddr_h @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:211:34: sparse:     expected unsigned int [usertype] baseaddr_h
   drivers/scsi/mvumi.c:211:34: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:213:17: sparse: sparse: invalid assignment: |=
   drivers/scsi/mvumi.c:213:17: sparse:    left side has type unsigned int
   drivers/scsi/mvumi.c:213:17: sparse:    right side has type restricted __le32
   drivers/scsi/mvumi.c:213:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:213:17: sparse:     expected unsigned int [usertype] size
   drivers/scsi/mvumi.c:213:17: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:242:26: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] baseaddr_l @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:242:26: sparse:     expected unsigned int [usertype] baseaddr_l
   drivers/scsi/mvumi.c:242:26: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:243:26: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] baseaddr_h @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:243:26: sparse:     expected unsigned int [usertype] baseaddr_h
   drivers/scsi/mvumi.c:243:26: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:245:9: sparse: sparse: invalid assignment: |=
   drivers/scsi/mvumi.c:245:9: sparse:    left side has type unsigned int
   drivers/scsi/mvumi.c:245:9: sparse:    right side has type restricted __le32
   drivers/scsi/mvumi.c:245:9: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:245:9: sparse:     expected unsigned int [usertype] size
   drivers/scsi/mvumi.c:245:9: sparse:     got restricted __le32 [usertype]
>> drivers/scsi/mvumi.c:407:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *inb_read_pointer @@
   drivers/scsi/mvumi.c:407:40: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:407:40: sparse:     got void *inb_read_pointer
>> drivers/scsi/mvumi.c:429:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *ib_shadow @@
   drivers/scsi/mvumi.c:429:30: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:429:30: sparse:     got void *ib_shadow
   drivers/scsi/mvumi.c:458:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *ib_shadow @@
   drivers/scsi/mvumi.c:458:31: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:458:31: sparse:     got void *ib_shadow
   drivers/scsi/mvumi.c:459:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *inb_write_pointer @@
   drivers/scsi/mvumi.c:459:48: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:459:48: sparse:     got void *inb_write_pointer
>> drivers/scsi/mvumi.c:496:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *outb_copy_pointer @@
   drivers/scsi/mvumi.c:496:41: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:496:41: sparse:     got void *outb_copy_pointer
>> drivers/scsi/mvumi.c:497:48: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *ob_shadow @@
   drivers/scsi/mvumi.c:497:48: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:497:48: sparse:     got void *ob_shadow
>> drivers/scsi/mvumi.c:516:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *outb_read_pointer @@
   drivers/scsi/mvumi.c:516:33: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:516:33: sparse:     got void *outb_read_pointer
   drivers/scsi/mvumi.c:517:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *outb_copy_pointer @@
   drivers/scsi/mvumi.c:517:33: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:517:33: sparse:     got void *outb_copy_pointer
   drivers/scsi/mvumi.c:578:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_read_pointer @@
   drivers/scsi/mvumi.c:578:42: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:578:42: sparse:     got void *outb_read_pointer
   drivers/scsi/mvumi.c:585:26: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:585:26: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:585:26: sparse:     got void *enpointa_mask_reg
>> drivers/scsi/mvumi.c:586:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:586:26: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:586:26: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:589:40: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:589:40: sparse:     got void *pciea_to_arm_drbl_reg
>> drivers/scsi/mvumi.c:1281:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1281:28: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1281:28: sparse:     got void *arm_to_pciea_drbl_reg
   drivers/scsi/mvumi.c:1282:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1282:28: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1282:28: sparse:     got void *arm_to_pciea_drbl_reg
   drivers/scsi/mvumi.c:1284:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_mask_reg @@
   drivers/scsi/mvumi.c:1284:48: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1284:48: sparse:     got void *arm_to_pciea_mask_reg
>> drivers/scsi/mvumi.c:1285:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1285:28: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1285:28: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1286:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1286:28: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1286:28: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:612:26: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:612:26: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:612:26: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:613:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:613:28: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:613:28: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:615:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:615:46: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:615:46: sparse:     got void *pciea_to_arm_drbl_reg
   drivers/scsi/mvumi.c:624:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:624:36: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:624:36: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:670:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *reset_enable @@
   drivers/scsi/mvumi.c:670:32: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:670:32: sparse:     got void *reset_enable
   drivers/scsi/mvumi.c:671:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *reset_request @@
   drivers/scsi/mvumi.c:671:34: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:671:34: sparse:     got void *reset_request
   drivers/scsi/mvumi.c:673:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *reset_enable @@
   drivers/scsi/mvumi.c:673:35: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:673:35: sparse:     got void *reset_enable
   drivers/scsi/mvumi.c:674:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *reset_request @@
   drivers/scsi/mvumi.c:674:35: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:674:35: sparse:     got void *reset_request
>> drivers/scsi/mvumi.c:1100:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg0 @@
   drivers/scsi/mvumi.c:1100:36: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1100:36: sparse:     got void *arm_to_pciea_msg0
   drivers/scsi/mvumi.c:1115:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_msg1 @@
   drivers/scsi/mvumi.c:1115:52: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1115:52: sparse:     got void *pciea_to_arm_msg1
   drivers/scsi/mvumi.c:1116:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_msg0 @@
   drivers/scsi/mvumi.c:1116:39: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1116:39: sparse:     got void *pciea_to_arm_msg0
   drivers/scsi/mvumi.c:1117:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:1117:47: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1117:47: sparse:     got void *pciea_to_arm_drbl_reg
   drivers/scsi/mvumi.c:1122:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_msg1 @@
   drivers/scsi/mvumi.c:1122:45: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1122:45: sparse:     got void *pciea_to_arm_msg1
   drivers/scsi/mvumi.c:1124:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:1124:45: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1124:45: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:1127:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_msg0 @@
   drivers/scsi/mvumi.c:1127:39: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1127:39: sparse:     got void *pciea_to_arm_msg0
   drivers/scsi/mvumi.c:1128:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:1128:47: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1128:47: sparse:     got void *pciea_to_arm_drbl_reg
   drivers/scsi/mvumi.c:1168:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_msg0 @@
   drivers/scsi/mvumi.c:1168:39: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1168:39: sparse:     got void *pciea_to_arm_msg0
   drivers/scsi/mvumi.c:1169:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:1169:47: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1169:47: sparse:     got void *pciea_to_arm_drbl_reg
   drivers/scsi/mvumi.c:1174:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1174:36: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1174:36: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1176:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1176:36: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1176:36: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1177:50: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *ib_shadow @@
   drivers/scsi/mvumi.c:1177:50: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1177:50: sparse:     got void *ib_shadow
   drivers/scsi/mvumi.c:1180:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *inb_aval_count_basel @@
   drivers/scsi/mvumi.c:1180:45: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1180:45: sparse:     got void *inb_aval_count_basel
   drivers/scsi/mvumi.c:1182:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *inb_aval_count_baseh @@
   drivers/scsi/mvumi.c:1182:45: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1182:45: sparse:     got void *inb_aval_count_baseh
   drivers/scsi/mvumi.c:1188:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *ob_shadow @@
   drivers/scsi/mvumi.c:1188:61: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1188:61: sparse:     got void *ob_shadow
   drivers/scsi/mvumi.c:1190:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_copy_basel @@
   drivers/scsi/mvumi.c:1190:61: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1190:61: sparse:     got void *outb_copy_basel
   drivers/scsi/mvumi.c:1192:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_copy_baseh @@
   drivers/scsi/mvumi.c:1192:61: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1192:61: sparse:     got void *outb_copy_baseh
   drivers/scsi/mvumi.c:1244:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:1244:34: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1244:34: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:1248:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *pciea_to_arm_drbl_reg @@
   drivers/scsi/mvumi.c:1248:51: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1248:51: sparse:     got void *pciea_to_arm_drbl_reg
   drivers/scsi/mvumi.c:1256:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_msg1 @@
   drivers/scsi/mvumi.c:1256:42: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1256:42: sparse:     got void *arm_to_pciea_msg1
   drivers/scsi/mvumi.c:1849:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] src_low_addr @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:1849:35: sparse:     expected unsigned int [usertype] src_low_addr
   drivers/scsi/mvumi.c:1849:35: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:1851:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] src_high_addr @@     got restricted __le32 [usertype] @@
   drivers/scsi/mvumi.c:1851:36: sparse:     expected unsigned int [usertype] src_high_addr
   drivers/scsi/mvumi.c:1851:36: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mvumi.c:1903:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_mask_reg @@
   drivers/scsi/mvumi.c:1903:48: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1903:48: sparse:     got void *arm_to_pciea_mask_reg
   drivers/scsi/mvumi.c:1904:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1904:29: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1904:29: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1906:29: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1906:29: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1906:29: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1918:26: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_mask_reg @@
   drivers/scsi/mvumi.c:1918:26: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1918:26: sparse:     got void *arm_to_pciea_mask_reg
   drivers/scsi/mvumi.c:1919:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1919:29: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1919:29: sparse:     got void *enpointa_mask_reg
   drivers/scsi/mvumi.c:1922:29: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *enpointa_mask_reg @@
   drivers/scsi/mvumi.c:1922:29: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1922:29: sparse:     got void *enpointa_mask_reg
>> drivers/scsi/mvumi.c:1931:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *main_int_cause_reg @@
   drivers/scsi/mvumi.c:1931:31: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1931:31: sparse:     got void *main_int_cause_reg
>> drivers/scsi/mvumi.c:1935:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *outb_isr_cause @@
   drivers/scsi/mvumi.c:1935:36: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1935:36: sparse:     got void *outb_isr_cause
   drivers/scsi/mvumi.c:1939:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_isr_cause @@
   drivers/scsi/mvumi.c:1939:61: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1939:61: sparse:     got void *outb_isr_cause
   drivers/scsi/mvumi.c:1945:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_isr_cause @@
   drivers/scsi/mvumi.c:1945:53: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1945:53: sparse:     got void *outb_isr_cause
   drivers/scsi/mvumi.c:1951:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *outb_isr_cause @@
   drivers/scsi/mvumi.c:1951:36: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1951:36: sparse:     got void *outb_isr_cause
   drivers/scsi/mvumi.c:1953:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *outb_isr_cause @@
   drivers/scsi/mvumi.c:1953:61: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1953:61: sparse:     got void *outb_isr_cause
   drivers/scsi/mvumi.c:1956:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1956:43: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1956:43: sparse:     got void *arm_to_pciea_drbl_reg
   drivers/scsi/mvumi.c:1958:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1958:51: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1958:51: sparse:     got void *arm_to_pciea_drbl_reg
   drivers/scsi/mvumi.c:1975:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1975:37: sparse:     expected void const [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1975:37: sparse:     got void *arm_to_pciea_drbl_reg
   drivers/scsi/mvumi.c:1977:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got void *arm_to_pciea_drbl_reg @@
   drivers/scsi/mvumi.c:1977:45: sparse:     expected void [noderef] __iomem *addr
   drivers/scsi/mvumi.c:1977:45: sparse:     got void *arm_to_pciea_drbl_reg

vim +407 drivers/scsi/mvumi.c

f0c568a478f0353 Jianyun Li        2011-05-11  222  
f0c568a478f0353 Jianyun Li        2011-05-11  223  static int mvumi_internal_cmd_sgl(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
f0c568a478f0353 Jianyun Li        2011-05-11  224  							unsigned int size)
f0c568a478f0353 Jianyun Li        2011-05-11  225  {
f0c568a478f0353 Jianyun Li        2011-05-11  226  	struct mvumi_sgl *m_sg;
f0c568a478f0353 Jianyun Li        2011-05-11  227  	void *virt_addr;
f0c568a478f0353 Jianyun Li        2011-05-11  228  	dma_addr_t phy_addr;
f0c568a478f0353 Jianyun Li        2011-05-11  229  
f0c568a478f0353 Jianyun Li        2011-05-11  230  	if (size == 0)
f0c568a478f0353 Jianyun Li        2011-05-11  231  		return 0;
f0c568a478f0353 Jianyun Li        2011-05-11  232  
750afb08ca71310 Luis Chamberlain  2019-01-04  233  	virt_addr = dma_alloc_coherent(&mhba->pdev->dev, size, &phy_addr,
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  234  				       GFP_KERNEL);
f0c568a478f0353 Jianyun Li        2011-05-11  235  	if (!virt_addr)
f0c568a478f0353 Jianyun Li        2011-05-11  236  		return -1;
f0c568a478f0353 Jianyun Li        2011-05-11  237  
f0c568a478f0353 Jianyun Li        2011-05-11  238  	m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0];
f0c568a478f0353 Jianyun Li        2011-05-11  239  	cmd->frame->sg_counts = 1;
f0c568a478f0353 Jianyun Li        2011-05-11  240  	cmd->data_buf = virt_addr;
f0c568a478f0353 Jianyun Li        2011-05-11  241  
f0c568a478f0353 Jianyun Li        2011-05-11  242  	m_sg->baseaddr_l = cpu_to_le32(lower_32_bits(phy_addr));
f0c568a478f0353 Jianyun Li        2011-05-11 @243  	m_sg->baseaddr_h = cpu_to_le32(upper_32_bits(phy_addr));
bd756ddea18e02c Shun Fu           2012-09-23  244  	m_sg->flags = 1U << mhba->eot_flag;
bd756ddea18e02c Shun Fu           2012-09-23 @245  	sgd_setsz(mhba, m_sg, cpu_to_le32(size));
f0c568a478f0353 Jianyun Li        2011-05-11  246  
f0c568a478f0353 Jianyun Li        2011-05-11  247  	return 0;
f0c568a478f0353 Jianyun Li        2011-05-11  248  }
f0c568a478f0353 Jianyun Li        2011-05-11  249  
f0c568a478f0353 Jianyun Li        2011-05-11  250  static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba,
f0c568a478f0353 Jianyun Li        2011-05-11  251  				unsigned int buf_size)
f0c568a478f0353 Jianyun Li        2011-05-11  252  {
f0c568a478f0353 Jianyun Li        2011-05-11  253  	struct mvumi_cmd *cmd;
f0c568a478f0353 Jianyun Li        2011-05-11  254  
f0c568a478f0353 Jianyun Li        2011-05-11  255  	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
f0c568a478f0353 Jianyun Li        2011-05-11  256  	if (!cmd) {
f0c568a478f0353 Jianyun Li        2011-05-11  257  		dev_err(&mhba->pdev->dev, "failed to create a internal cmd\n");
f0c568a478f0353 Jianyun Li        2011-05-11  258  		return NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  259  	}
f0c568a478f0353 Jianyun Li        2011-05-11  260  	INIT_LIST_HEAD(&cmd->queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  261  
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  262  	cmd->frame = dma_alloc_coherent(&mhba->pdev->dev, mhba->ib_max_size,
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  263  			&cmd->frame_phys, GFP_KERNEL);
f0c568a478f0353 Jianyun Li        2011-05-11  264  	if (!cmd->frame) {
f0c568a478f0353 Jianyun Li        2011-05-11  265  		dev_err(&mhba->pdev->dev, "failed to allocate memory for FW"
f0c568a478f0353 Jianyun Li        2011-05-11  266  			" frame,size = %d.\n", mhba->ib_max_size);
f0c568a478f0353 Jianyun Li        2011-05-11  267  		kfree(cmd);
f0c568a478f0353 Jianyun Li        2011-05-11  268  		return NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  269  	}
f0c568a478f0353 Jianyun Li        2011-05-11  270  
f0c568a478f0353 Jianyun Li        2011-05-11  271  	if (buf_size) {
f0c568a478f0353 Jianyun Li        2011-05-11  272  		if (mvumi_internal_cmd_sgl(mhba, cmd, buf_size)) {
f0c568a478f0353 Jianyun Li        2011-05-11  273  			dev_err(&mhba->pdev->dev, "failed to allocate memory"
f0c568a478f0353 Jianyun Li        2011-05-11  274  						" for internal frame\n");
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  275  			dma_free_coherent(&mhba->pdev->dev, mhba->ib_max_size,
bd756ddea18e02c Shun Fu           2012-09-23  276  					cmd->frame, cmd->frame_phys);
f0c568a478f0353 Jianyun Li        2011-05-11  277  			kfree(cmd);
f0c568a478f0353 Jianyun Li        2011-05-11  278  			return NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  279  		}
f0c568a478f0353 Jianyun Li        2011-05-11  280  	} else
f0c568a478f0353 Jianyun Li        2011-05-11  281  		cmd->frame->sg_counts = 0;
f0c568a478f0353 Jianyun Li        2011-05-11  282  
f0c568a478f0353 Jianyun Li        2011-05-11  283  	return cmd;
f0c568a478f0353 Jianyun Li        2011-05-11  284  }
f0c568a478f0353 Jianyun Li        2011-05-11  285  
f0c568a478f0353 Jianyun Li        2011-05-11  286  static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba,
f0c568a478f0353 Jianyun Li        2011-05-11  287  						struct mvumi_cmd *cmd)
f0c568a478f0353 Jianyun Li        2011-05-11  288  {
f0c568a478f0353 Jianyun Li        2011-05-11  289  	struct mvumi_sgl *m_sg;
f0c568a478f0353 Jianyun Li        2011-05-11  290  	unsigned int size;
f0c568a478f0353 Jianyun Li        2011-05-11  291  	dma_addr_t phy_addr;
f0c568a478f0353 Jianyun Li        2011-05-11  292  
f0c568a478f0353 Jianyun Li        2011-05-11  293  	if (cmd && cmd->frame) {
f0c568a478f0353 Jianyun Li        2011-05-11  294  		if (cmd->frame->sg_counts) {
f0c568a478f0353 Jianyun Li        2011-05-11  295  			m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0];
bd756ddea18e02c Shun Fu           2012-09-23  296  			sgd_getsz(mhba, m_sg, size);
f0c568a478f0353 Jianyun Li        2011-05-11  297  
f0c568a478f0353 Jianyun Li        2011-05-11  298  			phy_addr = (dma_addr_t) m_sg->baseaddr_l |
f0c568a478f0353 Jianyun Li        2011-05-11  299  				(dma_addr_t) ((m_sg->baseaddr_h << 16) << 16);
f0c568a478f0353 Jianyun Li        2011-05-11  300  
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  301  			dma_free_coherent(&mhba->pdev->dev, size, cmd->data_buf,
f0c568a478f0353 Jianyun Li        2011-05-11  302  								phy_addr);
f0c568a478f0353 Jianyun Li        2011-05-11  303  		}
ab8e7f4bdfeac57 Christoph Hellwig 2018-10-10  304  		dma_free_coherent(&mhba->pdev->dev, mhba->ib_max_size,
bd756ddea18e02c Shun Fu           2012-09-23  305  				cmd->frame, cmd->frame_phys);
f0c568a478f0353 Jianyun Li        2011-05-11  306  		kfree(cmd);
f0c568a478f0353 Jianyun Li        2011-05-11  307  	}
f0c568a478f0353 Jianyun Li        2011-05-11  308  }
f0c568a478f0353 Jianyun Li        2011-05-11  309  
f0c568a478f0353 Jianyun Li        2011-05-11  310  /**
f0c568a478f0353 Jianyun Li        2011-05-11  311   * mvumi_get_cmd -	Get a command from the free pool
f0c568a478f0353 Jianyun Li        2011-05-11  312   * @mhba:		Adapter soft state
f0c568a478f0353 Jianyun Li        2011-05-11  313   *
f0c568a478f0353 Jianyun Li        2011-05-11  314   * Returns a free command from the pool
f0c568a478f0353 Jianyun Li        2011-05-11  315   */
f0c568a478f0353 Jianyun Li        2011-05-11  316  static struct mvumi_cmd *mvumi_get_cmd(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  317  {
f0c568a478f0353 Jianyun Li        2011-05-11  318  	struct mvumi_cmd *cmd = NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  319  
f0c568a478f0353 Jianyun Li        2011-05-11  320  	if (likely(!list_empty(&mhba->cmd_pool))) {
f0c568a478f0353 Jianyun Li        2011-05-11  321  		cmd = list_entry((&mhba->cmd_pool)->next,
f0c568a478f0353 Jianyun Li        2011-05-11  322  				struct mvumi_cmd, queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  323  		list_del_init(&cmd->queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  324  	} else
f0c568a478f0353 Jianyun Li        2011-05-11  325  		dev_warn(&mhba->pdev->dev, "command pool is empty!\n");
f0c568a478f0353 Jianyun Li        2011-05-11  326  
f0c568a478f0353 Jianyun Li        2011-05-11  327  	return cmd;
f0c568a478f0353 Jianyun Li        2011-05-11  328  }
f0c568a478f0353 Jianyun Li        2011-05-11  329  
f0c568a478f0353 Jianyun Li        2011-05-11  330  /**
f0c568a478f0353 Jianyun Li        2011-05-11  331   * mvumi_return_cmd -	Return a cmd to free command pool
f0c568a478f0353 Jianyun Li        2011-05-11  332   * @mhba:		Adapter soft state
f0c568a478f0353 Jianyun Li        2011-05-11  333   * @cmd:		Command packet to be returned to free command pool
f0c568a478f0353 Jianyun Li        2011-05-11  334   */
f0c568a478f0353 Jianyun Li        2011-05-11  335  static inline void mvumi_return_cmd(struct mvumi_hba *mhba,
f0c568a478f0353 Jianyun Li        2011-05-11  336  						struct mvumi_cmd *cmd)
f0c568a478f0353 Jianyun Li        2011-05-11  337  {
f0c568a478f0353 Jianyun Li        2011-05-11  338  	cmd->scmd = NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  339  	list_add_tail(&cmd->queue_pointer, &mhba->cmd_pool);
f0c568a478f0353 Jianyun Li        2011-05-11  340  }
f0c568a478f0353 Jianyun Li        2011-05-11  341  
f0c568a478f0353 Jianyun Li        2011-05-11  342  /**
f0c568a478f0353 Jianyun Li        2011-05-11  343   * mvumi_free_cmds -	Free all the cmds in the free cmd pool
f0c568a478f0353 Jianyun Li        2011-05-11  344   * @mhba:		Adapter soft state
f0c568a478f0353 Jianyun Li        2011-05-11  345   */
f0c568a478f0353 Jianyun Li        2011-05-11  346  static void mvumi_free_cmds(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  347  {
f0c568a478f0353 Jianyun Li        2011-05-11  348  	struct mvumi_cmd *cmd;
f0c568a478f0353 Jianyun Li        2011-05-11  349  
f0c568a478f0353 Jianyun Li        2011-05-11  350  	while (!list_empty(&mhba->cmd_pool)) {
f0c568a478f0353 Jianyun Li        2011-05-11  351  		cmd = list_first_entry(&mhba->cmd_pool, struct mvumi_cmd,
f0c568a478f0353 Jianyun Li        2011-05-11  352  							queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  353  		list_del(&cmd->queue_pointer);
bd756ddea18e02c Shun Fu           2012-09-23  354  		if (!(mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC))
f0c568a478f0353 Jianyun Li        2011-05-11  355  			kfree(cmd->frame);
f0c568a478f0353 Jianyun Li        2011-05-11  356  		kfree(cmd);
f0c568a478f0353 Jianyun Li        2011-05-11  357  	}
f0c568a478f0353 Jianyun Li        2011-05-11  358  }
f0c568a478f0353 Jianyun Li        2011-05-11  359  
f0c568a478f0353 Jianyun Li        2011-05-11  360  /**
f0c568a478f0353 Jianyun Li        2011-05-11  361   * mvumi_alloc_cmds -	Allocates the command packets
f0c568a478f0353 Jianyun Li        2011-05-11  362   * @mhba:		Adapter soft state
f0c568a478f0353 Jianyun Li        2011-05-11  363   *
f0c568a478f0353 Jianyun Li        2011-05-11  364   */
f0c568a478f0353 Jianyun Li        2011-05-11  365  static int mvumi_alloc_cmds(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  366  {
f0c568a478f0353 Jianyun Li        2011-05-11  367  	int i;
f0c568a478f0353 Jianyun Li        2011-05-11  368  	struct mvumi_cmd *cmd;
f0c568a478f0353 Jianyun Li        2011-05-11  369  
f0c568a478f0353 Jianyun Li        2011-05-11  370  	for (i = 0; i < mhba->max_io; i++) {
f0c568a478f0353 Jianyun Li        2011-05-11  371  		cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
f0c568a478f0353 Jianyun Li        2011-05-11  372  		if (!cmd)
f0c568a478f0353 Jianyun Li        2011-05-11  373  			goto err_exit;
f0c568a478f0353 Jianyun Li        2011-05-11  374  
f0c568a478f0353 Jianyun Li        2011-05-11  375  		INIT_LIST_HEAD(&cmd->queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  376  		list_add_tail(&cmd->queue_pointer, &mhba->cmd_pool);
bd756ddea18e02c Shun Fu           2012-09-23  377  		if (mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC) {
bd756ddea18e02c Shun Fu           2012-09-23  378  			cmd->frame = mhba->ib_frame + i * mhba->ib_max_size;
bd756ddea18e02c Shun Fu           2012-09-23  379  			cmd->frame_phys = mhba->ib_frame_phys
bd756ddea18e02c Shun Fu           2012-09-23  380  						+ i * mhba->ib_max_size;
bd756ddea18e02c Shun Fu           2012-09-23  381  		} else
f0c568a478f0353 Jianyun Li        2011-05-11  382  			cmd->frame = kzalloc(mhba->ib_max_size, GFP_KERNEL);
f0c568a478f0353 Jianyun Li        2011-05-11  383  		if (!cmd->frame)
f0c568a478f0353 Jianyun Li        2011-05-11  384  			goto err_exit;
f0c568a478f0353 Jianyun Li        2011-05-11  385  	}
f0c568a478f0353 Jianyun Li        2011-05-11  386  	return 0;
f0c568a478f0353 Jianyun Li        2011-05-11  387  
f0c568a478f0353 Jianyun Li        2011-05-11  388  err_exit:
f0c568a478f0353 Jianyun Li        2011-05-11  389  	dev_err(&mhba->pdev->dev,
f0c568a478f0353 Jianyun Li        2011-05-11  390  			"failed to allocate memory for cmd[0x%x].\n", i);
f0c568a478f0353 Jianyun Li        2011-05-11  391  	while (!list_empty(&mhba->cmd_pool)) {
f0c568a478f0353 Jianyun Li        2011-05-11  392  		cmd = list_first_entry(&mhba->cmd_pool, struct mvumi_cmd,
f0c568a478f0353 Jianyun Li        2011-05-11  393  						queue_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  394  		list_del(&cmd->queue_pointer);
bd756ddea18e02c Shun Fu           2012-09-23  395  		if (!(mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC))
f0c568a478f0353 Jianyun Li        2011-05-11  396  			kfree(cmd->frame);
f0c568a478f0353 Jianyun Li        2011-05-11  397  		kfree(cmd);
f0c568a478f0353 Jianyun Li        2011-05-11  398  	}
f0c568a478f0353 Jianyun Li        2011-05-11  399  	return -ENOMEM;
f0c568a478f0353 Jianyun Li        2011-05-11  400  }
f0c568a478f0353 Jianyun Li        2011-05-11  401  
bd756ddea18e02c Shun Fu           2012-09-23  402  static unsigned int mvumi_check_ib_list_9143(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  403  {
bd756ddea18e02c Shun Fu           2012-09-23  404  	unsigned int ib_rp_reg;
bd756ddea18e02c Shun Fu           2012-09-23  405  	struct mvumi_hw_regs *regs = mhba->regs;
bd756ddea18e02c Shun Fu           2012-09-23  406  
bd756ddea18e02c Shun Fu           2012-09-23 @407  	ib_rp_reg = ioread32(mhba->regs->inb_read_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  408  
bd756ddea18e02c Shun Fu           2012-09-23  409  	if (unlikely(((ib_rp_reg & regs->cl_slot_num_mask) ==
bd756ddea18e02c Shun Fu           2012-09-23  410  			(mhba->ib_cur_slot & regs->cl_slot_num_mask)) &&
bd756ddea18e02c Shun Fu           2012-09-23  411  			((ib_rp_reg & regs->cl_pointer_toggle)
bd756ddea18e02c Shun Fu           2012-09-23  412  			 != (mhba->ib_cur_slot & regs->cl_pointer_toggle)))) {
bd756ddea18e02c Shun Fu           2012-09-23  413  		dev_warn(&mhba->pdev->dev, "no free slot to use.\n");
bd756ddea18e02c Shun Fu           2012-09-23  414  		return 0;
bd756ddea18e02c Shun Fu           2012-09-23  415  	}
f0c568a478f0353 Jianyun Li        2011-05-11  416  	if (atomic_read(&mhba->fw_outstanding) >= mhba->max_io) {
f0c568a478f0353 Jianyun Li        2011-05-11  417  		dev_warn(&mhba->pdev->dev, "firmware io overflow.\n");
bd756ddea18e02c Shun Fu           2012-09-23  418  		return 0;
bd756ddea18e02c Shun Fu           2012-09-23  419  	} else {
bd756ddea18e02c Shun Fu           2012-09-23  420  		return mhba->max_io - atomic_read(&mhba->fw_outstanding);
bd756ddea18e02c Shun Fu           2012-09-23  421  	}
f0c568a478f0353 Jianyun Li        2011-05-11  422  }
f0c568a478f0353 Jianyun Li        2011-05-11  423  
bd756ddea18e02c Shun Fu           2012-09-23  424  static unsigned int mvumi_check_ib_list_9580(struct mvumi_hba *mhba)
bd756ddea18e02c Shun Fu           2012-09-23  425  {
bd756ddea18e02c Shun Fu           2012-09-23  426  	unsigned int count;
bd756ddea18e02c Shun Fu           2012-09-23  427  	if (atomic_read(&mhba->fw_outstanding) >= (mhba->max_io - 1))
bd756ddea18e02c Shun Fu           2012-09-23  428  		return 0;
bd756ddea18e02c Shun Fu           2012-09-23 @429  	count = ioread32(mhba->ib_shadow);
bd756ddea18e02c Shun Fu           2012-09-23  430  	if (count == 0xffff)
bd756ddea18e02c Shun Fu           2012-09-23  431  		return 0;
bd756ddea18e02c Shun Fu           2012-09-23  432  	return count;
f0c568a478f0353 Jianyun Li        2011-05-11  433  }
f0c568a478f0353 Jianyun Li        2011-05-11  434  
bd756ddea18e02c Shun Fu           2012-09-23  435  static void mvumi_get_ib_list_entry(struct mvumi_hba *mhba, void **ib_entry)
bd756ddea18e02c Shun Fu           2012-09-23  436  {
bd756ddea18e02c Shun Fu           2012-09-23  437  	unsigned int cur_ib_entry;
bd756ddea18e02c Shun Fu           2012-09-23  438  
bd756ddea18e02c Shun Fu           2012-09-23  439  	cur_ib_entry = mhba->ib_cur_slot & mhba->regs->cl_slot_num_mask;
f0c568a478f0353 Jianyun Li        2011-05-11  440  	cur_ib_entry++;
f0c568a478f0353 Jianyun Li        2011-05-11  441  	if (cur_ib_entry >= mhba->list_num_io) {
f0c568a478f0353 Jianyun Li        2011-05-11  442  		cur_ib_entry -= mhba->list_num_io;
bd756ddea18e02c Shun Fu           2012-09-23  443  		mhba->ib_cur_slot ^= mhba->regs->cl_pointer_toggle;
f0c568a478f0353 Jianyun Li        2011-05-11  444  	}
bd756ddea18e02c Shun Fu           2012-09-23  445  	mhba->ib_cur_slot &= ~mhba->regs->cl_slot_num_mask;
bd756ddea18e02c Shun Fu           2012-09-23  446  	mhba->ib_cur_slot |= (cur_ib_entry & mhba->regs->cl_slot_num_mask);
bd756ddea18e02c Shun Fu           2012-09-23  447  	if (mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC) {
bd756ddea18e02c Shun Fu           2012-09-23  448  		*ib_entry = mhba->ib_list + cur_ib_entry *
bd756ddea18e02c Shun Fu           2012-09-23  449  				sizeof(struct mvumi_dyn_list_entry);
bd756ddea18e02c Shun Fu           2012-09-23  450  	} else {
f0c568a478f0353 Jianyun Li        2011-05-11  451  		*ib_entry = mhba->ib_list + cur_ib_entry * mhba->ib_max_size;
bd756ddea18e02c Shun Fu           2012-09-23  452  	}
f0c568a478f0353 Jianyun Li        2011-05-11  453  	atomic_inc(&mhba->fw_outstanding);
f0c568a478f0353 Jianyun Li        2011-05-11  454  }
f0c568a478f0353 Jianyun Li        2011-05-11  455  
f0c568a478f0353 Jianyun Li        2011-05-11  456  static void mvumi_send_ib_list_entry(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  457  {
bd756ddea18e02c Shun Fu           2012-09-23 @458  	iowrite32(0xffff, mhba->ib_shadow);
bd756ddea18e02c Shun Fu           2012-09-23 @459  	iowrite32(mhba->ib_cur_slot, mhba->regs->inb_write_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  460  }
f0c568a478f0353 Jianyun Li        2011-05-11  461  
f0c568a478f0353 Jianyun Li        2011-05-11  462  static char mvumi_check_ob_frame(struct mvumi_hba *mhba,
f0c568a478f0353 Jianyun Li        2011-05-11  463  		unsigned int cur_obf, struct mvumi_rsp_frame *p_outb_frame)
f0c568a478f0353 Jianyun Li        2011-05-11  464  {
f0c568a478f0353 Jianyun Li        2011-05-11  465  	unsigned short tag, request_id;
f0c568a478f0353 Jianyun Li        2011-05-11  466  
f0c568a478f0353 Jianyun Li        2011-05-11  467  	udelay(1);
f0c568a478f0353 Jianyun Li        2011-05-11  468  	p_outb_frame = mhba->ob_list + cur_obf * mhba->ob_max_size;
f0c568a478f0353 Jianyun Li        2011-05-11  469  	request_id = p_outb_frame->request_id;
f0c568a478f0353 Jianyun Li        2011-05-11  470  	tag = p_outb_frame->tag;
f0c568a478f0353 Jianyun Li        2011-05-11  471  	if (tag > mhba->tag_pool.size) {
f0c568a478f0353 Jianyun Li        2011-05-11  472  		dev_err(&mhba->pdev->dev, "ob frame data error\n");
f0c568a478f0353 Jianyun Li        2011-05-11  473  		return -1;
f0c568a478f0353 Jianyun Li        2011-05-11  474  	}
f0c568a478f0353 Jianyun Li        2011-05-11  475  	if (mhba->tag_cmd[tag] == NULL) {
f0c568a478f0353 Jianyun Li        2011-05-11  476  		dev_err(&mhba->pdev->dev, "tag[0x%x] with NO command\n", tag);
f0c568a478f0353 Jianyun Li        2011-05-11  477  		return -1;
f0c568a478f0353 Jianyun Li        2011-05-11  478  	} else if (mhba->tag_cmd[tag]->request_id != request_id &&
f0c568a478f0353 Jianyun Li        2011-05-11  479  						mhba->request_id_enabled) {
f0c568a478f0353 Jianyun Li        2011-05-11  480  			dev_err(&mhba->pdev->dev, "request ID from FW:0x%x,"
f0c568a478f0353 Jianyun Li        2011-05-11  481  					"cmd request ID:0x%x\n", request_id,
f0c568a478f0353 Jianyun Li        2011-05-11  482  					mhba->tag_cmd[tag]->request_id);
f0c568a478f0353 Jianyun Li        2011-05-11  483  			return -1;
f0c568a478f0353 Jianyun Li        2011-05-11  484  	}
f0c568a478f0353 Jianyun Li        2011-05-11  485  
f0c568a478f0353 Jianyun Li        2011-05-11  486  	return 0;
f0c568a478f0353 Jianyun Li        2011-05-11  487  }
f0c568a478f0353 Jianyun Li        2011-05-11  488  
bd756ddea18e02c Shun Fu           2012-09-23  489  static int mvumi_check_ob_list_9143(struct mvumi_hba *mhba,
bd756ddea18e02c Shun Fu           2012-09-23  490  			unsigned int *cur_obf, unsigned int *assign_obf_end)
f0c568a478f0353 Jianyun Li        2011-05-11  491  {
bd756ddea18e02c Shun Fu           2012-09-23  492  	unsigned int ob_write, ob_write_shadow;
bd756ddea18e02c Shun Fu           2012-09-23  493  	struct mvumi_hw_regs *regs = mhba->regs;
f0c568a478f0353 Jianyun Li        2011-05-11  494  
f0c568a478f0353 Jianyun Li        2011-05-11  495  	do {
bd756ddea18e02c Shun Fu           2012-09-23 @496  		ob_write = ioread32(regs->outb_copy_pointer);
bd756ddea18e02c Shun Fu           2012-09-23 @497  		ob_write_shadow = ioread32(mhba->ob_shadow);
bd756ddea18e02c Shun Fu           2012-09-23  498  	} while ((ob_write & regs->cl_slot_num_mask) != ob_write_shadow);
f0c568a478f0353 Jianyun Li        2011-05-11  499  
bd756ddea18e02c Shun Fu           2012-09-23  500  	*cur_obf = mhba->ob_cur_slot & mhba->regs->cl_slot_num_mask;
bd756ddea18e02c Shun Fu           2012-09-23  501  	*assign_obf_end = ob_write & mhba->regs->cl_slot_num_mask;
f0c568a478f0353 Jianyun Li        2011-05-11  502  
bd756ddea18e02c Shun Fu           2012-09-23  503  	if ((ob_write & regs->cl_pointer_toggle) !=
bd756ddea18e02c Shun Fu           2012-09-23  504  			(mhba->ob_cur_slot & regs->cl_pointer_toggle)) {
bd756ddea18e02c Shun Fu           2012-09-23  505  		*assign_obf_end += mhba->list_num_io;
bd756ddea18e02c Shun Fu           2012-09-23  506  	}
bd756ddea18e02c Shun Fu           2012-09-23  507  	return 0;
f0c568a478f0353 Jianyun Li        2011-05-11  508  }
f0c568a478f0353 Jianyun Li        2011-05-11  509  
bd756ddea18e02c Shun Fu           2012-09-23  510  static int mvumi_check_ob_list_9580(struct mvumi_hba *mhba,
bd756ddea18e02c Shun Fu           2012-09-23  511  			unsigned int *cur_obf, unsigned int *assign_obf_end)
bd756ddea18e02c Shun Fu           2012-09-23  512  {
bd756ddea18e02c Shun Fu           2012-09-23  513  	unsigned int ob_write;
bd756ddea18e02c Shun Fu           2012-09-23  514  	struct mvumi_hw_regs *regs = mhba->regs;
bd756ddea18e02c Shun Fu           2012-09-23  515  
bd756ddea18e02c Shun Fu           2012-09-23 @516  	ob_write = ioread32(regs->outb_read_pointer);
bd756ddea18e02c Shun Fu           2012-09-23 @517  	ob_write = ioread32(regs->outb_copy_pointer);
bd756ddea18e02c Shun Fu           2012-09-23  518  	*cur_obf = mhba->ob_cur_slot & mhba->regs->cl_slot_num_mask;
bd756ddea18e02c Shun Fu           2012-09-23  519  	*assign_obf_end = ob_write & mhba->regs->cl_slot_num_mask;
bd756ddea18e02c Shun Fu           2012-09-23  520  	if (*assign_obf_end < *cur_obf)
bd756ddea18e02c Shun Fu           2012-09-23  521  		*assign_obf_end += mhba->list_num_io;
bd756ddea18e02c Shun Fu           2012-09-23  522  	else if (*assign_obf_end == *cur_obf)
bd756ddea18e02c Shun Fu           2012-09-23  523  		return -1;
bd756ddea18e02c Shun Fu           2012-09-23  524  	return 0;
bd756ddea18e02c Shun Fu           2012-09-23  525  }
bd756ddea18e02c Shun Fu           2012-09-23  526  
bd756ddea18e02c Shun Fu           2012-09-23  527  static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)
bd756ddea18e02c Shun Fu           2012-09-23  528  {
bd756ddea18e02c Shun Fu           2012-09-23  529  	unsigned int cur_obf, assign_obf_end, i;
bd756ddea18e02c Shun Fu           2012-09-23  530  	struct mvumi_ob_data *ob_data;
bd756ddea18e02c Shun Fu           2012-09-23  531  	struct mvumi_rsp_frame *p_outb_frame;
bd756ddea18e02c Shun Fu           2012-09-23  532  	struct mvumi_hw_regs *regs = mhba->regs;
bd756ddea18e02c Shun Fu           2012-09-23  533  
bd756ddea18e02c Shun Fu           2012-09-23  534  	if (mhba->instancet->check_ob_list(mhba, &cur_obf, &assign_obf_end))
bd756ddea18e02c Shun Fu           2012-09-23  535  		return;
bd756ddea18e02c Shun Fu           2012-09-23  536  
f0c568a478f0353 Jianyun Li        2011-05-11  537  	for (i = (assign_obf_end - cur_obf); i != 0; i--) {
f0c568a478f0353 Jianyun Li        2011-05-11  538  		cur_obf++;
f0c568a478f0353 Jianyun Li        2011-05-11  539  		if (cur_obf >= mhba->list_num_io) {
f0c568a478f0353 Jianyun Li        2011-05-11  540  			cur_obf -= mhba->list_num_io;
bd756ddea18e02c Shun Fu           2012-09-23  541  			mhba->ob_cur_slot ^= regs->cl_pointer_toggle;
f0c568a478f0353 Jianyun Li        2011-05-11  542  		}
f0c568a478f0353 Jianyun Li        2011-05-11  543  
f0c568a478f0353 Jianyun Li        2011-05-11  544  		p_outb_frame = mhba->ob_list + cur_obf * mhba->ob_max_size;
f0c568a478f0353 Jianyun Li        2011-05-11  545  
f0c568a478f0353 Jianyun Li        2011-05-11  546  		/* Copy pointer may point to entry in outbound list
f0c568a478f0353 Jianyun Li        2011-05-11  547  		*  before entry has valid data
f0c568a478f0353 Jianyun Li        2011-05-11  548  		*/
f0c568a478f0353 Jianyun Li        2011-05-11  549  		if (unlikely(p_outb_frame->tag > mhba->tag_pool.size ||
f0c568a478f0353 Jianyun Li        2011-05-11  550  			mhba->tag_cmd[p_outb_frame->tag] == NULL ||
f0c568a478f0353 Jianyun Li        2011-05-11  551  			p_outb_frame->request_id !=
f0c568a478f0353 Jianyun Li        2011-05-11  552  				mhba->tag_cmd[p_outb_frame->tag]->request_id))
f0c568a478f0353 Jianyun Li        2011-05-11  553  			if (mvumi_check_ob_frame(mhba, cur_obf, p_outb_frame))
f0c568a478f0353 Jianyun Li        2011-05-11  554  				continue;
f0c568a478f0353 Jianyun Li        2011-05-11  555  
f0c568a478f0353 Jianyun Li        2011-05-11  556  		if (!list_empty(&mhba->ob_data_list)) {
f0c568a478f0353 Jianyun Li        2011-05-11  557  			ob_data = (struct mvumi_ob_data *)
f0c568a478f0353 Jianyun Li        2011-05-11  558  				list_first_entry(&mhba->ob_data_list,
f0c568a478f0353 Jianyun Li        2011-05-11  559  					struct mvumi_ob_data, list);
f0c568a478f0353 Jianyun Li        2011-05-11  560  			list_del_init(&ob_data->list);
f0c568a478f0353 Jianyun Li        2011-05-11  561  		} else {
f0c568a478f0353 Jianyun Li        2011-05-11  562  			ob_data = NULL;
f0c568a478f0353 Jianyun Li        2011-05-11  563  			if (cur_obf == 0) {
f0c568a478f0353 Jianyun Li        2011-05-11  564  				cur_obf = mhba->list_num_io - 1;
bd756ddea18e02c Shun Fu           2012-09-23  565  				mhba->ob_cur_slot ^= regs->cl_pointer_toggle;
f0c568a478f0353 Jianyun Li        2011-05-11  566  			} else
f0c568a478f0353 Jianyun Li        2011-05-11  567  				cur_obf -= 1;
f0c568a478f0353 Jianyun Li        2011-05-11  568  			break;
f0c568a478f0353 Jianyun Li        2011-05-11  569  		}
f0c568a478f0353 Jianyun Li        2011-05-11  570  
f0c568a478f0353 Jianyun Li        2011-05-11  571  		memcpy(ob_data->data, p_outb_frame, mhba->ob_max_size);
f0c568a478f0353 Jianyun Li        2011-05-11  572  		p_outb_frame->tag = 0xff;
f0c568a478f0353 Jianyun Li        2011-05-11  573  
f0c568a478f0353 Jianyun Li        2011-05-11  574  		list_add_tail(&ob_data->list, &mhba->free_ob_list);
f0c568a478f0353 Jianyun Li        2011-05-11  575  	}
bd756ddea18e02c Shun Fu           2012-09-23  576  	mhba->ob_cur_slot &= ~regs->cl_slot_num_mask;
bd756ddea18e02c Shun Fu           2012-09-23  577  	mhba->ob_cur_slot |= (cur_obf & regs->cl_slot_num_mask);
bd756ddea18e02c Shun Fu           2012-09-23  578  	iowrite32(mhba->ob_cur_slot, regs->outb_read_pointer);
f0c568a478f0353 Jianyun Li        2011-05-11  579  }
f0c568a478f0353 Jianyun Li        2011-05-11  580  
bd756ddea18e02c Shun Fu           2012-09-23  581  static void mvumi_reset(struct mvumi_hba *mhba)
f0c568a478f0353 Jianyun Li        2011-05-11  582  {
bd756ddea18e02c Shun Fu           2012-09-23  583  	struct mvumi_hw_regs *regs = mhba->regs;
bd756ddea18e02c Shun Fu           2012-09-23  584  
bd756ddea18e02c Shun Fu           2012-09-23 @585  	iowrite32(0, regs->enpointa_mask_reg);
bd756ddea18e02c Shun Fu           2012-09-23 @586  	if (ioread32(regs->arm_to_pciea_msg1) != HANDSHAKE_DONESTATE)
f0c568a478f0353 Jianyun Li        2011-05-11  587  		return;
f0c568a478f0353 Jianyun Li        2011-05-11  588  
bd756ddea18e02c Shun Fu           2012-09-23  589  	iowrite32(DRBL_SOFT_RESET, regs->pciea_to_arm_drbl_reg);
f0c568a478f0353 Jianyun Li        2011-05-11  590  }
f0c568a478f0353 Jianyun Li        2011-05-11  591  

:::::: The code at line 407 was first introduced by commit
:::::: bd756ddea18e02ccea8b29496b2fe3bd91af8eb7 [SCSI] mvumi: Add support for Marvell SAS/SATA RAID-on-Chip(ROC) 88RC9580

:::::: TO: Shun Fu <fushun@...il.com>
:::::: CC: James Bottomley <JBottomley@...allels.com>

---
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" (27599 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ