mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: NeilBrown <neilb@suse.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	Zhiqiang Hou <Zhiqiang.Hou@nxp.com>,
	linux-mtd@lists.infradead.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Boris BREZILLON <boris.brezillon@free-electrons.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Subject: Re: [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting
Date: Tue, 24 Jul 2018 12:41:10 -0700	[thread overview]
Message-ID: <20180724194110.GA190016@ban.mtv.corp.google.com> (raw)
In-Reply-To: <87fu09pfii.fsf@notabene.neil.brown.name>

Hi,

On Tue, Jul 24, 2018 at 11:51:49AM +1000, NeilBrown wrote:
> On Tue, Jul 24 2018, Boris Brezillon wrote:
> > On Tue, 24 Jul 2018 08:46:33 +1000
> > NeilBrown <neilb@suse.com> wrote:
> >> One possibility that occurred to me when I was exploring this issue is
> >> to revert to 3-byte mode whenever 4-byte was not actively in use.
> >> So any access beyond 16Meg is:
> >>  switch-to-4-byte ; perform IO ; switch to 3-byte
> >> or similar.  On my hardware it would be more efficient to
> >> use the 4-byte opcode to perform the IO, then reset the cached
> >> 4th address byte that the NOR chip transparently remembered.

Do these chips cache the last 4th-byte used? I don't recall reading
that, but that would be interesting. It also sounds like that would make
things even more difficult to do robustly.

> >> This adds a little overhead, but should be fairly robust.
> >> It doesn't help if something goes terribly wrong while IO is happening,
> >> but I don't think any other software solution does either.
> >> 
> >> How would you see that approach?
> >
> > I think the problem stands: people that have proper HW mitigation for
> > this problem (NOR chip is reset when the Processor is reset) don't want
> > to pay the overhead. So, even if we go for this approach, we probably
> > want to only do that for broken HW.

If it actually saves bytes on the wire to stay in 3-byte mode more
often, then that could be helpful to all systems. But otherwise, yes, it
doesn't really belong on a properly-designed system.

> I agree that a "my-hardware-is-suboptimal" flag is appropriate.
> I was addressing the suggestion that the current approach doesn't handle
> all corner cases and was suggesting a different approach that might
> handle more corner-cases.  I should have been more explicit about that.

If you want to talk about optimizing the broken-hardware hack, then
fine. That's not my interest at all.

Brian

  reply	other threads:[~2018-07-24 19:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06  2:53 [PATCHv3 0/2] mtd: m25p80: restore the addressing mode " Zhiqiang Hou
2017-12-06  2:53 ` [PATCHv3 1/2] mtd: spi-nor: add an API to restore the status of SPI flash chip Zhiqiang Hou
2017-12-12 13:12   ` Cyrille Pitchen
2017-12-06  2:53 ` [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting Zhiqiang Hou
2017-12-12 13:19   ` Cyrille Pitchen
2018-07-23 18:13   ` Brian Norris
2018-07-23 20:10     ` Boris Brezillon
2018-07-23 22:06       ` Brian Norris
2018-07-23 22:46         ` NeilBrown
2018-07-23 23:22           ` Boris Brezillon
2018-07-24  1:51             ` NeilBrown
2018-07-24 19:41               ` Brian Norris [this message]
2018-07-24 21:48                 ` NeilBrown
2018-07-25 23:24                   ` Brian Norris
2018-07-23 23:18         ` Boris Brezillon
2018-07-24 19:52           ` Brian Norris
2018-07-24 19:59             ` Boris Brezillon

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=20180724194110.GA190016@ban.mtv.corp.google.com \
    --to=computersforpeace@gmail.com \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=neilb@suse.com \
    --cc=richard@nod.at \
    /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

Powered by JetHome