[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190520163131.7c143ebe@xps13>
Date: Mon, 20 May 2019 16:31:31 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Stefan Agner <stefan@...er.ch>
Cc: bbrezillon@...nel.org, richard@....at, dwmw2@...radead.org,
computersforpeace@...il.com, marek.vasut@...il.com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
Sascha Hauer <s.hauer@...gutronix.de>,
Boris Brezillon <boris.brezillon@...labora.com>
Subject: Re: [PATCH] mtd: rawnand: use longest matching pattern
Hi Stefan,
Stefan Agner <stefan@...er.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@...gutronix.de>
> Suggested-by: Boris Brezillon <boris.brezillon@...labora.com>
> Tested-by: Stefan Agner <stefan@...er.ch>
> Signed-off-by: Stefan Agner <stefan@...er.ch>
> ---
Applied, thanks.
Miquèl
Powered by blists - more mailing lists