Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3108ECAAA1 for ; Thu, 27 Oct 2022 15:09:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26ECB85030; Thu, 27 Oct 2022 17:09:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="ujBXczkU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B6ED585062; Thu, 27 Oct 2022 17:09:29 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 80C8984F45 for ; Thu, 27 Oct 2022 17:09:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=d-gole@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29RF9E5a131046; Thu, 27 Oct 2022 10:09:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1666883354; bh=idH6hEivcjjzvT3fube+yFFBGNui4Jdo2xtFYqyp+IY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=ujBXczkUUb+fcx0Hrflo0Yb/I/SQqW+lTkoM5CQ8dW8TjNEz6z0Fs69n93LEpdmtO 7suTufrewHL8sYp022FRJ8qIx+8vxBenrUokF2lxVBgt0k87QAp2yglpaoiokUBp7v VmHt2LQg8JTWRSmRfDOUunYDC+nhlAmuj1qOW6u4= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29RF9Etd002045 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Oct 2022 10:09:14 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 27 Oct 2022 10:09:14 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.32) 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; Thu, 27 Oct 2022 10:09:14 -0500 Received: from [10.250.234.171] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29RF9958005804; Thu, 27 Oct 2022 10:09:10 -0500 Message-ID: <6d19006b-78bf-0448-6f1c-60001e3cdabb@ti.com> Date: Thu, 27 Oct 2022 20:39:08 +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: [PATCH v2] spi: spi-mem: ease checks in dtr_supports_op() To: Tom Rini CC: Jagan Teki , Nishanth Menon , Vignesh Raghavendra , , Pratyush Yadav References: <20221025062036.383460-1-d-gole@ti.com> Content-Language: en-US From: Dhruva Gole In-Reply-To: <20221025062036.383460-1-d-gole@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi, A gentle reminder to review the following patch: spi: spi-mem: ease checks in dtr_supports_op() https://lore.kernel.org/u-boot/20221025062036.383460-1-d-gole@ti.com/ Kindly merge if it looks okay. On 25/10/22 11:50, Dhruva Gole wrote: > Remove the extra conditions that cause some cases to fail prematurely > like if the data number of bytes is odd. The controller can handle odd > number of bytes data read in DTR Mode. Don't fail supports op for this > condition. This change can also be justified by taking a look at the > equivalent code in the linux kernel (v6.0.3), in drivers/spi/spi-mem.c, > where such an even number of data bytes check is absent as well. > The presence of this even byte check causes supports op failure even if > the controller can indeed work in case of odd bytes data reads in > DTR (Dual Transfer Rate) mode in xSPI. > There have not been any sort of major bugs in the absence of this > particular supports_op check, so it is safe to discard this > check from here. > > Signed-off-by: Dhruva Gole > --- > v1 of the patch had a relatively shorter commit body that did not > sufficiently describe and justify this patch. link to v1: > https://lore.kernel.org/u-boot/20221020083424.86848-1-d-gole@ti.com/ > > v2 has just updated the commit body while preserving the code changes from > earlier v1 patch. This tries to address the changes requested from Jagan Teki. > > drivers/spi/spi-mem.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c > index 8e8995fc537f..eecc13bec90d 100644 > --- a/drivers/spi/spi-mem.c > +++ b/drivers/spi/spi-mem.c > @@ -181,10 +181,6 @@ bool spi_mem_dtr_supports_op(struct spi_slave *slave, > if (op->dummy.nbytes && op->dummy.buswidth == 8 && op->dummy.nbytes % 2) > return false; > > - if (op->data.dir != SPI_MEM_NO_DATA && > - op->dummy.buswidth == 8 && op->data.nbytes % 2) > - return false; > - > return spi_mem_check_buswidth(slave, op); > } > EXPORT_SYMBOL_GPL(spi_mem_dtr_supports_op); -- Best regards, Dhruva Gole Texas Instruments Incorporated