mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtd: rawnand: cadence: Add support for NV-DDR interface mode
Date: Sat, 25 Oct 2025 10:20:21 +0800	[thread overview]
Message-ID: <c7369d8f-5397-41fc-92de-afdcb47020d5@altera.com> (raw)
In-Reply-To: <87zf9gpn1j.fsf@bootlin.com>



On 24/10/2025 7:16 pm, Miquel Raynal wrote:
> Hi,
> 
>> +	if (nand_interface_is_sdr(conf)) {
>> +		const struct nand_sdr_timings *sdr = nand_get_sdr_timings(conf);
>> +
>> +		if (IS_ERR(sdr))
>> +			return PTR_ERR(sdr);
>> +
>> +		ret = cadence_nand_setup_sdr_interface(chip, sdr);
>> +	} else {
>> +		if (chipnr < 0)
>> +			return ret;
> 
> I still think this is incorrect. The chipnr value shall not be treated
> differently from the SDR path.
> 
> Thanks,
> Miquèl

You are right — the chipnr check should be common, irrespective of SDR 
or NVDDR.

Just to share some background on why I initially added the check only 
for NVDDR:
While enabling NVDDR support, I noticed that the setup_interface() 
callback is invoked once with chipnr = 0 for SDR, but twice for NVDDR — 
first with chipnr = -1 (NAND_DATA_IFACE_CHECK_ONLY) and then with chipnr 
= 0.
Because of this difference, I added the check only for the NVDDR path.

After your comment, I rechecked the NAND framework and realized that the 
behavior I observed occurs because NAND flash on my board supports NVDDR 
and the framework first checks for NVDDR mode, followed by SDR.

If the flash supports only SDR, the setup_interface() callback would 
also be called with chipnr = NAND_DATA_IFACE_CHECK_ONLY for SDR.

I’ll move the chipnr check before the if() in the v3 patch.

Thanks,
Nirav


      reply	other threads:[~2025-10-25  2:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 10:26 niravkumarlaxmidas.rabara
2025-10-24 11:16 ` Miquel Raynal
2025-10-25  2:20   ` Niravkumar L Rabara [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=c7369d8f-5397-41fc-92de-afdcb47020d5@altera.com \
    --to=niravkumarlaxmidas.rabara@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®