public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Chin-Ting Kuo" <chin-ting_kuo@aspeedtech.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Mark Brown <broonie@kernel.org>
Subject: drivers/spi/spi-aspeed-smc.c:909:35: sparse: sparse: incorrect type in argument 2 (different address spaces)
Date: Mon, 02 Mar 2026 16:51:23 +0800	[thread overview]
Message-ID: <202603021656.vpe2bWbn-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   11439c4635edd669ae435eec308f4ab8a0804808
commit: 04f7516ab70f7b82aae1d2830af2ee6f17f3fe98 spi: aspeed: Add support for non-spi-mem devices
date:   5 weeks ago
config: openrisc-randconfig-r111-20260302 (https://download.01.org/0day-ci/archive/20260302/202603021656.vpe2bWbn-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260302/202603021656.vpe2bWbn-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/202603021656.vpe2bWbn-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-aspeed-smc.c:909:35: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *dst @@
   drivers/spi/spi-aspeed-smc.c:909:35: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/spi/spi-aspeed-smc.c:909:35: sparse:     got void *dst
>> drivers/spi/spi-aspeed-smc.c:939:46: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/spi/spi-aspeed-smc.c:1469:61: sparse: sparse: undefined identifier 'cols'
   drivers/spi/spi-aspeed-smc.c:1469:61: sparse: sparse: bad constant expression type
   drivers/spi/spi-aspeed-smc.c:1469:55: sparse: sparse: undefined identifier 'rows'
   drivers/spi/spi-aspeed-smc.c:1469:55: sparse: sparse: bad constant expression type

vim +909 drivers/spi/spi-aspeed-smc.c

   890	
   891	static void aspeed_spi_user_transfer_tx(struct aspeed_spi *aspi,
   892						struct spi_device *spi,
   893						const u8 *tx_buf, u8 *rx_buf,
   894						void *dst, u32 len)
   895	{
   896		const struct aspeed_spi_data *data = aspi->data;
   897		bool full_duplex_transfer = data->full_duplex && tx_buf == rx_buf;
   898		u32 i;
   899	
   900		if (full_duplex_transfer &&
   901		    !!(spi->mode & (SPI_TX_DUAL | SPI_TX_QUAD |
   902				    SPI_RX_DUAL | SPI_RX_QUAD))) {
   903			dev_err(aspi->dev,
   904				"full duplex is only supported for single IO mode\n");
   905			return;
   906		}
   907	
   908		for (i = 0; i < len; i++) {
 > 909			writeb(tx_buf[i], dst);
   910			if (full_duplex_transfer)
   911				rx_buf[i] = readb(aspi->regs + FULL_DUPLEX_RX_DATA);
   912		}
   913	}
   914	
   915	static int aspeed_spi_user_transfer(struct spi_controller *ctlr,
   916					    struct spi_device *spi,
   917					    struct spi_transfer *xfer)
   918	{
   919		struct aspeed_spi *aspi =
   920			(struct aspeed_spi *)spi_controller_get_devdata(ctlr);
   921		u32 cs = spi_get_chipselect(spi, 0);
   922		struct aspeed_spi_chip *chip = &aspi->chips[cs];
   923		void __iomem *ahb_base = aspi->chips[cs].ahb_base;
   924		const u8 *tx_buf = xfer->tx_buf;
   925		u8 *rx_buf = xfer->rx_buf;
   926	
   927		dev_dbg(aspi->dev,
   928			"[cs%d] xfer: width %d, len %u, tx %p, rx %p\n",
   929			cs, xfer->bits_per_word, xfer->len,
   930			tx_buf, rx_buf);
   931	
   932		if (tx_buf) {
   933			if (spi->mode & SPI_TX_DUAL)
   934				aspeed_spi_set_io_mode(chip, CTRL_IO_DUAL_DATA);
   935			else if (spi->mode & SPI_TX_QUAD)
   936				aspeed_spi_set_io_mode(chip, CTRL_IO_QUAD_DATA);
   937	
   938			aspeed_spi_user_transfer_tx(aspi, spi, tx_buf, rx_buf,
 > 939						    (void *)ahb_base, xfer->len);
   940		}
   941	
   942		if (rx_buf && rx_buf != tx_buf) {
   943			if (spi->mode & SPI_RX_DUAL)
   944				aspeed_spi_set_io_mode(chip, CTRL_IO_DUAL_DATA);
   945			else if (spi->mode & SPI_RX_QUAD)
   946				aspeed_spi_set_io_mode(chip, CTRL_IO_QUAD_DATA);
   947	
   948			ioread8_rep(ahb_base, rx_buf, xfer->len);
   949		}
   950	
   951		xfer->error = 0;
   952		aspi->cs_change = xfer->cs_change;
   953	
   954		return 0;
   955	}
   956	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-03-02  8:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202603021656.vpe2bWbn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=chin-ting_kuo@aspeedtech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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