Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3403958pxb; Mon, 30 Aug 2021 00:57:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS3bsRASNsx5DN2Ym9GjsItTsA1+dLaXjWzoyhUAlnbMTs2RzLwpRmnaQ4SjseIsLa7n1u X-Received: by 2002:a92:194c:: with SMTP id e12mr14483497ilm.199.1630310264274; Mon, 30 Aug 2021 00:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630310264; cv=none; d=google.com; s=arc-20160816; b=sASTbrYTvh0tvjMYXtmsAlnsusZyYg2KDlR4zmB1tKdreh2z+IZq2RcOgnsUYyfr+G rOnchMDwfnh6QyJRLd3sUElMT9+ywMgxPP+HfAlBjWppgzScGibuE6C3Gd+iWVhd11nQ Zm1Uy885ntCVdKAMb3KZS0q1QkW7AFHL2Rr/+LY2jSiLL8lballQOdZdW9JIEBE/N5dA l7rWnv/IdAY2n37QicYKUmNoNRJUvSUUkJF9SYExGnYSAQx6d4PoJCu2IY0W/yWbTZrd aMXXuI4QDZGBTND2RFzrbIMkpz2pp/z7huNkl1MXmisUMC+CFg1/D6gRA3ukGy0bxJA+ I0JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=zIedMMDBias9k97/W1BQxFaVmnJ1pPOUUFVQDitjMFs=; b=JY+cVGGtpxObNmE08f0HgfT9UYJBkG+83WX0k2ZkU2lHgeBkyp5ISz1RpRla7KjCO0 VC3FxPJeJS5lb9h/yddWOFXjbDaAOqV5lQN30SKCOrnwH+dep8Vsyr+zVVWgwM3QnwFz MQuFSulhP9lTAC5xwdO9ZG/Oqd36k1rSLlYxhImz+UxvVJT4+W651ioEENyMii/X2Uxj 1I7JHdlOp/mWwJy+xnCvHgDREn68lp8tSWFrHcx++NuVRc+34AXiC6QjEYG14UYFqgbL BC15QhrsyMqaRlzWeGPUYm9f6fs0LZGgef14UZTRZCfJ1a5gBfjeltG0AeDSA/Zumx6A v6Rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si14737859ilc.69.2021.08.30.00.57.31; Mon, 30 Aug 2021 00:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234529AbhH3H5E convert rfc822-to-8bit (ORCPT + 99 others); Mon, 30 Aug 2021 03:57:04 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:49717 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234204AbhH3H5D (ORCPT ); Mon, 30 Aug 2021 03:57:03 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 244F460009; Mon, 30 Aug 2021 07:56:07 +0000 (UTC) Date: Mon, 30 Aug 2021 09:56:07 +0200 From: Miquel Raynal To: Md Sadre Alam Cc: mani@kernel.org, boris.brezillon@collabora.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH] mtd: rawnand: qcom: Update code word value for raw read Message-ID: <20210830095607.6be588fe@xps13> In-Reply-To: <1629973862-7248-1-git-send-email-mdalam@codeaurora.org> References: <1629973862-7248-1-git-send-email-mdalam@codeaurora.org> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Md Sadre Alam wrote on Thu, 26 Aug 2021 16:01:02 +0530: > From QPIC V2 onwards there is a separate register to read > last code word "QPIC_NAND_READ_LOCATION_LAST_CW_n". > > qcom_nandc_read_cw_raw() is used to read only one code word > at a time. If we will configure number of code words to 1 in > in QPIC_NAND_DEV0_CFG0 register then QPIC controller thinks > its reading the last code word, since from QPIC V2 onwards > we are having separate register to read the last code word, > we have to configure "QPIC_NAND_READ_LOCATION_LAST_CW_n" > register to fetch data from controller buffer to system > memory. Fixes/Cc: stable tags are missing? > Signed-off-by: Md Sadre Alam > --- > drivers/mtd/nand/raw/qcom_nandc.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c > index ef0bade..04e6f7b 100644 > --- a/drivers/mtd/nand/raw/qcom_nandc.c > +++ b/drivers/mtd/nand/raw/qcom_nandc.c > @@ -1676,13 +1676,17 @@ qcom_nandc_read_cw_raw(struct mtd_info *mtd, struct nand_chip *chip, > struct nand_ecc_ctrl *ecc = &chip->ecc; > int data_size1, data_size2, oob_size1, oob_size2; > int ret, reg_off = FLASH_BUF_ACC, read_loc = 0; > + int raw_cw = cw; > > nand_read_page_op(chip, page, 0, NULL, 0); > host->use_ecc = false; > > + if (nandc->props->qpic_v2) > + raw_cw = ecc->steps - 1; > + > clear_bam_transaction(nandc); > set_address(host, host->cw_size * cw, page); > - update_rw_regs(host, 1, true, cw); > + update_rw_regs(host, 1, true, raw_cw); > config_nand_page_read(chip); > > data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1); > @@ -1711,7 +1715,7 @@ qcom_nandc_read_cw_raw(struct mtd_info *mtd, struct nand_chip *chip, > nandc_set_read_loc(chip, cw, 3, read_loc, oob_size2, 1); > } > > - config_nand_cw_read(chip, false, cw); > + config_nand_cw_read(chip, false, raw_cw); > > read_data_dma(nandc, reg_off, data_buf, data_size1, 0); > reg_off += data_size1; Thanks, Miquèl