Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Caleb James DeLisle <cjd@cjdns.fr>
To: kernel test robot <lkp@intel.com>, nbd@nbd.name, lorenzo@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, ryder.lee@mediatek.com,
	shayne.chen@mediatek.com, sean.wang@mediatek.com,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] wifi: mt76: mmio_(read|write)_copy byte swap when on Big Endian
Date: Fri, 31 Oct 2025 09:22:18 +0100	[thread overview]
Message-ID: <cf6d217f-1f1f-41f9-9ed7-9454aad080df@cjdns.fr> (raw)
In-Reply-To: <202510310816.kyDHJNiS-lkp@intel.com>


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@intel.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	
>


  reply	other threads:[~2025-10-31  8:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 17:17 [PATCH] wifi: mt76: mmio_(read|write)_copy byte swap when on Big Endian Caleb James DeLisle
2025-10-28 20:19 ` Jonas Gorski
2025-10-28 21:41   ` Caleb James DeLisle
2025-10-29  9:15     ` Jonas Gorski
2025-10-29 15:24       ` Caleb James DeLisle
2025-10-29 18:41         ` [PATCH v2] wifi: mt76: mmio_*_copy fix byte order and alignment Caleb James DeLisle
2025-10-29 20:12         ` [PATCH] wifi: mt76: mmio_(read|write)_copy byte swap when on Big Endian Jonas Gorski
2025-10-29 20:40           ` Caleb James DeLisle
2025-10-29 23:06             ` Caleb James DeLisle
2025-10-31  1:18 ` kernel test robot
2025-10-31  8:22   ` Caleb James DeLisle [this message]
2025-11-01 16:25 ` 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=cf6d217f-1f1f-41f9-9ed7-9454aad080df@cjdns.fr \
    --to=cjd@cjdns.fr \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox