Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp997210pxb; Wed, 1 Sep 2021 14:52:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUEiUJPd2ggVPFb3+4sUAba5xe6U0+UYEYK1Sl3+7AnndoTFc+9PvCe/7Rjzv6kdFk4UdC X-Received: by 2002:a50:d088:: with SMTP id v8mr20199edd.387.1630533143694; Wed, 01 Sep 2021 14:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630533143; cv=none; d=google.com; s=arc-20160816; b=wEnlAKpi2ptwf/aBZmCU91f35lqxDcewNUA4OL2Pj54eGsg+KDQOYGXTLUadG4BCsI uSkP05bcOkWYl0pUtAc++dHxoSwSxA3nCckR65EylP6Qd1ZT0DJVPK9k4jMCc0Vl0a4Z P2D6oquz2+Y1r9vD2a17NlzAZBJOkR7Xsblvpr+masjNk9odzLY3yBqkZlB+wU/ZlKXs ix5JeeI7KlTJgFafiQhCkLKYC+UhWliWieFiPcsNDWhz+5Pl+09YefnSTPMtivNigy9w hYiI+LB+NFqDXll+sp/Ti6Rp+/iZujthBWn38F5GLlNgtzGMowQHVFFkQ63kSThD6BrT zV/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=i/rV9eRMsBXO4MHz9MLGdRubgAKJZJUODTtpd0gk+CQ=; b=hSguxLMCSHCPh0nNJWhpVaRZqNjUK+UsHd43Kuyzjn+clZAHjVo2cxomsXVpGXSRaz IRVOelyJhJ1nbbqwwB6yv71azMS8Rl6dOrP08lED/Kzu8X3ElIBPpRJ3gAB4C/6mHpoW kGg11VI2Z1nY7hAc0Zt7WIlNcvYYeWZZlijm4X/irQrsoNGZX67rrR4eT1v7aD1GhOz/ iHidF6rbxzmVhm1KTYg1HurNCmUMbUGG8WMsIq41uTR93Lk1slUqmVgOdcSMu9n0EypI zkp/qxkMuBPosW8ZH31i2BY12IRPfaLuUbL74F18nWPdzLhHz29BmxD9qw4n7Sx28j37 H6hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=fXPQUb2C; 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 a2si900edx.80.2021.09.01.14.52.00; Wed, 01 Sep 2021 14:52:23 -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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=fXPQUb2C; 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 S238555AbhIAK4f (ORCPT + 99 others); Wed, 1 Sep 2021 06:56:35 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:63071 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbhIAK4e (ORCPT ); Wed, 1 Sep 2021 06:56:34 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630493738; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=i/rV9eRMsBXO4MHz9MLGdRubgAKJZJUODTtpd0gk+CQ=; b=fXPQUb2CABG+iafqDiRxHun7vs7fWQaE+oo4OFT1DNd8zkwupH6/JLCrDHWUwLs3JROcECA7 n6wUl2lO3Dpif/z2t3ygMCvSdkrcoM2RLTi1Dq2wSF+Gi/4uCRKYuDNOeAxcIN0nXV0Mognu 2+lslGLy4sv2UKOlRCueepUTq3Q= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 612f5c15cd680e89691f72cb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 01 Sep 2021 10:55:17 GMT Sender: mdalam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7B546C43617; Wed, 1 Sep 2021 10:55:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mdalam) by smtp.codeaurora.org (Postfix) with ESMTPSA id B8945C43460; Wed, 1 Sep 2021 10:55:15 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 01 Sep 2021 16:25:15 +0530 From: mdalam@codeaurora.org To: Miquel Raynal Cc: mani@kernel.org, boris.brezillon@collabora.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org, stable@kernel.org Subject: Re: [PATCH V2] mtd: rawnand: qcom: Update code word value for raw read In-Reply-To: <20210831134231.14413a4f@xps13> References: <1630400200-2522-1-git-send-email-mdalam@codeaurora.org> <20210831134231.14413a4f@xps13> Message-ID: <114bc85cdd51cb6c885b00d4d2819df9@codeaurora.org> X-Sender: mdalam@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-31 17:12, Miquel Raynal wrote: > Hi Md, > > Md Sadre Alam wrote on Tue, 31 Aug 2021 > 14:26:40 +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. >> >> Cc: stable@kernel.org > > You miss the Fixes tag which is certainly the most important. Updated in V3 patch. > >> Signed-off-by: Md Sadre Alam >> >> [V2] >> * Added stable tags > > The changelog should not be part of the commit message. > You should put it... > Updated in V3 patch. >> --- > > ...here. > >> 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