[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202212280121.Fntz0ZQO-lkp@intel.com>
Date: Wed, 28 Dec 2022 01:59:31 +0800
From: kernel test robot <lkp@...el.com>
To: Subbaraya Sundeep <sbhatta@...vell.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Geetha sowjanya <gakula@...vell.com>,
Sunil Goutham <sgoutham@...vell.com>
Subject: drivers/net/ethernet/marvell/octeontx2/af/rvu.c:1964:46: sparse:
sparse: cast removes address space '__iomem' of expression
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1b929c02afd37871d5afb9d498426f83432e71c2
commit: 98c5611163603d3d8012b1bf64ab48fd932cf734 octeontx2-af: cn10k: Add mbox support for CN10K platform
date: 1 year, 10 months ago
config: mips-randconfig-s051-20221227
compiler: mips64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=98c5611163603d3d8012b1bf64ab48fd932cf734
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 98c5611163603d3d8012b1bf64ab48fd932cf734
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash drivers/net/ethernet/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:780:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct rvu_fwdata *fwdata @@ got void [noderef] __iomem * @@
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:780:21: sparse: expected struct rvu_fwdata *fwdata
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:780:21: sparse: got void [noderef] __iomem *
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:786:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got struct rvu_fwdata *fwdata @@
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:786:28: sparse: expected void const volatile [noderef] __iomem *addr
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:786:28: sparse: got struct rvu_fwdata *fwdata
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:799:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got struct rvu_fwdata *fwdata @@
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:799:28: sparse: expected void const volatile [noderef] __iomem *addr
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:799:28: sparse: got struct rvu_fwdata *fwdata
>> drivers/net/ethernet/marvell/octeontx2/af/rvu.c:1964:46: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/marvell/octeontx2/af/rvu.c:1984:38: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +1964 drivers/net/ethernet/marvell/octeontx2/af/rvu.c
1941
1942 static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr,
1943 int num, int type)
1944 {
1945 struct rvu_hwinfo *hw = rvu->hw;
1946 int region;
1947 u64 bar4;
1948
1949 /* For cn10k platform VF mailbox regions of a PF follows after the
1950 * PF <-> AF mailbox region. Whereas for Octeontx2 it is read from
1951 * RVU_PF_VF_BAR4_ADDR register.
1952 */
1953 if (type == TYPE_AFVF) {
1954 for (region = 0; region < num; region++) {
1955 if (hw->cap.per_pf_mbox_regs) {
1956 bar4 = rvu_read64(rvu, BLKADDR_RVUM,
1957 RVU_AF_PFX_BAR4_ADDR(0)) +
1958 MBOX_SIZE;
1959 bar4 += region * MBOX_SIZE;
1960 } else {
1961 bar4 = rvupf_read64(rvu, RVU_PF_VF_BAR4_ADDR);
1962 bar4 += region * MBOX_SIZE;
1963 }
> 1964 mbox_addr[region] = (void *)ioremap_wc(bar4, MBOX_SIZE);
1965 if (!mbox_addr[region])
1966 goto error;
1967 }
1968 return 0;
1969 }
1970
1971 /* For cn10k platform AF <-> PF mailbox region of a PF is read from per
1972 * PF registers. Whereas for Octeontx2 it is read from
1973 * RVU_AF_PF_BAR4_ADDR register.
1974 */
1975 for (region = 0; region < num; region++) {
1976 if (hw->cap.per_pf_mbox_regs) {
1977 bar4 = rvu_read64(rvu, BLKADDR_RVUM,
1978 RVU_AF_PFX_BAR4_ADDR(region));
1979 } else {
1980 bar4 = rvu_read64(rvu, BLKADDR_RVUM,
1981 RVU_AF_PF_BAR4_ADDR);
1982 bar4 += region * MBOX_SIZE;
1983 }
1984 mbox_addr[region] = (void *)ioremap_wc(bar4, MBOX_SIZE);
1985 if (!mbox_addr[region])
1986 goto error;
1987 }
1988 return 0;
1989
1990 error:
1991 while (region--)
1992 iounmap((void __iomem *)mbox_addr[region]);
1993 return -ENOMEM;
1994 }
1995
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (154695 bytes)
Powered by blists - more mailing lists