public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Mario Kicherer <dev@kicherer.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: linux-mtd@lists.infradead.org, richard@nod.at, vigneshr@ti.com,
	Dhruva Gole <d-gole@ti.com>
Subject: Re: [PATCH v2] mtd: spinand: Add support for AllianceMemory AS5F34G04SND
Date: Wed, 25 Jan 2023 13:13:13 +0100	[thread overview]
Message-ID: <fae6950f62ebde63b3be0cde384fbde9@kicherer.org> (raw)
In-Reply-To: <20230123113337.78f5e3db@xps-13>

Hello Miquel,

On 2023-01-23 11:33, Miquel Raynal wrote:
>> +static int as5f34g04snd_ooblayout_ecc(struct mtd_info *mtd, int 
>> section,
>> +				      struct mtd_oob_region *region)
>> +{
>> +	if (section > 3)
>> +		return -ERANGE;
>> +
>> +	region->offset = 0x48;
>> +	region->length = 0x38;
> 
> Why would you have three sections if you have static offsets and
> length? That does not look correct.

Hm, I do not remember. I guess this is a leftover I forgot to remove.

>> +	/*
>> +	 * It is unclear how many bytes are used for the bad block marker. 
>> We
>> +	 * reserve one byte here.
> 
> So far we reserved two bytes in Linux to mimic the raw NAND BBM.

Ok, changed.

>> +static int am_ecc_get_status(struct spinand_device *spinand, u8 
>> status)
>> +{
>> +	switch (status & AM_STATUS_ECC_BITMASK) {
>> +	case AM_STATUS_ECC_NONE_DETECTED:
>> +		return 0;
>> +
>> +	case AM_STATUS_ECC_1_CORRECTED:
>> +		return 1;
>> +
>> +	case AM_STATUS_ECC_MAX_CORRECTED:
>> +		return 8;
>> +
>> +	case AM_STATUS_ECC_1_DETECTED:
> 
> What does this mean "1 detected"?

According to the manual, the chip can report that a bit error was 
detected
but could not be corrected.

>> +static const struct spinand_manufacturer_ops 
>> alliancememory_spinand_manuf_ops = {
>> +	.init = alliancememory_spinand_init,
> 
> I don't think .init is mandatory, so if you do nothing in it, you
> can just drop it.

Done.

Thanks for the review!
Mario

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

  reply	other threads:[~2023-01-25 12:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 16:54 [PATCH v2] mtd: spinand: Add support for AllianceMemory AS5F34G04SND Mario Kicherer
2023-01-23 10:33 ` Miquel Raynal
2023-01-25 12:13   ` Mario Kicherer [this message]
2023-01-25 14:27     ` Miquel Raynal
2023-01-25 15:03       ` Mario Kicherer
2023-01-26  8:51         ` Miquel Raynal
2023-01-26 14:34           ` Mario Kicherer
2023-01-26 14:50             ` Miquel Raynal

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=fae6950f62ebde63b3be0cde384fbde9@kicherer.org \
    --to=dev@kicherer.org \
    --cc=d-gole@ti.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --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