Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Boris Brezillon
	<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>,
	Haojian Zhuang
	<haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Robert Jarzmik <robert.jarzmik-GANU6spQydw@public.gmane.org>,
	Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Krzysztof Kozlowski
	<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	Josh Wu <josh.wu-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	Ezequiel Garcia
	<ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>,
	Kyungmin Park
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	punnaiah choudary kalluri
	<punnaia-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 00/23] mtd: rework ECC layout definition
Date: Tue, 26 Jan 2016 11:26:45 -0800	[thread overview]
Message-ID: <20160126192645.GA46523@google.com> (raw)
In-Reply-To: <1449527178-5930-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Hi Boris,

On Mon, Dec 07, 2015 at 11:25:55PM +0100, Boris Brezillon wrote:
> Hello,
> 
> This patchset aims at getting rid of the nand_ecclayout limitations.
> struct nand_ecclayout is defining fixed eccpos and oobfree arrays which
> can only be increased by modifying the MTD_MAX_ECCPOS_ENTRIES_LARGE and
> MTD_MAX_OOBFREE_ENTRIES_LARGE macros.
> This approach forces us to modify the macro values each time we add a
> new NAND chip with a bigger OOB area, and increasing these arrays also
> penalize all platforms, even those who only support small NAND devices
> (with small OOB area).
> 
> The idea to overcome this limitation, is to define the ECC/OOB layout
> by the mean of two functions: ->eccpos() and ->oobfree(), which will
> basically return the same information has those stored in the
> nand_ecclayout struct.
> 
> Another advantage of this solution is that ECC layouts are usually
> following a repetitive pattern (i.e. leave X bytes free and put Y bytes
> of ECC per ECC chunk), which allows one to implement the ->eccpos()
> and ->oobfree() functions with a simple logic that can be applied
> to any size of OOB.

Thanks for the work! This definitely needed done. I imagined that it
might be best if we just changed the data structure format and have
drivers allocate it dynamically during probe(), but actually, I kinda
like generating it on the fly. The only concern I'd have is if there is
significant penalty to doing this sort of computation on the fly during
(e.g.) AUTO-layout OOB reads/writes. But I guess if there is such a
penalty, nothing would stop us from caching the results in the MTD/NAND
core code.

> Patches 1 to 10 are just cleanups or trivial fixes that can be taken
> independently.

There were some comments for patch 1, and I want to look more closely at
patch 10. But patches 2 to 9 are pushed to l2-mtd.git. Thanks!

> Patch 19 is just an aggregate of several smaller commits (one per
> driver), and has been submitted this way to limit the size of the
> series. If everybody agrees on this approach, I'll resubmit the series
> will those changes separated in different commits (as done here [1]).
> 
> Also note that the last two commits are removing the nand_ecclayout
> definition, thus preventing any new driver to use this structure.
> Of course, this step can be delayed if some of the previous patches
> are not accepted.

I haven't looked in detail at the second half of the series, but I like
the concept. I'll look closer once you fix up things in v2.

Thanks,
Brian

> Best Regards,
> 
> Boris
> 
> [1]https://github.com/bbrezillon/linux-sunxi/commits/nand/ecclayout2

      parent reply	other threads:[~2016-01-26 19:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 22:25 [PATCH 00/23] mtd: rework ECC layout definition Boris Brezillon
2015-12-07 22:26 ` [PATCH 18/23] mtd: nand: bch: switch to nand_ecclayout_pos Boris Brezillon
2015-12-07 22:26 ` [PATCH 21/23] staging: mt29f_spinand: switch to mtd_ooblayout_ops Boris Brezillon
     [not found]   ` <1449527178-5930-22-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-12-07 23:59     ` Julian Calaby
2015-12-08  8:43       ` [linux-sunxi] " Boris Brezillon
     [not found] ` <1449527178-5930-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-12-07 22:25   ` [PATCH 01/23] mtd: kill the ecclayout->oobavail field Boris Brezillon
2015-12-08  6:43     ` [linux-sunxi] " Priit Laes
     [not found]       ` <1449556985.25438.8.camel-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2015-12-08  8:14         ` Boris Brezillon
2015-12-07 22:25   ` [PATCH 02/23] mtd: inftl: kill unused oobinfo field Boris Brezillon
2015-12-07 22:25   ` [PATCH 03/23] mtd: nftl: " Boris Brezillon
2015-12-07 22:25   ` [PATCH 04/23] mtd: nand: s3c2410: kill the ->ecc_layout field Boris Brezillon
     [not found]     ` <1449527178-5930-5-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-12-08  0:38       ` Krzysztof Kozlowski
2015-12-07 22:26   ` [PATCH 05/23] mtd: nand: jz4770: " Boris Brezillon
2015-12-08 10:30     ` Harvey Hunt
     [not found]       ` <5666B150.2030406-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-12-08 10:33         ` Boris Brezillon
2015-12-07 22:26   ` [PATCH 06/23] mtd: nand: kill unused ->ecclayout field in platform_nand_chip struct Boris Brezillon
2015-12-07 22:26   ` [PATCH 07/23] staging: mt29f_spinand: kill unused ecclayout field Boris Brezillon
2015-12-07 22:26   ` [PATCH 08/23] mtd: nand: lpc32xx_mlc: fix ecc.size Boris Brezillon
2015-12-07 22:26   ` [PATCH 09/23] mtd: nand: vf610: remove useless mtd->ecclayout assignment Boris Brezillon
2015-12-07 22:42     ` Stefan Agner
2015-12-07 22:26   ` [PATCH 10/23] mtd: nand: simplify nand_bch_init() usage Boris Brezillon
2015-12-07 22:26   ` [PATCH 11/23] mtd: add mtd_eccpos(), mtd_oobfree() and mtd_eccbytes() helper functions Boris Brezillon
2015-12-07 22:26   ` [PATCH 12/23] mtd: use mtd_eccpos() and mtd_oobfree() where appropriate Boris Brezillon
     [not found]     ` <1449527178-5930-13-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-12-07 22:48       ` kbuild test robot
2015-12-07 23:36       ` kbuild test robot
2015-12-07 22:26   ` [PATCH 13/23] mtd: add mtd_set_ecclayout() helper function Boris Brezillon
2015-12-07 22:26   ` [PATCH 14/23] mtd: use mtd_set_ecclayout() where appropriate Boris Brezillon
2015-12-07 22:26   ` [PATCH 15/23] mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition Boris Brezillon
2015-12-07 22:26   ` [PATCH 16/23] mtd: docg3: switch to mtd_ooblayout_ops Boris Brezillon
2015-12-07 22:26   ` [PATCH 17/23] mtd: nand: implement the default mtd_ooblayout_ops Boris Brezillon
2015-12-07 22:26   ` [PATCH 19/23] mtd: nand: switch all drivers to mtd_ooblayout_ops Boris Brezillon
2015-12-08 10:11     ` Ralf Baechle
2015-12-07 22:26   ` [PATCH 20/23] mtd: onenand: switch " Boris Brezillon
2015-12-07 22:26   ` [PATCH 22/23] mtd: nand: kill layout field Boris Brezillon
     [not found]     ` <1449527178-5930-23-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-12-07 23:00       ` kbuild test robot
2015-12-07 22:26   ` [PATCH 23/23] mtd: kill the nand_ecclayout struct Boris Brezillon
2016-01-26 19:26   ` Brian Norris [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=20160126192645.GA46523@google.com \
    --to=computersforpeace-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org \
    --cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=josh.wu-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    --cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=punnaia-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
    --cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=robert.jarzmik-GANU6spQydw@public.gmane.org \
    --cc=stefan-XLVq0VzYD2Y@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /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