Re: MTD: Lots of mtdblock warnings on bootup logs

From: Pintu Agarwal
Date: Wed Jul 12 2023 - 14:26:00 EST


Dear Bjorn and Miquel,

Thank you so much for your help!
Please see my reply inline.

On Wed, 12 Jul 2023 at 19:58, Bjørn Mork <bjorn@xxxxxxx> wrote:
>
> Pintu Agarwal <pintu.ping@xxxxxxxxx> writes:
>
> > Kernel: 5.15 ; arm64 ; NAND + ubi + squashfs
> > We have some RAW partitions and one UBI partition (with ubifs/squashfs volumes).
> >
> > We are seeing large numbers of these logs on the serial console that
> > impact the boot time.
> > [....]
> > [ 9.667240][ T9] Creating 58 MTD partitions on "1c98000.nand":
> > [....]
> > [ 39.975707][ T519] mtdblock: MTD device 'uefi_a' is NAND, please
> > consider using UBI block devices instead.
> > [ 39.975707][ T519] mtdblock: MTD device 'uefi_b' is NAND, please
> > consider using UBI block devices instead.
> > [....]
> >
> > This was added as part of this commit:
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/mtd/mtdblock.c?h=v5.15.120&id=f41c9418c5898c01634675150696da290fb86796
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/mtd/mtdblock.c?h=v5.15.120&id=e07403a8c6be01857ff75060b2df9a1aa8320fe5
>
> You have 5.15.what exactly? commit f41c9418c5898 was added in v5.15.46.
> Your log looks like it is missing.
>
My exact Kernel version is: 5.15.78
And I see that the below commit is also present:
commit f41c9418c5898c01634675150696da290fb86796
mtdblock: warn if opened on NAND

> FWIW, commit f41c9418c5898 was supposed to fix exactly that problem with
> commit e07403a8c6be01.
>
> But to catch actual mounts it will still warn if the mtdblock device is
> opened. This can obviously cause false positives if you e.g have some
> script reading from the mtdblock devices. If you are running v5.15.46 or
> later then there *is* something accessing those devices. You'll have to
> figure out what it is and stop it to avoid the warning.
>
You mean, if someone is using "mount .. /dev/mtdblock*" then only we
get these warnings ?
Or, if someone is trying to access the node using open("/dev/mtdblock*") .

But in this case, there should be only 1,2,3 entries but here I am
seeing for all the NAND partitions.
Or, is it possible that systemd-udevd is trying to access these nodes ?

Can we use ubiblock for mount ubifs (rw) volumes, or here we have to
use mtdblock ?
We have a mixture of squashfs (ro) and ubifs (rw) ubi volumes.
Currently, we are using the ubiblock way of mounting for squashfs but
mtdblock mounting for ubifs.

>> CONFIG_MTD_BLOCK=y
>> CONFIG_MTD_UBI_BLOCK=y
>>
> If you don't need both, then yes.

We actually need both of them because of several dependencies.

There are few applications that are trying to read content from /proc/mtd.
Is this also a problem if we disable MTD_BLOCK ?


Thanks,
Pintu