From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FD8BC282C8 for ; Mon, 28 Jan 2019 10:12:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69F4D2148E for ; Mon, 28 Jan 2019 10:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbfA1KMF convert rfc822-to-8bit (ORCPT ); Mon, 28 Jan 2019 05:12:05 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:34666 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfA1KME (ORCPT ); Mon, 28 Jan 2019 05:12:04 -0500 Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 101043A4515 for ; Mon, 28 Jan 2019 10:55:21 +0100 (CET) Received: from xps13 (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id E6D8220000C; Mon, 28 Jan 2019 09:55:15 +0000 (UTC) Date: Mon, 28 Jan 2019 10:55:14 +0100 From: Miquel Raynal To: Boris Brezillon Cc: Emil Lenngren , Stefan Roese , Richard Weinberger , linux-mtd@lists.infradead.org, Marek Vasut , Brian Norris , David Woodhouse , stable@vger.kernel.org Subject: Re: [PATCH] mtd: spinand: Handle the case where PROGRAM LOAD does not reset the cache Message-ID: <20190128105514.5cae236e@xps13> In-Reply-To: <20190125170851.3d918da5@bbrezillon> References: <20190124142007.11607-1-bbrezillon@kernel.org> <8f80c33f-b236-27e6-3d87-a8362ad41326@denx.de> <20190124173357.2a4d7f13@bbrezillon> <20190125120910.59c33a4b@xps13> <20190125170851.3d918da5@bbrezillon> 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Hi Boris, Boris Brezillon wrote on Fri, 25 Jan 2019 17:08:51 +0100: > On Fri, 25 Jan 2019 12:09:10 +0100 > Miquel Raynal wrote: > > > Hello, > > > > Boris Brezillon wrote on Thu, 24 Jan 2019 > > 17:33:57 +0100: > > > > > On Thu, 24 Jan 2019 17:16:37 +0100 > > > Emil Lenngren wrote: > > > > > > > Hi, > > > > > > > > Den tors 24 jan. 2019 kl 16:28 skrev Stefan Roese : > > > > > > > > > > On 24.01.19 15:20, Boris Brezillon wrote: > > > > > > Looks like PROGRAM LOAD (AKA write cache) does not necessarily reset > > > > > > the cache content to 0xFF (depends on vendor implementation), so we > > > > > > must fill the page cache entirely even if we only want to program the > > > > > > data portion of the page, otherwise we might corrupt the BBM or user > > > > > > data previously programmed in OOB area. > > > > > > > > > > > > Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") > > > > > > Reported-by: Stefan Roese > > > > > > Cc: > > > > > > Signed-off-by: Boris Brezillon > > > > > > > > > > Works fine (limited testing only yet), so: > > > > > > > > > > Tested-by: Stefan Roese > > > > > Reviewed-by: Stefan Roese > > > > > > > > > > Thanks, > > > > > Stefan > > > > > > > > > > > > > Can this quirk be made vendor specific? > > > > > > We can make it vendor specific, as long as it's an opt-in thing. This > > > way, the default behavior is the safest one, and only when we know a > > > chip does reset the cache content on a PROGRAM LOAD time can we add this > > > flag. > > > > I am fine with this approach. > > Does that stand for a Reviewed-by/Acked-by? To make it clear, I was > saying that we should fix things first (with this fix) and only then > optimize things for chips that actually reset the cache when PROGRAM > LOAD is executed. I was not planning on sending a new version of this > patch, unless you see good reasons to do so. I thought you would send a v2 but I am fine with this approach too. Acked-by: Miquel Raynal Thanks, Miquèl