Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2016224imm; Sun, 27 May 2018 23:17:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrj/HkpMK/x6LSiyb4Bcp2sS/AzbD/QJTLXdc7gRK0xHqOX/leaWp8tRndZWh4TcmDmf62L X-Received: by 2002:a62:c987:: with SMTP id l7-v6mr11937216pfk.221.1527488268065; Sun, 27 May 2018 23:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527488268; cv=none; d=google.com; s=arc-20160816; b=PxCRiWd1cYHm+p30gO8ONBLwmZae7sgTouqOart/AVywERTgN03sJoQba9PTmP1qCR hGKkxjjoGGyDOsqjrauZBGLLXkyYWSMLlRuf5hce4iwWpCp3hhd/+MbiVAH2h4jwkDr4 Oyv+/mv+zc0E4q+Ex5Z1hXG3ykunfGiXY5dvkzMYMaGZ+BJpFM4CcoBChG3EqQuZQG6i lsFS5hUjKs4LhhifPhIJQ/8EiePLiaYiwhj3YaC4emdADtKWydfIsz5EJ3n0yAEhagzN iXJdxzjQLZ1IroEv+7bbw2F0IIEZQtHmQYs2Stn3VONQk23EToDk4GRsR+hEBM73kh7E j2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=l466TVxvfSFMbiMkOl/6kQmbOb11XI+O5NnnyYxsQt0=; b=vdMB5psciaffipg3AclOiAcNILiynTIV6Qx/izHMdtqcO1cCaLDmHaR7ACqOMBJeH1 nqiIG3w2NYa7xwluqWvpxN9hVt3TDyx2JY2MMTMkXyUo958kqX8KOeJu+1V0D+u+4Jhc xkXZ1nRFaY6UJ9AzyKHki8u1LaiTchQsLiGXqgP/otZcOLMf8JpQqWOzNjwPXH7xeq1i MORKJAgbA3PM/C9QkGMhLvDj/gk6S20LwFxb0kE7wPZjU5pCi2vsdk/qSDzkS6WmMrRP LDnwBDN2Y09T5ueoTHsuqk2Fm16qVet41KR4/xH2iZuZBBPsPpuQWITJn1F5pRg3jyXm VojA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=UBw6Xy4U; dkim=pass header.i=@codeaurora.org header.s=default header.b=GQAmqQAw; 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 c7-v6si28975462plr.145.2018.05.27.23.17.33; Sun, 27 May 2018 23:17:48 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=UBw6Xy4U; dkim=pass header.i=@codeaurora.org header.s=default header.b=GQAmqQAw; 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 S1753387AbeE1GQu (ORCPT + 99 others); Mon, 28 May 2018 02:16:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34570 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbeE1GQs (ORCPT ); Mon, 28 May 2018 02:16:48 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7F9EC60B23; Mon, 28 May 2018 06:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527488208; bh=XKx+IRPxx1g5gUNYIwD0Sq65G6vnAMDlsWmJpwfomLk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UBw6Xy4UjSfykD/CAG1eXuyA3NA6tlN+5GrM1oxAFlaf0GMUHTIg5k6YFF5cbMKKO n80vEr8vlYOBUwxxBtYpwiGwmB8U9KrrNP/F2yfKkZfA25XglBOJocARqzAXjidmwb cYgclINqQ2Vl2etQI00+i1JWh1AEwBTIzFQ9Mqt4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 7C25060262; Mon, 28 May 2018 06:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527488207; bh=XKx+IRPxx1g5gUNYIwD0Sq65G6vnAMDlsWmJpwfomLk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GQAmqQAwxauIQuywCOKJep8mI3wAdc4J8anaLX1CtqjiPOAPVMApWtYzajRPDd3Fo fGs8cra+Yxnt+LY0nGxiYUl+mpUZv8fqCUjzF1WWkfoWN34zQoR+X5fMgH0J8xRhto gdctcqTwivNLQbXsLlqn9zpl87zowi0x1W9siHJo= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 28 May 2018 11:46:47 +0530 From: Abhishek Sahu To: Miquel Raynal Cc: Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross , Archit Taneja Subject: Re: [PATCH v3 13/16] mtd: rawnand: qcom: minor code reorganization for bad block check In-Reply-To: <20180526104900.139dd19b@xps13> References: <1527250904-21988-1-git-send-email-absahu@codeaurora.org> <1527250904-21988-14-git-send-email-absahu@codeaurora.org> <20180526104900.139dd19b@xps13> Message-ID: X-Sender: absahu@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-26 14:28, Miquel Raynal wrote: > Hi Abhishek, > > >> @@ -2141,12 +2127,10 @@ static int qcom_nandc_block_bad(struct >> mtd_info *mtd, loff_t ofs) >> goto err; >> } >> >> - bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1); >> - >> - bad = nandc->data_buffer[bbpos] != 0xff; >> + bad = bbm_bytes_buf[0] != 0xff; > > BTW, as there are host->bbm_size bytes that can inform on the block > state, don't we need to check all of them? > We are checking all of them. host->bbm_size will be either 1 (for NAND_BUSWIDTH_8) or 2 (for NAND_BUSWIDTH_16). https://elixir.bootlin.com/linux/v4.17-rc7/source/drivers/mtd/nand/raw/qcom_nandc.c#L2347 Thanks, Abhishek >> >> if (chip->options & NAND_BUSWIDTH_16) >> - bad = bad || (nandc->data_buffer[bbpos + 1] != 0xff); >> + bad = bad || (bbm_bytes_buf[1] != 0xff); >> err: >> return bad; >> } > > Thanks, > Miquèl