From: kernel test robot <lkp@intel.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [linux-next:master 1849/2075] drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Tue, 28 May 2024 20:22:39 +0800 [thread overview]
Message-ID: <202405282036.maEDO54Q-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6dc544b66971c7f9909ff038b62149105272d26a
commit: 2ba9d29c44cc046b46c275d654fa946a0781a540 [1849/2075] mtd: nand: mxc_nand: support software ECC
config: nios2-randconfig-r133-20240528 (https://download.01.org/0day-ci/archive/20240528/202405282036.maEDO54Q-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240528/202405282036.maEDO54Q-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/202405282036.maEDO54Q-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned short [noderef] [usertype] __iomem *t @@ got void *buf @@
drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: expected unsigned short [noderef] [usertype] __iomem *t
drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: got void *buf
>> drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *buf @@ got void [noderef] __iomem * @@
drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse: expected void *buf
drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse: got void [noderef] __iomem *
drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *buf @@ got void [noderef] __iomem * @@
drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse: expected void *buf
drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse: got void [noderef] __iomem *
vim +1479 drivers/mtd/nand/raw/mxc_nand.c
1476
1477 static void memff16_toio(void *buf, int n)
1478 {
> 1479 __iomem u16 *t = buf;
1480 int i;
1481
1482 for (i = 0; i < (n >> 1); i++)
1483 __raw_writew(0xffff, t++);
1484 }
1485
1486 static void copy_page_to_sram(struct mtd_info *mtd, const void *buf, int buf_len)
1487 {
1488 struct nand_chip *this = mtd_to_nand(mtd);
1489 struct mxc_nand_host *host = nand_get_controller_data(this);
1490 unsigned int no_subpages = mtd->writesize / 512;
1491 int oob_per_subpage, i;
1492
1493 oob_per_subpage = (mtd->oobsize / no_subpages) & ~1;
1494
1495 /*
1496 * During a page write the i.MX NAND controller will read 512b from
1497 * main_area0 SRAM, then oob_per_subpage bytes from spare0 SRAM, then
1498 * 512b from main_area1 SRAM and so on until the full page is written.
1499 * For software ECC we want to have a 1:1 mapping between the raw page
1500 * data on the NAND chip and the view of the NAND core. This is
1501 * necessary to make the NAND_CMD_RNDOUT read the data it expects.
1502 * To accomplish this we have to write the data in the order the controller
1503 * reads it. This is reversed in copy_page_from_sram() below.
1504 *
1505 * buf_len can either be the full page including the OOB or user data only.
1506 * When it's user data only make sure that we fill up the rest of the
1507 * SRAM with 0xff.
1508 */
1509 for (i = 0; i < no_subpages; i++) {
1510 int now = min(buf_len, 512);
1511
1512 if (now)
1513 memcpy16_toio(host->main_area0 + i * 512, buf, now);
1514
1515 if (now < 512)
> 1516 memff16_toio(host->main_area0 + i * 512 + now, 512 - now);
1517
1518 buf += 512;
1519 buf_len -= now;
1520
1521 now = min(buf_len, oob_per_subpage);
1522 if (now)
1523 memcpy16_toio(host->spare0 + i * host->devtype_data->spare_len,
1524 buf, now);
1525
1526 if (now < oob_per_subpage)
1527 memff16_toio(host->spare0 + i * host->devtype_data->spare_len + now,
1528 oob_per_subpage - now);
1529
1530 buf += oob_per_subpage;
1531 buf_len -= now;
1532 }
1533 }
1534
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-05-28 12:22 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=202405282036.maEDO54Q-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-mm@kvack.org \
--cc=miquel.raynal@bootlin.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=s.hauer@pengutronix.de \
/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