[xilinx-xlnx:xlnx_rebase_v5.15_LTS 50/1226] drivers/net/ethernet/cadence/macb_main.c:4925:58: sparse: sparse: incorrect type in argument 1 (different base types)
kernel test robot
lkp at intel.com
Wed Jul 13 06:49:20 PDT 2022
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS
head: 782529d063390382abaacec5d4a7f8c138b93715
commit: e4a3b891d0e4c1360f71c99b4f47754a727dce8c [50/1226] net: macb: Use WOL via ARP
config: h8300-randconfig-s031-20220712 (https://download.01.org/0day-ci/archive/20220713/202207132117.Vvxn4Wjd-lkp@intel.com/config)
compiler: h8300-linux-gcc (GCC) 11.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.4-39-gce1a6720-dirty
# https://github.com/Xilinx/linux-xlnx/commit/e4a3b891d0e4c1360f71c99b4f47754a727dce8c
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS
git checkout e4a3b891d0e4c1360f71c99b4f47754a727dce8c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=h8300 SHELL=/bin/bash drivers/net/ethernet/cadence/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp at intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/cadence/macb_main.c:284:16: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] bottom @@ got restricted __le32 [usertype] @@
drivers/net/ethernet/cadence/macb_main.c:284:16: sparse: expected unsigned int [usertype] bottom
drivers/net/ethernet/cadence/macb_main.c:284:16: sparse: got restricted __le32 [usertype]
drivers/net/ethernet/cadence/macb_main.c:286:13: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] top @@ got restricted __le16 [usertype] @@
drivers/net/ethernet/cadence/macb_main.c:286:13: sparse: expected unsigned short [usertype] top
drivers/net/ethernet/cadence/macb_main.c:286:13: sparse: got restricted __le16 [usertype]
drivers/net/ethernet/cadence/macb_main.c:3250:39: sparse: sparse: restricted __be32 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3255:39: sparse: sparse: restricted __be32 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3260:40: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3260:69: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3285:20: sparse: sparse: restricted __be32 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3289:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [assigned] [usertype] w0 @@ got restricted __be32 [usertype] ip4src @@
drivers/net/ethernet/cadence/macb_main.c:3289:20: sparse: expected unsigned int [assigned] [usertype] w0
drivers/net/ethernet/cadence/macb_main.c:3289:20: sparse: got restricted __be32 [usertype] ip4src
drivers/net/ethernet/cadence/macb_main.c:3299:20: sparse: sparse: restricted __be32 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3303:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [assigned] [usertype] w0 @@ got restricted __be32 [usertype] ip4dst @@
drivers/net/ethernet/cadence/macb_main.c:3303:20: sparse: expected unsigned int [assigned] [usertype] w0
drivers/net/ethernet/cadence/macb_main.c:3303:20: sparse: got restricted __be32 [usertype] ip4dst
drivers/net/ethernet/cadence/macb_main.c:3313:21: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3313:50: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3319:30: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3320:30: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3327:36: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3328:38: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3331:38: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/cadence/macb_main.c:3367:9: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/cadence/macb_main.c:3367:9: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/cadence/macb_main.c:3367:9: sparse: sparse: cast from restricted __be16
drivers/net/ethernet/cadence/macb_main.c:3367:9: sparse: sparse: cast from restricted __be16
drivers/net/ethernet/cadence/macb_main.c:3420:25: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/cadence/macb_main.c:3420:25: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/cadence/macb_main.c:3420:25: sparse: sparse: cast from restricted __be16
drivers/net/ethernet/cadence/macb_main.c:3420:25: sparse: sparse: cast from restricted __be16
>> drivers/net/ethernet/cadence/macb_main.c:4925:58: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const [usertype] *p @@ got restricted __be32 [noderef] __rcu * @@
drivers/net/ethernet/cadence/macb_main.c:4925:58: sparse: expected unsigned int const [usertype] *p
drivers/net/ethernet/cadence/macb_main.c:4925:58: sparse: got restricted __be32 [noderef] __rcu *
drivers/net/ethernet/cadence/macb_main.c:4925:41: sparse: sparse: restricted __be32 degrades to integer
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/cadence/macb_main.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/net/ethernet/cadence/macb_main.c:4892:29: sparse: sparse: dereference of noderef expression
drivers/net/ethernet/cadence/macb_main.c:4925:50: sparse: sparse: dereference of noderef expression
drivers/net/ethernet/cadence/macb_main.c:4925:50: sparse: sparse: dereference of noderef expression
vim +4925 drivers/net/ethernet/cadence/macb_main.c
4878
4879 static int __maybe_unused macb_suspend(struct device *dev)
4880 {
4881 struct net_device *netdev = dev_get_drvdata(dev);
4882 struct macb *bp = netdev_priv(netdev);
4883 struct macb_queue *queue;
4884 unsigned long flags;
4885 unsigned int q;
4886 u32 ctrl, arpipmask;
4887
4888 if (!netif_running(netdev))
4889 return 0;
4890
4891 if (device_may_wakeup(&bp->dev->dev)) {
> 4892 if (!bp->dev->ip_ptr->ifa_list) {
4893 netdev_err(netdev, "IP address not assigned\n");
4894 return -EOPNOTSUPP;
4895 }
4896 spin_lock_irqsave(&bp->lock, flags);
4897 ctrl = macb_readl(bp, NCR);
4898 ctrl &= ~(MACB_BIT(TE) | MACB_BIT(RE));
4899 macb_writel(bp, NCR, ctrl);
4900 /* Tie off RX queues */
4901 for (q = 0, queue = bp->queues; q < bp->num_queues;
4902 ++q, ++queue) {
4903 queue_writel(queue, RBQP,
4904 lower_32_bits(bp->rx_ring_tieoff_dma));
4905 }
4906 ctrl = macb_readl(bp, NCR);
4907 ctrl |= MACB_BIT(RE);
4908 macb_writel(bp, NCR, ctrl);
4909 gem_writel(bp, NCFGR, gem_readl(bp, NCFGR) & ~MACB_BIT(NBC));
4910 macb_writel(bp, TSR, -1);
4911 macb_writel(bp, RSR, -1);
4912 macb_readl(bp, ISR);
4913 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
4914 macb_writel(bp, ISR, -1);
4915
4916 /* Enable WOL (Q0 only) and disable all other interrupts */
4917 macb_writel(bp, IER, MACB_BIT(WOL));
4918 for (q = 1, queue = bp->queues; q < bp->num_queues;
4919 ++q, ++queue) {
4920 queue_writel(queue, IDR, bp->rx_intr_mask |
4921 MACB_TX_INT_FLAGS |
4922 MACB_BIT(HRESP));
4923 }
4924
> 4925 arpipmask = cpu_to_be32p(&bp->dev->ip_ptr->ifa_list->ifa_local)
4926 & 0xFFFF;
4927 gem_writel(bp, WOL, MACB_BIT(ARP) | arpipmask);
4928 spin_unlock_irqrestore(&bp->lock, flags);
4929 enable_irq_wake(bp->queues[0].irq);
4930 }
4931
4932 netif_device_detach(netdev);
4933 for (q = 0, queue = bp->queues; q < bp->num_queues;
4934 ++q, ++queue)
4935 napi_disable(&queue->napi);
4936
4937 if (!device_may_wakeup(&bp->dev->dev)) {
4938 rtnl_lock();
4939 phylink_stop(bp->phylink);
4940 rtnl_unlock();
4941 spin_lock_irqsave(&bp->lock, flags);
4942 macb_reset_hw(bp);
4943 spin_unlock_irqrestore(&bp->lock, flags);
4944 }
4945
4946 if (!(bp->caps & MACB_CAPS_USRIO_DISABLED))
4947 bp->pm_data.usrio = macb_or_gem_readl(bp, USRIO);
4948
4949 if (netdev->hw_features & NETIF_F_NTUPLE)
4950 bp->pm_data.scrt2 = gem_readl_n(bp, ETHT, SCRT2_ETHT);
4951
4952 if (bp->ptp_info)
4953 bp->ptp_info->ptp_remove(netdev);
4954 if (!device_may_wakeup(&bp->dev->dev))
4955 pm_runtime_force_suspend(dev);
4956
4957 return 0;
4958 }
4959
--
0-DAY CI Kernel Test Service
https://01.org/lkp
More information about the linux-arm-kernel
mailing list