From patchwork Mon Jan 18 23:52:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathew McBride X-Patchwork-Id: 365645 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp250274jam; Mon, 18 Jan 2021 15:54:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJykjgAjTGg0r15kVZuTUQn3Cp3sySetFKQeNNQE4kjmitWTMxtvEfwUiyEltN5wQTSaQGu+ X-Received: by 2002:a17:906:22c7:: with SMTP id q7mr1305310eja.486.1611014051728; Mon, 18 Jan 2021 15:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611014051; cv=none; d=google.com; s=arc-20160816; b=n1KENZLGgme/QihmY1bUoJRyv3eEH4nNmEz8Agyd1uuudtzIAO/WdWnXi7YHLQCg9b re5woeMjoCn2OBkT2uvrYahwVUahtSecLzmPCHLnUvjO69qScJyo7Pvq/ti7VnSzy61S yTtSco2Z3nHVnkdsCZir9KdPUSCXNNq92RnSxkc5b8mUyOUAUSdsBa25CT/xp2HrcvKp lsDx5ohcwk3FYg/+5x1MQ5DivZcVqQEt0LSDxuRS0g/E8MZRCvH/dMaKGkENcrBhHBex m7E5kPv+tqCKEVgiJZNvnMK+58o1SNnKwpR84qF/XGRrctpR12AW/YK2BWoYm6F5JU2n Ka3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=/KqLIC8WyE/7NS0w4auxoHVEWAm4eByW0MpUskmGuzM=; b=wmZscAyUqFZMP4qVJ1/nLJSxQem1FSEyTvnGZp8Cf4vt9yyNLq1VWWc6SDC3A9sqBT Kau7CFUONdhKSI4trCMbTEZ7HFw5AeRURq29LzK1EXJ+EQKR526deOZmuU105cZZXov0 Rcjr5t3vVE+6uQzDV+dp2xQnJ4v6UGkNb3eKv8QXvxHYWu62bew7zXsqFn75vzddDgac dvQNdTG4AnJhugvXxs7FYV/1Dk/RpyBLlFvuxGBrdQ34tDcWKAQ73qaYt3VwXr/W7CdE PMa8ni0MRhmWhYUPXd1L/IlLxulj4VHZD+jvTuDXyJIN3KUAZBWsztSNpl9eAbuCrg7K wORQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@traverse.com.au header.s=fm2 header.b=DfkK1S6M; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=PXt5whfY; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p18si6253879ejm.276.2021.01.18.15.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 15:54:11 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@traverse.com.au header.s=fm2 header.b=DfkK1S6M; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=PXt5whfY; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 14F80828B6; Tue, 19 Jan 2021 00:53:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.b="DfkK1S6M"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="PXt5whfY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04DB4828B6; Tue, 19 Jan 2021 00:53:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 636168289B for ; Tue, 19 Jan 2021 00:53:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matt@traverse.com.au Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id AA06C5C0208; Mon, 18 Jan 2021 18:53:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 18 Jan 2021 18:53:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=traverse.com.au; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=/KqLIC8WyE/7N S0w4auxoHVEWAm4eByW0MpUskmGuzM=; b=DfkK1S6MdK27OdXQQsw1soYDGNxyM gDUdswfDm+m1eIFWqs/vIM5DtNMnQU/nVuqtqTo73QrBpXqdqfLA3TDdsZ3OTUOg uimEVWfsxLllbW1tqohjSgItHRZLAukDa5/9D55fskqpRW33Zt/3apGZh8rzTXG/ VIw0JlhElL3pH8kN9k7HZWnoDlR2TZOCtj0z6u82R4ixba1+JvPeIo45V0x6F94W EHpZ+7CAFPh/LWSq1a/PrhnJrxRDNFkMggF0NpRu4tlPbXhf0WH42QbJicrdTZL3 sOnUnJVU0XM/OJIKwvLAjbd76fWnghgXMEotzclbHQVS6dXAturcgFuAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/KqLIC8WyE/7NS0w4auxoHVEWAm4eByW0MpUskmGuzM=; b=PXt5whfY AbRHekFkppQw3RN9qc8oSvZxmJOEwv315PQLG1EibUfh6FLD7rVAD8tM8hGXEZfA d/WR0Pgh7ZZXhdJkOvzLeZavwI+RjC1uvLfropd7dirO3CC0nq5C2cJAuXGP+o8O 27NYRQ7oPoTFMOncR6js2TooDPexjwpIEFC3w+C0yccrsAb6ZWE1yqOggNTQaeCu S46BT1bjmgeq0zE6jjw9H3CoAqwfXPUc2ATpGbUqP7ftjR+P+cOVSrpzQiiB2+KH WGo3Kel4CzmQj+OjO9KsFtVa6yY0X+bxmYLiN8DqNden9AtWFgoQTgXwUGwF2NvF nXJaAJafN575RQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdelgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddutddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeforghthhgvficuofgtuehrihguvgcuoehmrghtthesthhrrghvvghrsh gvrdgtohhmrdgruheqnecuggftrfgrthhtvghrnhephedukeegvefhfeeuiedugeejlefg iedtveevkeektefgieetteetffelveevtdelnecuffhomhgrihhnpehkvghrnhgvlhdroh hrghenucfkphepudduledrudejrdduheeirddugedunecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrthhtsehtrhgrvhgvrhhsvgdrtghomh drrghu X-ME-Proxy: Received: from localhost.localdomain (119-17-156-141.77119c.mel.static.aussiebb.net [119.17.156.141]) by mail.messagingengine.com (Postfix) with ESMTPA id 8816324005B; Mon, 18 Jan 2021 18:53:40 -0500 (EST) From: Mathew McBride To: Jagan Teki , u-boot@lists.denx.de Cc: Priyanka Jain , Michael Walle , Mathew McBride , Mark Brown Subject: [PATCH 2/3] spi: fsl_qspi: Ensure width is respected in spi-mem operations Date: Mon, 18 Jan 2021 23:52:55 +0000 Message-Id: <20210118235256.29748-3-matt@traverse.com.au> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118235256.29748-1-matt@traverse.com.au> References: <20210118235256.29748-1-matt@traverse.com.au> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Adapted from kernel commit b0177aca7aea From: Michael Walle Make use of a core helper to ensure the desired width is respected when calling spi-mem operators. Otherwise only the SPI controller will be matched with the flash chip, which might lead to wrong widths. Also consider the width specified by the user in the device tree. Fixes: 91afd36f38 ("spi: Add a driver for the Freescale/NXP QuadSPI controller") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20200114154613.8195-1-michael@walle.cc Signed-off-by: Mark Brown Signed-off-by: Mathew McBride [adapt for U-Boot] --- drivers/spi/fsl_qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.0 diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 8bc7038a82..2a1f3a0c44 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -409,7 +409,7 @@ static bool fsl_qspi_supports_op(struct spi_slave *slave, op->data.nbytes > q->devtype_data->txfifo) return false; - return true; + return spi_mem_default_supports_op(slave, op); } static void fsl_qspi_prepare_lut(struct fsl_qspi *q,