From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdEBJFL (ORCPT ); Tue, 2 May 2017 05:05:11 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:49472 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbdEBJFI (ORCPT ); Tue, 2 May 2017 05:05:08 -0400 Date: Tue, 2 May 2017 11:04:56 +0200 From: Boris Brezillon To: Brian Norris Cc: Richard Weinberger , linux-mtd@lists.infradead.org, David Woodhouse , Marek Vasut , Cyrille Pitchen , Icenowy Zheng , Valdis.Kletnieks@vt.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 05/15] mtd: nand: add manufacturer specific initialization/detection steps Message-ID: <20170502110456.2b545823@bbrezillon> In-Reply-To: <20170501210246.GA140640@google.com> References: <1483448495-31607-1-git-send-email-boris.brezillon@free-electrons.com> <1483448495-31607-6-git-send-email-boris.brezillon@free-electrons.com> <20170501210246.GA140640@google.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 1 May 2017 14:02:46 -0700 Brian Norris wrote: > Hi, > > On Tue, Jan 03, 2017 at 02:01:25PM +0100, Boris Brezillon wrote: > > A lot of NANDs are implementing generic features in a non-generic way, > > or are providing advanced auto-detection logic where the NAND ID bytes > > meaning changes with the NAND generation. > > > > Providing this vendor specific initialization step will allow us to get > > rid of the full ids in the nand_ids table or all the vendor specific > > cases added over the time in the generic NAND ID decoding logic. > > > > Signed-off-by: Boris Brezillon > > --- > > drivers/mtd/nand/nand_base.c | 67 +++++++++++++++++++++++++++++++++++--------- > > include/linux/mtd/nand.h | 35 +++++++++++++++++++++++ > > 2 files changed, 89 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c > > index efb3ade568d8..8f80faa57984 100644 > > --- a/drivers/mtd/nand/nand_base.c > > +++ b/drivers/mtd/nand/nand_base.c > > ... > > > @@ -4163,6 +4196,10 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type) > > if (mtd->writesize > 512 && chip->cmdfunc == nand_command) > > chip->cmdfunc = nand_command_lp; > > > > + ret = nand_manufacturer_init(chip); > > + if (ret) > > + return ret; > > + > > AFAICT, you're leaking anything that should be cleaned up in the > ->cleanup() hook, for any error case after this. Not absolutely critical > to fix immediately, but I'd expect we should fix this in the 4.12 cycle. Yep, already acked the patch. Thanks for the fix.