Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp845876rwi; Mon, 31 Oct 2022 08:12:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6SGlFaJ8FSj2xzlgxDheAMHtcMZp1SmuYKceEfG8Om27xEmeRVa4f/w6j7IEMBb7YZfHVk X-Received: by 2002:a17:906:2353:b0:7ad:daae:6edd with SMTP id m19-20020a170906235300b007addaae6eddmr3616752eja.40.1667229165659; Mon, 31 Oct 2022 08:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667229165; cv=none; d=google.com; s=arc-20160816; b=eTiJ6msCmR3IE7oQ2gW9L1hCdVd/gnue55pOzpHVZU/aTVTYkYoSoe+QX24G4mRclm CSYNjtaPEObR/NALKJ6Do4nKJptO29rR7L69VbbsLxdXh3maFLDPQ22Gz48vIeVPpEiI Hy3AA5SAZ1nwvH+ih4k1JAmNahFBnp9MBwbvNEGBlwyvZAnCXM+71MFHEBDhZQ+zA2Mi xC6uNwjeGf/ilrP7kZr8hwZnfGJSKAUznDhuhKJTjq+swgHxppMId8MSI3uv0uY1VYhp iWUdYHZ7L2uQGH4HIpInpkc0NvobhEZmpkeAplmMTor6grNj8rxYzMIBsSY8Vc2u5JNb iFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xKMheBe6+tALckGCgXRgq0Nenx9e5EqobLOp//FbZXY=; b=SX2nzb1f5Kz2Gx4b93lr8UojlF+xKP6qheBQxovxeyu5Bz988T/sfdL2ffobdejhS1 cpI7/LLf5R5Ypr/QzxzTPCXJV49A7n7NivO8hCIwy7d8/PB1yTc1DXdzOFVmGtSAGNLJ h2auxf/PYWSMiCdHpNVcfLpRXjfM/piKR9kGA9shaHRbCvRBOLlYAmqnZk69gEr7fOin viHeA44gaMqw7+T3yNtsRUkbylCVxBcOG8AtHvFgP6bS9qsU/ZL4iBLHX0kl0GlwXdME pZ5OAfftTgQ20m7yluqOnHu2Phv94M2kWQMRO1u4VKm7JXliatHkCEiyAcL44WteSwGp rbWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EEEOmior; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bl2-20020a170906c24200b0077c5ec87ec2si6257474ejb.297.2022.10.31.08.12.03; Mon, 31 Oct 2022 08:12:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EEEOmior; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231658AbiJaOnd (ORCPT + 98 others); Mon, 31 Oct 2022 10:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231673AbiJaOnb (ORCPT ); Mon, 31 Oct 2022 10:43:31 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94248FD30; Mon, 31 Oct 2022 07:43:30 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29VEh2LZ002087; Mon, 31 Oct 2022 09:43:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667227382; bh=xKMheBe6+tALckGCgXRgq0Nenx9e5EqobLOp//FbZXY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=EEEOmiorUFfhlYJP4Kmp+Tqf3wLsmqWR8VoUSQQuL9bG3CnyXcDGVfEXzItcJDkYw /zH1whRx6xA+3ul9TnsKgSdght7iimEz4LkD5hcW9igiQVVPxru4JLh1ECQzz3/diM sOjEbNeTiSRneF9jkWzMR23AZX2EESkSBVTSKoUY= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29VEh299006573 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Oct 2022 09:43:02 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 31 Oct 2022 09:43:02 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 31 Oct 2022 09:43:02 -0500 Received: from [10.250.234.171] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29VEgu2P021939; Mon, 31 Oct 2022 09:42:57 -0500 Message-ID: Date: Mon, 31 Oct 2022 20:12:55 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [EXTERNAL] [PATCH] mtd: spi-nor: Fix the number of bytes for the dummy cycles To: Allen-KH Cheng , Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Matthias Brugger , CC: , , , , , Bayi Cheng References: <20221031124633.13189-1-allen-kh.cheng@mediatek.com> Content-Language: en-US From: Dhruva Gole In-Reply-To: <20221031124633.13189-1-allen-kh.cheng@mediatek.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/10/22 18:16, Allen-KH Cheng wrote: > The number of bytes used by spi_nor_spimem_check_readop() may be > incorrect for the dummy cycles. Since nor->read_dummy is not initialized > before spi_nor_spimem_adjust_hwcaps(). > > We use both mode and wait state clock cycles instead of nor->read_dummy. > > Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol") > Co-developed-by: Bayi Cheng > Signed-off-by: Bayi Cheng > Signed-off-by: Allen-KH Cheng > --- Tested-by: Dhruva Gole > drivers/mtd/spi-nor/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c > index 6c921eb3fadb..8b9c318a0ad4 100644 > --- a/drivers/mtd/spi-nor/core.c > +++ b/drivers/mtd/spi-nor/core.c > @@ -1914,7 +1914,8 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor, > spi_nor_spimem_setup_op(nor, &op, read->proto); > > /* convert the dummy cycles to the number of bytes */ > - op.dummy.nbytes = (nor->read_dummy * op.dummy.buswidth) / 8; > + op.dummy.nbytes = (read->num_mode_clocks + read->num_wait_states) * > + op.dummy.buswidth / 8; > if (spi_nor_protocol_is_dtr(nor->read_proto)) > op.dummy.nbytes *= 2; > Tested on my AM625 SK EVM having spi nor flash and no obvious regressions observed :) -- Best regards, Dhruva Gole Texas Instruments Incorporated