[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf6d217f-1f1f-41f9-9ed7-9454aad080df@cjdns.fr>
Date: Fri, 31 Oct 2025 09:22:18 +0100
From: Caleb James DeLisle <cjd@...ns.fr>
To: kernel test robot <lkp@...el.com>, nbd@....name, lorenzo@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, ryder.lee@...iatek.com,
shayne.chen@...iatek.com, sean.wang@...iatek.com, matthias.bgg@...il.com,
angelogioacchino.delregno@...labora.com, linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] wifi: mt76: mmio_(read|write)_copy byte swap when on Big
Endian
On 31/10/2025 02:18, kernel test robot wrote:
> Hi Caleb,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on wireless-next/main]
> [also build test WARNING on wireless/main linus/master v6.18-rc3 next-20251030]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Caleb-James-DeLisle/wifi-mt76-mmio_-read-write-_copy-byte-swap-when-on-Big-Endian/20251028-012349
> base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
> patch link: https://lore.kernel.org/r/20251027171759.1484844-1-cjd%40cjdns.fr
> patch subject: [PATCH] wifi: mt76: mmio_(read|write)_copy byte swap when on Big Endian
> config: i386-randconfig-061-20251031 (https://download.01.org/0day-ci/archive/20251031/202510310816.kyDHJNiS-lkp@intel.com/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251031/202510310816.kyDHJNiS-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202510310816.kyDHJNiS-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>>> drivers/net/wireless/mediatek/mt76/mmio.c:41:24: sparse: sparse: cast from restricted __le32
>>> drivers/net/wireless/mediatek/mt76/mmio.c:41:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le32 [usertype] @@
This should not be an issue in PATCH v2 because it no longer uses a
temporary variable.
Thanks,
Caleb
> drivers/net/wireless/mediatek/mt76/mmio.c:41:24: sparse: expected unsigned int val
> drivers/net/wireless/mediatek/mt76/mmio.c:41:24: sparse: got restricted __le32 [usertype]
>>> drivers/net/wireless/mediatek/mt76/mmio.c:63:23: sparse: sparse: cast to restricted __le32
> vim +41 drivers/net/wireless/mediatek/mt76/mmio.c
>
> 32
> 33 static void mt76_mmio_write_copy_portable(void __iomem *dst,
> 34 const u8 *src, int len)
> 35 {
> 36 __le32 val;
> 37 int i = 0;
> 38
> 39 for (i = 0; i < ALIGN(len, 4); i += 4) {
> 40 memcpy(&val, src + i, sizeof(val));
> > 41 writel(cpu_to_le32(val), dst + i);
> 42 }
> 43 }
> 44
> 45 static void mt76_mmio_write_copy(struct mt76_dev *dev, u32 offset,
> 46 const void *data, int len)
> 47 {
> 48 if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) {
> 49 mt76_mmio_write_copy_portable(dev->mmio.regs + offset, data,
> 50 len);
> 51 return;
> 52 }
> 53 __iowrite32_copy(dev->mmio.regs + offset, data, DIV_ROUND_UP(len, 4));
> 54 }
> 55
> 56 static void mt76_mmio_read_copy_portable(u8 *dst,
> 57 const void __iomem *src, int len)
> 58 {
> 59 u32 val;
> 60 int i;
> 61
> 62 for (i = 0; i < ALIGN(len, 4); i += 4) {
> > 63 val = le32_to_cpu(readl(src + i));
> 64 memcpy(dst + i, &val, sizeof(val));
> 65 }
> 66 }
> 67
>
Powered by blists - more mailing lists