public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-mtd@lists.infradead.org,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Marek Vasut <marek.vasut@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Anthony Wong <anthony.wong@canonical.com>,
	Bin Meng <bmeng.cn@gmail.com>
Subject: Re: [PATCH 1/3] spi-nor: intel-spi: Prefer WREN over other write enables
Date: Tue, 30 Jan 2018 11:59:14 +0100	[thread overview]
Message-ID: <20180130115914.6d75009a@bbrezillon> (raw)
In-Reply-To: <20180130105013.GH27654@lahna.fi.intel.com>

On Tue, 30 Jan 2018 12:50:13 +0200
Mika Westerberg <mika.westerberg@linux.intel.com> wrote:

> On Thu, Jan 04, 2018 at 12:07:42PM +0300, Mika Westerberg wrote:
> > On many older systems using SW sequencer the PREOP_OPTYPE register
> > contains two preopcodes as following:
> > 
> >   PREOP_OPTYPE=0xf2785006
> > 
> > The last two bytes are the opcodes decoded to:
> > 
> >   0x50 - Write enable for volatile status register
> >   0x06 - Write enable
> > 
> > The former is used to modify volatile bits in the status register. For
> > non-volatile bits the latter is needed. Preopcodes are used in SW
> > sequencer to send one command "atomically" without anything else
> > interfering the transfer. The sequence that gets executed is:
> > 
> >   - Send preopcode (write enable) from PREOP_OPTYPE register
> >   - Send the actual SPI command
> >   - Poll busy bit in the status register (0x05, RDSR)
> > 
> > Commit 8c473dd61bb5 ("spi-nor: intel-spi: Don't assume OPMENU0/1 to be
> > programmed by BIOS") enabled atomic sequence handling but because both
> > preopcodes are programmed, the following happens:
> > 
> >   if (preop >> 8)
> >   	val |= SSFSTS_CTL_SPOP;
> > 
> > Since on these systems preop >> 8 == 0x50 we end up picking volatile
> > write enable instead. Because of this the actual write command is pretty
> > much NOP unless there is a WREN latched in the chip already.
> > 
> > Fix this by preferring WREN over other write enable preopcodes.
> > 
> > Fixes: 8c473dd61bb5 ("spi-nor: intel-spi: Don't assume OPMENU0/1 to be programmed by BIOS")
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > Cc: stable@vger.kernel.org  
> 
> Hi,
> 
> Any change getting these merged for v4.16?

It's a fix, so yes, I can queue it for -rc2. I just need Cyrille's ack.

  reply	other threads:[~2018-01-30 10:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  9:07 [PATCH 1/3] spi-nor: intel-spi: Prefer WREN over other write enables Mika Westerberg
2018-01-04  9:07 ` [PATCH 2/3] spi-nor: intel-spi: Explicitly mark the driver as dangerous in Kconfig Mika Westerberg
2018-01-07 20:32   ` Cyrille Pitchen
2018-01-07 21:06     ` Boris Brezillon
2018-01-08  4:02       ` Mika Westerberg
2018-01-08  4:00     ` Mika Westerberg
2018-01-04  9:07 ` [PATCH 3/3] spi-nor: intel-spi: Remove unused preopcodes field Mika Westerberg
2018-01-07 20:24   ` Cyrille Pitchen
2018-01-07 23:29 ` [PATCH 1/3] spi-nor: intel-spi: Prefer WREN over other write enables Cyrille Pitchen
2018-01-08  4:28   ` Mika Westerberg
2018-01-30 10:50 ` Mika Westerberg
2018-01-30 10:59   ` Boris Brezillon [this message]
2018-02-01 11:36 ` Cyrille Pitchen
2018-02-02  9:26   ` Mika Westerberg

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=20180130115914.6d75009a@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=anthony.wong@canonical.com \
    --cc=bmeng.cn@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mika.westerberg@linux.intel.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