From mboxrd@z Thu Jan 1 00:00:00 1970 From: Archit Taneja Subject: Re: [PATCH v6 1/3] mtd: nand: don't select chip in nand_chip's block_bad op Date: Mon, 18 Jan 2016 16:17:21 +0530 Message-ID: <569CC2B9.2030800@codeaurora.org> References: <1451971501-18160-1-git-send-email-architt@codeaurora.org> <1453110634-25995-1-git-send-email-architt@codeaurora.org> <1453110634-25995-2-git-send-email-architt@codeaurora.org> <20160118112959.573ec33d@bbrezillon> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:41541 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753970AbcARKr2 (ORCPT ); Mon, 18 Jan 2016 05:47:28 -0500 In-Reply-To: <20160118112959.573ec33d@bbrezillon> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Boris Brezillon Cc: dehrenberg@google.com, cernekee@gmail.com, sboyd@codeaurora.org, linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org, andy.gross@linaro.org, computersforpeace@gmail.com On 01/18/2016 03:59 PM, Boris Brezillon wrote: > Hi Archit, > > On Mon, 18 Jan 2016 15:20:32 +0530 > Archit Taneja wrote: > >> One of the arguments passed to struct nand_chip's block_bad op is >> 'getchip', which, if true, is supposed to get and select the nand device, >> and later unselect and release the device. >> >> This op is intended to be replaceable by drivers. The drivers shouldn't >> be responsible for selecting/unselecting chip. Like other ops, the chip >> should already be selected before the block_bad op is called. >> >> Remove the getchip argument from the block_bad op and >> nand_block_checkbad. Move the chip selection to nand_block_isbad, since it >> is the only caller to nand_block_checkbad which requires chip selection. >> >> Modify nand_block_bad (the default function for the op) such that it >> doesn't select the chip. >> >> Signed-off-by: Archit Taneja >> --- >> v6: As suggested by Boris, remove getchip arg altogether and select the >> chip in nand_block_isbad >> >> drivers/mtd/nand/nand_base.c | 41 +++++++++++++++++++---------------------- >> include/linux/mtd/nand.h | 2 +- >> 2 files changed, 20 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c >> index 928081b..1809c20 100644 >> --- a/drivers/mtd/nand/nand_base.c >> +++ b/drivers/mtd/nand/nand_base.c >> @@ -317,9 +317,9 @@ static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) >> * >> * Check, if the block is bad. >> */ >> -static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) >> +static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) > > You also have to update the dummy ->block_bad() implementations in the > cafe_nand, diskonchip and docg4 drivers. Ah, I totally missed that. Will update and send. Thanks, Archit -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation