[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c7369d8f-5397-41fc-92de-afdcb47020d5@altera.com>
Date: Sat, 25 Oct 2025 10:20:21 +0800
From: Niravkumar L Rabara <niravkumarlaxmidas.rabara@...era.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: richard@....at, vigneshr@...com, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mtd: rawnand: cadence: Add support for NV-DDR
interface mode
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
Powered by blists - more mailing lists