From: "John Thomson" <git@johnthomson.fastmail.com.au>
To: "Pratyush Yadav" <p.yadav@ti.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Tudor Ambarus" <tudor.ambarus@microchip.com>,
"Michael Walle" <michael@walle.cc>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
"kernel test robot" <lkp@intel.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH] mtd: spi-nor: write support for minor aligned partitions
Date: Fri, 11 Jun 2021 01:15:24 +0000 [thread overview]
Message-ID: <55d28fea-c20e-4e60-8b5b-b5a03ccea0cf@www.fastmail.com> (raw)
In-Reply-To: <20210610100759.v57c5wa46ky33waj@ti.com>
On Thu, 10 Jun 2021, at 10:08, Pratyush Yadav wrote:
> On 08/06/21 02:07PM, John Thomson wrote:
> > Do not prevent writing to mtd partitions where a partition boundary sits
> > on a minor erasesize boundary.
> > This addresses a FIXME that has been present since the start of the
> > linux git history:
> > /* Doesn't start on a boundary of major erase size */
> > /* FIXME: Let it be writable if it is on a boundary of
> > * _minor_ erase size though */
> >
> > Allow a uniform erase region spi-nor device to be configured
> > to use the non-uniform erase regions code path for an erase with:
> > CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y
> >
> > On supporting hardware (SECT_4K: majority of current SPI-NOR device)
> > provide the facility for an erase to use the least number
> > of SPI-NOR operations, as well as access to 4K erase without
> > requiring CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
> >
> > Introduce erasesize_minor to the mtd struct,
> > the smallest erasesize supported by the device
>
> Instead of having just a major and minor erase size, wouldn't it make
> more sense to have a list of all supported erases on a sector? That is,
> instead of hard coding two erase size instead of one, how about
> generalizing the erase machinery to allow any number of erase sizes on a
> sector and then choosing the most efficient one on run time?
>
> For example, imagine a device can support 4K, 64K, and 256K erases on
> each sector. Then you should be able to use 2 x 4K erases if you want to
> erase 8K, 2 x 64K + 1 x 4K erases for 132K and so on.
Thank for you the feedback Pratyush,
Yes, this is what I am attempting to do.
mtdpart only sets if the partition can be writeable, it does not do the erasing.
Due to this, I thought that only the smallest erasesize should matter to mtdpart.
The erase is carried out by the mtd device, so for an SPI-NOR device,
spi_nor_erase_multi_sectors can be used to select and action the best combination of erases.
This is done by this patch when CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y
Cheers,
--
John Thomson
prev parent reply other threads:[~2021-06-11 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 4:07 John Thomson
2021-06-10 10:08 ` Pratyush Yadav
2021-06-11 1:15 ` John Thomson [this message]
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=55d28fea-c20e-4e60-8b5b-b5a03ccea0cf@www.fastmail.com \
--to=git@johnthomson.fastmail.com.au \
--cc=dan.carpenter@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=lkp@intel.com \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=p.yadav@ti.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®