public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Bean Huo <beanhuo@iokpp.de>,
	 "Zailiang Zhang (zaizhang)" <zaizhang@cisco.com>,
	 "pratyush@kernel.org" <pratyush@kernel.org>,
	"mwalle@kernel.org" <mwalle@kernel.org>,
	 "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 Bean Huo <beanhuo@micron.com>
Subject: Re: [PATCH] mtd: spi-nor: micron-st: fix FSR read fallback for controllers returning -ENOTSUPP
Date: Thu, 19 Mar 2026 11:19:58 +0000	[thread overview]
Message-ID: <2vxz7br8cbhd.fsf@kernel.org> (raw)
In-Reply-To: <36e65648-707c-4b45-a429-1ea7f9f65f07@linaro.org> (Tudor Ambarus's message of "Thu, 19 Mar 2026 11:10:56 +0200")

On Thu, Mar 19 2026, Tudor Ambarus wrote:

> On 3/18/26 7:17 PM, Bean Huo wrote:
>> On Wed, 2026-03-18 at 17:04 +0000, Zailiang Zhang (zaizhang) wrote:
>>> Hi,
>>>
>>> Our platform is using Intel Raptorlake CPU, so it’s not our own spi master
>>> driver.
>>> The kernel version we are using is 6.6.21.
>>> I think when micron read fsr function calls spi_mem_exec_op(), it has
>>> following return:
>>>> if (!spi_mem_internal_supports_op(mem, op))
>>>>     return -ENOTSUPP;
>>> Please correct me if I am wrong here. Also the latest upstream kernel may not
>>> use the same handling code.
>> 
>> 
>> Hi Zailiang,                                                                   
>>                                                                                                                       
>> You are correct. the commit cff49d58f57e ("spi: Unify error codes by replacing -
>> ENOTSUPP with -EOPNOTSUPP"), merged upstream on November 29, 2023, which changed
>> spi_mem_exec_op() to return -EOPNOTSUPP instead of -ENOTSUPP when an operation
>> is not supported. Kernel 6.6.21 predates this fix, which is why you see -NOTSUPP
>> on your platform with Intel Raptor Lake.                                       
>>                                                                   
>> This changes the picture. The -ENOTSUPP Zailiang observed is coming directly
>> from spi_mem_exec_op() in kernel 6.6.21, before commit cff49d58f57e was in
>> place. That commit fixed the SPI mem framework itself, but it may not have been
>> backported to all stable trees.                                                
>>                   
>> I would therefore argue that our micron-st.c fix is still worth keeping for the
>> the reason that it provides a safety net for stable kernels that did not receive
>> cff49d58f57e as a backport.                     
>> 
>
> I advise against this, otherwise we'll carry dead weight on our shoulders.

+1

There is little sense in carrying a fix for a bug we don't have.

>
>> That said, I am happy to follow your guidance on how to proceed. 
>
> I would backport the patch to the stable kernel if that fixes things for you.
> Then I would follow up with a patch and replace -ENOTSUPP/-EOPNOTSUPP in
> spi-mem and spi.

+1 here too.

You would need to backport a patch to your kernel anyway. Better to
backport one that is already upstream and is a more general fix.

-- 
Regards,
Pratyush Yadav

      reply	other threads:[~2026-03-19 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 13:18 [PATCH] mtd: spi-nor: micron-st: fix FSR read fallback for controllers returning -ENOTSUPP Bean Huo
2026-03-18 13:26 ` Tudor Ambarus
2026-03-18 13:44   ` Bean Huo
     [not found]     ` <DS0PR11MB8668FC8E62236D0893A8CEFFC84EA@DS0PR11MB8668.namprd11.prod.outlook.com>
2026-03-18 17:17       ` Bean Huo
2026-03-19  9:10         ` Tudor Ambarus
2026-03-19 11:19           ` Pratyush Yadav [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=2vxz7br8cbhd.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --cc=beanhuo@iokpp.de \
    --cc=beanhuo@micron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mwalle@kernel.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=zaizhang@cisco.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