All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Stefan Agner <stefan@agner.ch>
Cc: bbrezillon@kernel.org, richard@nod.at,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org, marek.vasut@gmail.com,
	Boris Brezillon <boris.brezillon@collabora.com>,
	linux-mtd@lists.infradead.org, computersforpeace@gmail.com,
	dwmw2@infradead.org
Subject: Re: [PATCH] mtd: rawnand: use longest matching pattern
Date: Mon, 20 May 2019 16:31:31 +0200	[thread overview]
Message-ID: <20190520163131.7c143ebe@xps13> (raw)
In-Reply-To: <20190419074717.22576-1-stefan@agner.ch>

Hi Stefan,

Stefan Agner <stefan@agner.ch> wrote on Fri, 19 Apr 2019 09:47:17 +0200:

> Sometimes the exec_op parser does not choose the optimal pattern if
> multiple patterns with optional elements are available. Since the stack
> automatically splits operations in multiple exec_op calls, a non-optimal
> pattern gets broken up into multiple calls. E.g. an OOB read using the
> vf610 driver:
>   nand: executing subop:
>   nand:     ->CMD      [0x00]
>   nand:     ->ADDR     [5 cyc: 00 08 ea 94 02]
>   nand:     ->CMD      [0x30]
>   nand:     ->WAITRDY  [max 200000 ms]
>   nand:       DATA_IN  [64 B]
>   nand: executing subop:
>   nand:       CMD      [0x00]
>   nand:       ADDR     [5 cyc: 00 08 ea 94 02]
>   nand:       CMD      [0x30]
>   nand:       WAITRDY  [max 200000 ms]
>   nand:     ->DATA_IN  [64 B]
> 
> However, the vf610 driver has a pattern which can execute the complete
> command in a single go...
> 
> This patch makes sure that the longest matching pattern is chosen
> instead of the first (potentially only partial) match. With this
> change the vf610 reads the OOB in a single exec_op call:
>   nand: executing subop:
>   nand:     ->CMD      [0x00]
>   nand:     ->ADDR     [5 cyc: 00 08 c0 1d 00]
>   nand:     ->CMD      [0x30]
>   nand:     ->WAITRDY  [max 200000 ms]
>   nand:     ->DATA_IN  [64 B]
> 
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
> Tested-by: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---

Applied, thanks.

Miquèl

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

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Stefan Agner <stefan@agner.ch>
Cc: bbrezillon@kernel.org, richard@nod.at, dwmw2@infradead.org,
	computersforpeace@gmail.com, marek.vasut@gmail.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Boris Brezillon <boris.brezillon@collabora.com>
Subject: Re: [PATCH] mtd: rawnand: use longest matching pattern
Date: Mon, 20 May 2019 16:31:31 +0200	[thread overview]
Message-ID: <20190520163131.7c143ebe@xps13> (raw)
In-Reply-To: <20190419074717.22576-1-stefan@agner.ch>

Hi Stefan,

Stefan Agner <stefan@agner.ch> wrote on Fri, 19 Apr 2019 09:47:17 +0200:

> Sometimes the exec_op parser does not choose the optimal pattern if
> multiple patterns with optional elements are available. Since the stack
> automatically splits operations in multiple exec_op calls, a non-optimal
> pattern gets broken up into multiple calls. E.g. an OOB read using the
> vf610 driver:
>   nand: executing subop:
>   nand:     ->CMD      [0x00]
>   nand:     ->ADDR     [5 cyc: 00 08 ea 94 02]
>   nand:     ->CMD      [0x30]
>   nand:     ->WAITRDY  [max 200000 ms]
>   nand:       DATA_IN  [64 B]
>   nand: executing subop:
>   nand:       CMD      [0x00]
>   nand:       ADDR     [5 cyc: 00 08 ea 94 02]
>   nand:       CMD      [0x30]
>   nand:       WAITRDY  [max 200000 ms]
>   nand:     ->DATA_IN  [64 B]
> 
> However, the vf610 driver has a pattern which can execute the complete
> command in a single go...
> 
> This patch makes sure that the longest matching pattern is chosen
> instead of the first (potentially only partial) match. With this
> change the vf610 reads the OOB in a single exec_op call:
>   nand: executing subop:
>   nand:     ->CMD      [0x00]
>   nand:     ->ADDR     [5 cyc: 00 08 c0 1d 00]
>   nand:     ->CMD      [0x30]
>   nand:     ->WAITRDY  [max 200000 ms]
>   nand:     ->DATA_IN  [64 B]
> 
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
> Tested-by: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---

Applied, thanks.

Miquèl

  reply	other threads:[~2019-05-20 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19  7:47 [PATCH] mtd: rawnand: use longest matching pattern Stefan Agner
2019-04-19  7:47 ` Stefan Agner
2019-05-20 14:31 ` Miquel Raynal [this message]
2019-05-20 14:31   ` Miquel Raynal

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=20190520163131.7c143ebe@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=stefan@agner.ch \
    /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.