All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	Thirumalesha N <nthirumalesha7@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>,
	Chuanhong Guo <gch981213@gmail.com>,
	Shivamurthy Shastri <sshivamurthy@micron.com>
Subject: Re: [PATCH v4 1/2] mtd: spinand: micron: Generalize the function and structure names
Date: Mon, 28 Sep 2020 18:21:59 +0200	[thread overview]
Message-ID: <20200928182159.5a6cf46a@xps13> (raw)
In-Reply-To: <20200928180343.4c5302a5@collabora.com>

Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Mon, 28 Sep
2020 18:03:43 +0200:

> On Mon, 28 Sep 2020 17:50:05 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
> > > > The way OOB
> > > > bytes are organized do not seem relevant to me, I think i prefer the
> > > > "_4_/_8_" naming,even if it's not very explicit.      
> > > 
> > > The ECC strength doesn't say anything about the scheme used for ECC
> > > bytes placement, and you might end up with 2 different schemes
> > > providing the same strength, or the same scheme used for 2 different
> > > strengths.    
> > 
> > So perhaps both should be present in the name?  
> 
> No, the point was to re-use the same functions for various strengths if
> they use the same ECC placement scheme.

I get the point, but is the current implementation generic enough? I
see hardcoded numbers, I have no idea if these numbers are common to
all strength given a specific layout, or if they only match for a given
strength?

+static int micron_4_ooblayout_ecc(struct mtd_info *mtd, int section,
+				  struct mtd_oob_region *region)
+{
+	struct spinand_device *spinand = mtd_to_spinand(mtd);
+
+	if (section >= spinand->base.memorg.pagesize /
+			mtd->ecc_step_size)
+		return -ERANGE;
+
+	region->offset = (section * 16) + 8;
+	region->length = 8;
+
+	return 0;
+}

If possible, I would like to avoid several successive renaming.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Thirumalesha N <nthirumalesha7@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Shivamurthy Shastri <sshivamurthy@micron.com>,
	Chuanhong Guo <gch981213@gmail.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] mtd: spinand: micron: Generalize the function and structure names
Date: Mon, 28 Sep 2020 18:21:59 +0200	[thread overview]
Message-ID: <20200928182159.5a6cf46a@xps13> (raw)
In-Reply-To: <20200928180343.4c5302a5@collabora.com>

Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Mon, 28 Sep
2020 18:03:43 +0200:

> On Mon, 28 Sep 2020 17:50:05 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
> > > > The way OOB
> > > > bytes are organized do not seem relevant to me, I think i prefer the
> > > > "_4_/_8_" naming,even if it's not very explicit.      
> > > 
> > > The ECC strength doesn't say anything about the scheme used for ECC
> > > bytes placement, and you might end up with 2 different schemes
> > > providing the same strength, or the same scheme used for 2 different
> > > strengths.    
> > 
> > So perhaps both should be present in the name?  
> 
> No, the point was to re-use the same functions for various strengths if
> they use the same ECC placement scheme.

I get the point, but is the current implementation generic enough? I
see hardcoded numbers, I have no idea if these numbers are common to
all strength given a specific layout, or if they only match for a given
strength?

+static int micron_4_ooblayout_ecc(struct mtd_info *mtd, int section,
+				  struct mtd_oob_region *region)
+{
+	struct spinand_device *spinand = mtd_to_spinand(mtd);
+
+	if (section >= spinand->base.memorg.pagesize /
+			mtd->ecc_step_size)
+		return -ERANGE;
+
+	region->offset = (section * 16) + 8;
+	region->length = 8;
+
+	return 0;
+}

If possible, I would like to avoid several successive renaming.

Thanks,
Miquèl

  reply	other threads:[~2020-09-28 16:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-13 16:15 [PATCH v4 0/2] Add support for micron SPI NAND MT29F2G01AAAED Thirumalesha Narasimhappa
2020-09-13 16:15 ` Thirumalesha Narasimhappa
2020-09-13 16:15 ` [PATCH v4 1/2] mtd: spinand: micron: Generalize the function and structure names Thirumalesha Narasimhappa
2020-09-13 16:15   ` Thirumalesha Narasimhappa
2020-09-15  8:13   ` Miquel Raynal
2020-09-15  8:13     ` Miquel Raynal
     [not found]     ` <CALKVOUomKLZ5GEHmXb+VfEq8UiNUpCN-Vqkx3N+yykEnCrHkDA@mail.gmail.com>
2020-09-28 14:55       ` Miquel Raynal
2020-09-28 14:55         ` Miquel Raynal
2020-09-28 15:45         ` Boris Brezillon
2020-09-28 15:45           ` Boris Brezillon
2020-09-28 15:50           ` Miquel Raynal
2020-09-28 15:50             ` Miquel Raynal
2020-09-28 16:03             ` Boris Brezillon
2020-09-28 16:03               ` Boris Brezillon
2020-09-28 16:21               ` Miquel Raynal [this message]
2020-09-28 16:21                 ` Miquel Raynal
2020-09-28 16:25                 ` Boris Brezillon
2020-09-28 16:25                   ` Boris Brezillon
2020-09-13 16:15 ` [PATCH v4 2/2] mtd: spinand: micron: add support for MT29F2G01AAAED Thirumalesha Narasimhappa
2020-09-13 16:15   ` Thirumalesha Narasimhappa

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=20200928182159.5a6cf46a@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=boris.brezillon@collabora.com \
    --cc=gch981213@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nthirumalesha7@gmail.com \
    --cc=richard@nod.at \
    --cc=sshivamurthy@micron.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.