public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: liao jaime <jaimeliao.tw@gmail.com>
Cc: linux-mtd@lists.infradead.org, tudor.ambarus@linaro.org,
	pratyush@kernel.org, miquel.raynal@bootlin.com,
	leoyu@mxic.com.tw, jaimeliao@mxic.com.tw
Subject: Re: [PATCH] mtd: spi-nor: core: Introduce spi_nor_abort_octal_dtr()
Date: Wed, 13 Dec 2023 10:10:45 +0100	[thread overview]
Message-ID: <b3ce3771a751d85a76225d53cc565b70@walle.cc> (raw)
In-Reply-To: <CAAQoYRkR0Jgr96n0-h9_6HTjmSPBq-YKskFN5+e-m6HBSbCocQ@mail.gmail.com>

Hi,

>> >> To me it seems, that spi_nor_select_{read,pp,erase}() will select
>> >> the wrong commands/proto. So it should be fixed there. Probably
>> >> shared_mask is wrong.
>> > Features in shared_mask have include 2 parts as below.
>> > 1. Flash support the feature (by parse SFDP or ID table flags)
>> > 2. spi host controller support the feature (In
>> > spi_nor_spimem_adjust_hwcaps)
>> >
>> > But I think Octal DTR is a special case because, in addition to the 2
>> > points
>> > mentioned above, there are also other conditions that need to be met.
>> 
>> Correct. And btw we would have the same problem for quad_enable if we
>> wouldn't
>> have a default.
>> 
>> So in spi_nor_default_setup() I'd suggest to add something along
>> 
>> if (!nor->quad_enable)
>>    shared_mask &= ~SNOR_HWCAPS_4_4_4;
> I think this check is unnecessary for quad_enable.
> Because of "spi_nor_sr2_bit1_quad_enable" would be a default
> method for enabling quad mode in spi_nor_init_default_params().

Yes it is at the moment. But if a flash happen to have no
quad_enable we'll have a problem for whatever reason. so for the
sake of completeness we should mask that bit.

>> /* skip octal command mode if we don't have a .octal_enable callback 
>> */
>> if (!nor->octal_enable)
>>    shared_mask &= ~SNOR_HWCAPS_8_8_8;
> Sound great.
> 
> Could I follow the suggestion for preparing v2 patch?

sure.

> BTW, I think discard is better than abort.
> What do you think?

Where do you need that word? You shouln'd need any more
than the code above.

-michael

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

  reply	other threads:[~2023-12-13  9:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  7:51 [PATCH] mtd: spi-nor: core: Introduce spi_nor_abort_octal_dtr() Jaime Liao
2023-12-11 10:51 ` Michael Walle
2023-12-12  9:05   ` liao jaime
2023-12-12 13:37     ` Michael Walle
2023-12-13  2:37       ` liao jaime
2023-12-13  8:48         ` Michael Walle
2023-12-13  9:05           ` liao jaime
2023-12-13  9:10             ` Michael Walle [this message]
2023-12-13  9:16               ` liao jaime
2024-01-29 13:01         ` Pratyush Yadav

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=b3ce3771a751d85a76225d53cc565b70@walle.cc \
    --to=michael@walle.cc \
    --cc=jaimeliao.tw@gmail.com \
    --cc=jaimeliao@mxic.com.tw \
    --cc=leoyu@mxic.com.tw \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=tudor.ambarus@linaro.org \
    /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