linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Marek Vasut <marek.vasut@gmail.com>,
	Brian Norris <computersforpeace@gmail.com>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH v2] mtd: spi-nor: Use DMA-safe buffer for JEDEC ID in spi_nor_read_id()
Date: Mon, 17 Sep 2018 10:28:21 +0200	[thread overview]
Message-ID: <20180917102821.16c69697@bbrezillon> (raw)
In-Reply-To: <20180917101851.3d359d18@bbrezillon>

On Mon, 17 Sep 2018 10:18:51 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> On Mon, 17 Sep 2018 11:10:18 +0300
> Jarkko Nikula <jarkko.nikula@linux.intel.com> wrote:
> 
> > After commit 4120f8d158ef ("mtd: spi-nor: Use the spi_mem_xx() API")
> > there is no allocation for DMA-safe buffer when transmitting data bytes
> > over SPI bus in m25p80 driver.
> > 
> > JEDEC ID reading in spi_nor_read_id() has the buffer in stack. This is
> > not safe with the m25p80 driver anymore after commit 4120f8d158ef if
> > underlying SPI controller is using DMA for transfers.
> > 
> > Therefore allocate a temporary DMA-safe buffer for JEDEC ID reading.
> > 
> > Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>  
> 
> Oh, I forgot to mention that you should have Cc and Fixes tag here, to
> make sure the patch gets backported to 4.18:
> 
> Fixes: 4120f8d158ef ("mtd: spi-nor: Use the spi_mem_xx() API")
> Cc: <stable@vger.kernel.org>
> 
> No need to send a new version, I can add them when applying.

Hm, I just had a look at all ->read/write_reg() call sites and it seems
we have the same problem in other places. Maybe it's just better to fix
the problem in m25p80 ->read/write_reg() implems for now and see how we
can fix that generically afterwards.

  reply	other threads:[~2018-09-17  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17  8:10 [PATCH v2] mtd: spi-nor: Use DMA-safe buffer for JEDEC ID in spi_nor_read_id() Jarkko Nikula
2018-09-17  8:18 ` Boris Brezillon
2018-09-17  8:28   ` Boris Brezillon [this message]
2018-09-17  8:41     ` Jarkko Nikula
2018-09-17  8:46       ` Boris Brezillon
2018-09-17  9:04         ` Jarkko Nikula
2018-09-17 12:28           ` Boris Brezillon
2018-09-17 12:51             ` Jarkko Nikula
2018-09-17 12:59               ` Boris Brezillon
2018-09-17 13:37               ` 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=20180917102821.16c69697@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.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;
as well as URLs for NNTP newsgroup(s).