Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Joern Engel <joern@lazybastard.org>,
	Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Wolfram Sang <wsa-dev@sang-engineering.com>,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-nvme@lists.infradead.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 4/6] block2mtd: attach device OF node to MTD device
Date: Sun, 4 Aug 2024 21:58:32 +0800	[thread overview]
Message-ID: <202408042135.nXaBv2UM-lkp@intel.com> (raw)
In-Reply-To: <20240804114108.1893-5-ansuelsmth@gmail.com>

Hi Christian,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.11-rc1 next-20240802]
[cannot apply to mtd/mtd/next mtd/mtd/fixes]
[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/Christian-Marangi/dt-bindings-nvme-Document-nvme-card-compatible/20240804-194357
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20240804114108.1893-5-ansuelsmth%40gmail.com
patch subject: [PATCH 4/6] block2mtd: attach device OF node to MTD device
config: i386-buildonly-randconfig-001-20240804 (https://download.01.org/0day-ci/archive/20240804/202408042135.nXaBv2UM-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240804/202408042135.nXaBv2UM-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/202408042135.nXaBv2UM-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/mtd/devices/block2mtd.c: In function 'add_device':
>> drivers/mtd/devices/block2mtd.c:332:9: error: 'ddev' undeclared (first use in this function); did you mean 'dev'?
     332 |         ddev = disk_to_dev(dev->blkdev->bd_disk);
         |         ^~~~
         |         dev
   drivers/mtd/devices/block2mtd.c:332:9: note: each undeclared identifier is reported only once for each function it appears in
   In file included from drivers/mtd/devices/block2mtd.c:22:
>> drivers/mtd/devices/block2mtd.c:332:31: error: 'struct block2mtd_dev' has no member named 'blkdev'
     332 |         ddev = disk_to_dev(dev->blkdev->bd_disk);
         |                               ^~
   include/linux/blkdev.h:258:13: note: in definition of macro 'disk_to_dev'
     258 |         (&((disk)->part0->bd_device))
         |             ^~~~
   drivers/mtd/devices/block2mtd.c:333:25: error: 'struct block2mtd_dev' has no member named 'blkdev'
     333 |         if (ddev == &dev->blkdev->bd_device)
         |                         ^~


vim +332 drivers/mtd/devices/block2mtd.c

   260	
   261	static struct block2mtd_dev *add_device(char *devname, int erase_size,
   262			char *label, int timeout)
   263	{
   264		const blk_mode_t mode = BLK_OPEN_READ | BLK_OPEN_WRITE;
   265		struct file *bdev_file;
   266		struct block_device *bdev;
   267		struct block2mtd_dev *dev;
   268		loff_t size;
   269		char *name;
   270	
   271		if (!devname)
   272			return NULL;
   273	
   274		dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
   275		if (!dev)
   276			return NULL;
   277	
   278		/* Get a handle on the device */
   279		bdev_file = bdev_file_open_by_path(devname, mode, dev, NULL);
   280		if (IS_ERR(bdev_file))
   281			bdev_file = mdtblock_early_get_bdev(devname, mode, timeout,
   282							      dev);
   283		if (IS_ERR(bdev_file)) {
   284			pr_err("error: cannot open device %s\n", devname);
   285			goto err_free_block2mtd;
   286		}
   287		dev->bdev_file = bdev_file;
   288		bdev = file_bdev(bdev_file);
   289	
   290		if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) {
   291			pr_err("attempting to use an MTD device as a block device\n");
   292			goto err_free_block2mtd;
   293		}
   294	
   295		size = bdev_nr_bytes(bdev);
   296		if ((long)size % erase_size) {
   297			pr_err("erasesize must be a divisor of device size\n");
   298			goto err_free_block2mtd;
   299		}
   300	
   301		mutex_init(&dev->write_mutex);
   302	
   303		/* Setup the MTD structure */
   304		/* make the name contain the block device in */
   305		if (!label)
   306			name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname);
   307		else
   308			name = kstrdup(label, GFP_KERNEL);
   309		if (!name)
   310			goto err_destroy_mutex;
   311	
   312		dev->mtd.name = name;
   313	
   314		dev->mtd.size = size & PAGE_MASK;
   315		dev->mtd.erasesize = erase_size;
   316		dev->mtd.writesize = 1;
   317		dev->mtd.writebufsize = PAGE_SIZE;
   318		dev->mtd.type = MTD_RAM;
   319		dev->mtd.flags = MTD_CAP_RAM;
   320		dev->mtd._erase = block2mtd_erase;
   321		dev->mtd._write = block2mtd_write;
   322		dev->mtd._sync = block2mtd_sync;
   323		dev->mtd._read = block2mtd_read;
   324		dev->mtd.priv = dev;
   325		dev->mtd.owner = THIS_MODULE;
   326	
   327		/*
   328		 * Check if we are using root blockdev.
   329		 * If it's the case, connect the MTD of_node to the ddev parent
   330		 * to support providing partition in DT node.
   331		 */
 > 332		ddev = disk_to_dev(dev->blkdev->bd_disk);
   333		if (ddev == &dev->blkdev->bd_device)
   334			dev->mtd.dev.of_node = of_node_get(ddev->parent->of_node);
   335	
   336		if (mtd_device_register(&dev->mtd, NULL, 0)) {
   337			/* Device didn't get added, so free the entry */
   338			goto err_destroy_mutex;
   339		}
   340	
   341		list_add(&dev->list, &blkmtd_device_list);
   342		pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n",
   343			dev->mtd.index,
   344			label ? label : dev->mtd.name + strlen("block2mtd: "),
   345			dev->mtd.erasesize >> 10, dev->mtd.erasesize);
   346		return dev;
   347	
   348	err_destroy_mutex:
   349		of_node_put(dev->mtd.dev.of_node);
   350		mutex_destroy(&dev->write_mutex);
   351	err_free_block2mtd:
   352		block2mtd_free_device(dev);
   353		return NULL;
   354	}
   355	

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


  reply	other threads:[~2024-08-04 13:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-04 11:41 [PATCH 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
2024-08-04 11:41 ` [PATCH 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
2024-08-04 11:41 ` [PATCH 2/6] nvme: assign of_node to nvme device Christian Marangi
2024-08-04 13:48   ` kernel test robot
2024-08-04 15:21   ` kernel test robot
2024-08-04 11:41 ` [PATCH 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node Christian Marangi
2024-08-04 11:41 ` [PATCH 4/6] block2mtd: attach device OF node to MTD device Christian Marangi
2024-08-04 13:58   ` kernel test robot [this message]
2024-08-04 11:41 ` [PATCH 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Christian Marangi
2024-08-04 12:24   ` Rob Herring (Arm)
2024-08-04 11:41 ` [PATCH 6/6] mtd: parser: add support for Airoha parser Christian Marangi

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=202408042135.nXaBv2UM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ansuelsmth@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hch@lst.de \
    --cc=joern@lazybastard.org \
    --cc=kbusch@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=richard@nod.at \
    --cc=robh@kernel.org \
    --cc=sagi@grimberg.me \
    --cc=tsbogend@alpha.franken.de \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=wsa-dev@sang-engineering.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