From mboxrd@z Thu Jan 1 00:00:00 1970 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 DD9ABC64ED8 for ; Mon, 27 Feb 2023 13:54:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CA3C85A6C; Mon, 27 Feb 2023 14:54:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amazon.de 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=amazon.de header.i=@amazon.de header.b="W6HCSTBa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DA4C5859BF; Mon, 27 Feb 2023 11:25:54 +0100 (CET) Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) (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 8B0E08591C for ; Mon, 27 Feb 2023 11:25:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amazon.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=415520d03=ptyadav@amazon.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1677493552; x=1709029552; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=6gHwqNxnDgbnbqqmn179MHGNSp3WzTiFM1GDTxbuBMI=; b=W6HCSTBaVfCM8BInOu4L6csPWIDRiW223MFubvnbWe78qw7qI3pOlmrN MCNUl3KJBA1JNK0iXcv0FdUz7DwDN5AhPfj77KDRa19ZsXYZ9x+hZaUte 0xMn6/LliZYKXI/Fmbv/CLaWfJmEkxirLd3fXb/cftspMs2M8rnypN7dj w=; X-IronPort-AV: E=Sophos;i="5.97,331,1669075200"; d="scan'208";a="186879921" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-m6i4x-d7759ebe.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 10:22:54 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-m6i4x-d7759ebe.us-east-1.amazon.com (Postfix) with ESMTPS id 5BF71444B5; Mon, 27 Feb 2023 10:22:52 +0000 (UTC) Received: from EX19D002UEA003.ant.amazon.com (10.252.134.110) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1497.45; Mon, 27 Feb 2023 10:22:51 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX19D002UEA003.ant.amazon.com (10.252.134.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.24; Mon, 27 Feb 2023 10:22:51 +0000 Received: from dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (10.15.11.255) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1497.45 via Frontend Transport; Mon, 27 Feb 2023 10:22:51 +0000 Received: by dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (Postfix, from userid 23027615) id 3BBEF20D69; Mon, 27 Feb 2023 11:22:50 +0100 (CET) From: Pratyush Yadav To: Dhruva Gole CC: Jagan Teki , , "Vignesh Raghavendra" , Vaishnav Achath , "Pratyush Yadav" Subject: Re: [PATCH] spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op() References: <20230220054231.74367-1-d-gole@ti.com> Date: Mon, 27 Feb 2023 11:22:50 +0100 In-Reply-To: <20230220054231.74367-1-d-gole@ti.com> (Dhruva Gole's message of "Mon, 20 Feb 2023 11:12:31 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Approved-At: Mon, 27 Feb 2023 14:54:14 +0100 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 On Mon, Feb 20 2023, Dhruva Gole wrote: > This should have been op->data.buswidth instead as we check for octal > bus width for the data related ops > Also add explanation for why there is checks for 8D even data bytes > > Cc: Pratyush Yadav > Signed-off-by: Dhruva Gole Reviewed-by: Pratyush Yadav > --- > > Address Pratyush Yadav's comments from here: > https://lore.kernel.org/u-boot/20221106224617.2ievqx37mcvqntdr@yadavpratyush.com/ > > drivers/spi/spi-mem.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c > index 8e8995fc537f..57a36f31a5d3 100644 > --- a/drivers/spi/spi-mem.c > +++ b/drivers/spi/spi-mem.c > @@ -181,8 +181,12 @@ bool spi_mem_dtr_supports_op(struct spi_slave *slave, > if (op->dummy.nbytes && op->dummy.buswidth == 8 && op->dummy.nbytes % 2) > return false; > > + /* > + * Transactions of odd length do not make sense for 8D-8D-8D mode > + * because a byte is transferred in just half a cycle. > + */ > if (op->data.dir != SPI_MEM_NO_DATA && > - op->dummy.buswidth == 8 && op->data.nbytes % 2) > + op->data.buswidth == 8 && op->data.nbytes % 2) > return false; > > return spi_mem_check_buswidth(slave, op); > -- > 2.25.1 > -- Regards, Pratyush Yadav Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879