Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp25533ybm; Mon, 20 May 2019 11:11:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDDfxrnDRuHoIsh+c010+rNLUiYiSEFkFSxaQqR2JLhuCTv9YwSgaGU9j41OzVi1uMdN/Y X-Received: by 2002:a63:2ac9:: with SMTP id q192mr6057429pgq.144.1558375890624; Mon, 20 May 2019 11:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558375890; cv=none; d=google.com; s=arc-20160816; b=hhEI8roKKRQNtln3XeJkqmo9FEuS1PO0bmeDtwOjfy9/In6gVpNgm/wwZlvCY1ujLy eCVN6XxOZTM1+f2oH07NxdP12gdKmKaPukGsOsn4r2HSXxg022Z0N/1o/weqgnBHYh32 ADJewK3cW7Po7rgLIHaFDsSn5Q/a3aEKYhcnrN+GBXBkt7kcdCreQ0jgOwcZofJmQplB PFp0t8BbnXb5tUbRvC24kC2QJsJ2QmIgAAVXoGDpw8Knd86u+c6QMIv78lKcx5tIUVVa Hbtk50e3Ol2OL4kDQbXns06Vx0+tfQf09Ty5lVpTj6iXjZFEbcy1VHJCEBz43CMQ5dBQ HoRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=A8ZfLGUIbls7FDTAvcKEMVsvA2NOxhDaIyY/fdoHZXU=; b=CDy6WlJvXNOSXLkeH6qwtnAju0Cd0OH+WSH1cMj5SG35QRmFxyl/MqkIaARRqhhWzE TKuOsdo/s0vWmTV0ywxhB6nLejr9nlxF/c2+ap1PWQTTK2KtGceQMsxannsOJAYwqxdb FpSj9zqoM9YXtIpkMvek4UYodupN0q5OuqaGUxovVFsNgOqqXUraSnVLM5RajqUORplQ LzCpjuS7tkSaJM3CW1XJZyiTs2R617llPfF1zR+ZauNhEUal6A2WfoEHt2IgBBulhwVa wTWizMfayiLbVUiFiV9hqtsYmnjgMOC+0+Mz0dEsJIbxe2g/p8WXSmxA1i9sxIjPNEsc 7iMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si15685362pfd.78.2019.05.20.11.11.16; Mon, 20 May 2019 11:11:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389959AbfETObm convert rfc822-to-8bit (ORCPT + 99 others); Mon, 20 May 2019 10:31:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:50209 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731054AbfETObm (ORCPT ); Mon, 20 May 2019 10:31:42 -0400 X-Originating-IP: 90.88.22.185 Received: from xps13 (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 7DCA260005; Mon, 20 May 2019 14:31:32 +0000 (UTC) Date: Mon, 20 May 2019 16:31:31 +0200 From: Miquel Raynal To: Stefan Agner 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 , Boris Brezillon Subject: Re: [PATCH] mtd: rawnand: use longest matching pattern Message-ID: <20190520163131.7c143ebe@xps13> In-Reply-To: <20190419074717.22576-1-stefan@agner.ch> References: <20190419074717.22576-1-stefan@agner.ch> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stefan, Stefan Agner 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 > Suggested-by: Boris Brezillon > Tested-by: Stefan Agner > Signed-off-by: Stefan Agner > --- Applied, thanks. Miquèl