All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Huang Shijie <shijie8@gmail.com>
Cc: Marek Vasut <marex@denx.de>, Huang Shijie <b32955@freescale.com>,
	zajec5@gmail.com, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 6/8] mtd: spi-nor: drop replaceable wait-till-ready function pointer
Date: Mon, 11 Aug 2014 11:43:11 -0700	[thread overview]
Message-ID: <20140811184311.GX3711@ld-irv-0074> (raw)
In-Reply-To: <20140809095301.GA1076@localhost.localdomain>

On Sat, Aug 09, 2014 at 05:53:03PM +0800, Huang Shijie wrote:
> On Wed, Aug 06, 2014 at 06:17:00PM -0700, Brian Norris wrote:
> > We don't need to expose a 'wait-till-ready' interface to drivers. Status
> > register polling should be handled by the core spi-nor.c library, and as
> > of now, I see no need to provide a special driver-specific hook for it.
> 
> Please do not drop this hook, please see why we add this hook:
> http://lists.infradead.org/pipermail/linux-mtd/2013-December/050561.html
> 
> "
> The default implementation would do just as you suggest, and I would
> expect most H/W drivers to use the default implementation.  However, some H/W
> Controllers can automate the polling of status registers, so having a hook allows
> the driver override the default behaviour.
> "
> 
> The spi-nor framework will used by more drivers besides the m25p80 and
> fsl-quadspi. Some NOR flash controller may be very strange.

OK, but the wait-till-ready hook should not look like the current one.
If it is used as an optimization of sorts, then we can provide it in
*addition* to the checks we do, but not *instead of*. I sincerely doubt
that any specialized SPI NOR controller will know how to check both SR
and FSR where appropriate, and it probably won't understand other
specialized sequences as they are developed / thrown on our lap by flash
vendors.

So, the spi-nor.c "wait until ready" might have a sequence like this:

1. (Optionally) use low-level driver's "wait" function; skip if not
   present

2. use the read register hooks to check SR/FSR to confirm completion

I do not want to toss #2 into the low-level driver, so if there is a
need for #1, it should be done in addition to our spi-nor.c code, not
instead. (To this end, I believe Marek also complained about this when
we were adding the FSR-checking code; we should not have drivers and
spi-nor.c fighting over callback functions.)

So I'm inclined to at most address #1 through an optional callback, and
possibly even to ignore that until we see an actual driver that needs
it.

Brian

  reply	other threads:[~2014-08-11 18:43 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07  1:16 [PATCH 0/8] mtd: spi-nor: refactor wait-till-ready Brian Norris
2014-08-07  1:16 ` [PATCH 1/8] mtd: spi-nor: eliminate duplicate spi_nor_wait_till_{, fsr}_ready() code Brian Norris
2014-08-07 14:23   ` Marek Vasut
2014-08-09  6:25   ` Huang Shijie
2014-08-11 17:59     ` Brian Norris
2014-09-10  7:26   ` [PATCH v2 1/10] " Brian Norris
2014-08-07  1:16 ` [PATCH 2/8] mtd: spi-nor: handle timeout errors in spi_nor_write() Brian Norris
2014-08-07 14:23   ` Marek Vasut
2014-08-09  7:37   ` Huang Shijie
2014-08-07  1:16 ` [PATCH 3/8] mtd: spi-nor: move "wait-till-ready" checks into erase/write functions Brian Norris
2014-08-07 14:24   ` Marek Vasut
2014-08-09  8:42   ` Huang Shijie
2014-08-11 18:23     ` Brian Norris
2014-08-12  1:37       ` Huang Shijie
2014-08-07  1:16 ` [PATCH 4/8] mtd: m25p80: drop wait-till-ready checks Brian Norris
2014-08-07 14:24   ` Marek Vasut
2014-08-07  1:16 ` [PATCH 5/8] mtd: fsl-quadspi: " Brian Norris
2014-08-07 14:24   ` Marek Vasut
2014-08-07  1:17 ` [PATCH 6/8] mtd: spi-nor: drop replaceable wait-till-ready function pointer Brian Norris
2014-08-07 14:25   ` Marek Vasut
2014-08-09  9:53   ` Huang Shijie
2014-08-11 18:43     ` Brian Norris [this message]
2014-08-12  1:16       ` Huang Shijie
2014-09-10  7:02         ` Brian Norris
2014-08-12  5:13   ` Rafał Miłecki
2014-08-12  5:14     ` Rafał Miłecki
2014-08-07  1:17 ` [PATCH 7/8] mtd: spi-nor: factor out write_enable() for erase commands Brian Norris
2014-08-07 14:25   ` Marek Vasut
2014-08-09 10:52   ` Huang Shijie
2014-08-11 18:48     ` Brian Norris
2014-08-12  0:59       ` Huang Shijie
2014-09-10  7:05         ` Brian Norris
2014-09-10 15:20           ` Huang Shijie
2014-09-10  7:47             ` Brian Norris
2014-09-10 16:12               ` Huang Shijie
2014-09-10 23:25                 ` Brian Norris
2014-11-05 10:29   ` [PATCH v2] " Brian Norris
2014-11-06  3:39     ` Huang Shijie
2014-12-01  8:19     ` Brian Norris
2014-08-07  1:17 ` [RFC 8/8] debug: mtd: spi-nor: add BUG_ON() prints to check for !ready Brian Norris
2014-08-07 14:26   ` Marek Vasut
2014-11-05 10:10 ` [PATCH 0/8] mtd: spi-nor: refactor wait-till-ready Brian Norris

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=20140811184311.GX3711@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=b32955@freescale.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=shijie8@gmail.com \
    --cc=zajec5@gmail.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.