From: <Tudor.Ambarus@microchip.com>
To: <mika.westerberg@linux.intel.com>, <pratyush@kernel.org>,
<miquel.raynal@bootlin.com>, <richard@nod.at>
Cc: <michael@walle.cc>, <miquel.raynal@bootlin.com>, <richard@nod.at>,
<vigneshr@ti.com>, <Takahiro.Kuwano@infineon.com>,
<hongyu.ning@intel.com>, <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v2] mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init()
Date: Thu, 6 Oct 2022 04:56:34 +0000 [thread overview]
Message-ID: <85f9c462-c155-dc17-dc97-3254acfa55d2@microchip.com> (raw)
In-Reply-To: <01bb5297-1723-2292-1060-f3a003ddb129@microchip.com>
On 10/6/22 07:41, Tudor.Ambarus@microchip.com wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Hi, Miquel,
>
> It's too late for me to queue patches for next, but I'd like to have this patch
> integrated as it solves a regression. Would you queue it to mtd/next?
>
A bit of context. You'll see the following checkpatch warning:
WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
It comes from SPI. We should evaluate if we can s/ENOTSUPP/EOPNOTSUPP
in SPI, but we can do it later on. I prefer this patch instead of reverting
the offending commit, as it does not ignore other errors.
>
> On 9/23/22 12:34, Mika Westerberg wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> The Intel SPI-NOR controller does not support the 4-byte address opcode
>> so ->set_4byte_addr_mode() ends up returning -ENOTSUPP and the SPI flash
>> chip probe fail like this:
>>
>> [ 12.291082] spi-nor: probe of spi0.0 failed with error -524
>>
>> Whereas previously before commit 08412e72afba ("mtd: spi-nor: core:
>> Return error code from set_4byte_addr_mode()") it worked just fine.
>>
>> Fix this by ignoring -ENOTSUPP in spi_nor_init().
>>
>> Fixes: 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()")
>> Cc: stable@vger.kernel.org
>> Reported-by: Hongyu Ning <hongyu.ning@intel.com>
>> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> Acked-by: Tudor Ambarus <tudor.ambarus@microchip.com>
>
>> ---
>> The previous version of the patch (the revert) can be found here:
>>
>> https://lore.kernel.org/linux-mtd/20220922134824.46758-1-mika.westerberg@linux.intel.com/
>>
>> In this version we ignore -ENOTSUPP but the other error codes will be
>> passed to the caller.
>>
>> drivers/mtd/spi-nor/core.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>> index f2c64006f8d7..bee8fc4c9f07 100644
>> --- a/drivers/mtd/spi-nor/core.c
>> +++ b/drivers/mtd/spi-nor/core.c
>> @@ -2724,7 +2724,9 @@ static int spi_nor_init(struct spi_nor *nor)
>> */
>> WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
>> "enabling reset hack; may not recover from unexpected reboots\n");
>> - return nor->params->set_4byte_addr_mode(nor, true);
>> + err = nor->params->set_4byte_addr_mode(nor, true);
>> + if (err && err != -ENOTSUPP)
>> + return err;
>> }
>>
>> return 0;
>> --
>> 2.35.1
>>
>
> --
> Cheers,
> ta
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2022-10-06 4:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 9:34 [PATCH v2] mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init() Mika Westerberg
2022-09-23 9:37 ` Michael Walle
2022-10-03 5:04 ` Tudor.Ambarus
2022-10-03 5:21 ` Mika Westerberg
2022-10-03 5:52 ` Tudor.Ambarus
2022-10-03 6:11 ` Mika Westerberg
2022-10-06 4:41 ` Tudor.Ambarus
2022-10-06 4:56 ` Tudor.Ambarus [this message]
2022-10-18 8:17 ` 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=85f9c462-c155-dc17-dc97-3254acfa55d2@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=hongyu.ning@intel.com \
--cc=linux-mtd@lists.infradead.org \
--cc=michael@walle.cc \
--cc=mika.westerberg@linux.intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=pratyush@kernel.org \
--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 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.