Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3630766rdb; Wed, 13 Sep 2023 19:28:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVmxyhkrpQiJ6XoZ7wtuMf8IsYa9JiiBKHajKbUGfooFqZc7ol5KlLp11EA+nyy+kCKHOW X-Received: by 2002:a05:6808:2220:b0:3ac:9ab2:1912 with SMTP id bd32-20020a056808222000b003ac9ab21912mr5949731oib.3.1694658488444; Wed, 13 Sep 2023 19:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694658488; cv=none; d=google.com; s=arc-20160816; b=BSE65jSZFfSzmdC4OWnJHOPHzPU6bBtV9CxyFKgdm501OT+xZ6z8fPjddV8e6a8JmN n5S6f8fGqkYYAyJ9itqcqj6t6LM52heptleEv6U6lA3cMV/a2D+s3l9bZlf402yDP7Bo ZaRU0VJ8ryfnP7gmsf7nuf8Vjkoyu7fLZda6QKbZLHCWiP+0ThDLpqKS7Kktmn8Gkjz8 JO0Dk1BJdeNS8ezTZqFJYYOMpV+BIpwUQpRo+LKSPzhrEHSzFGKCVeko3B7pzdFpwXBX 6r5L5yB/pi/s459pwpIra6TQXu5I1Hl0Cxe3Ye1ywt0KmwFqTj7N2I0/WUYe04U1EJzJ eo6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FMvSrdr6nvE/RdpFYlVGFpBo/AaS+5Vzyth3mEZ8vZA=; fh=CK76bJXKYkNewc5GECKhlEnIra/RfcR8zVTV+lCCTV8=; b=D75ekBaZ8q/E+uYuegD6T17yGFZELgZOCr/tvBlRb3o57VKasJAKJNYycNPitNMpNd v1414/H5D62mILbnBAU3WkHOWdOW7INnKW8TsOaoH8c6zYjn1ngqypICKrv24xPafUTv nSulQTxk6A/88L4El36ufCjIHXjTUBUey7miW3WdzlA/3HELBExBhAJReo+gp4tSMUsC NjeqjkY13hD7STiQoLjeWtEaYZ5jl4CGl3dQAB/U5qMPF4u3Shah8WfSpISZRql1MBBk 3J1YKhSX26B3mRxYDkjsKEQlZkbfupk8VpinwS1eIT10Pgv1KiSKIVUgifqrvLfsNl0U 3TDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nxNVcvBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p31-20020a056a000a1f00b0068e4037c5f7si587061pfh.388.2023.09.13.19.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 19:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nxNVcvBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7386F8271408; Wed, 13 Sep 2023 18:55:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233753AbjINBz1 (ORCPT + 99 others); Wed, 13 Sep 2023 21:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233738AbjINBzV (ORCPT ); Wed, 13 Sep 2023 21:55:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350831BEC; Wed, 13 Sep 2023 18:55:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92AA6C43391; Thu, 14 Sep 2023 01:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694656513; bh=mPNHzB+IFiOFsROhg18ge8hhu4lILId2aXwKB3Qc/g4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxNVcvBWLpkDSppp9D9uPAYmLwVd25H04A6q4/UPKWYSK59YC435/U9W2A/+Yi4ER 6+je09OIRpFXs2Qd23u9Fr9buX5n1r4xzkk59Tguy6oKGWsSfwKbh1rIS0UfppoGlI z6NEuDpYl/vePkd6JAnhI0qnF/rSsocifirMv01ow8wCPv3EvnOagFqFD0oV6f+4i1 fLXRd9QOkfzIRx3+8YALtLOGFDxhcVoHKV0I1EihBIX9bY24PefR01Viovg4rlMe5e e6ZVyn7v1jSQA77Qa3sLoYf14a75qua5yltyhTysH9+F7ZmIm0MYSPmxQkvhtnuSAV LlHa2VxTRSM3g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tobias Schramm , Mark Brown , Sasha Levin , wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH AUTOSEL 6.5 6/7] spi: sun6i: reduce DMA RX transfer width to single byte Date: Wed, 13 Sep 2023 21:54:50 -0400 Message-Id: <20230914015459.51740-6-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914015459.51740-1-sashal@kernel.org> References: <20230914015459.51740-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.3 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 18:55:37 -0700 (PDT) From: Tobias Schramm [ Upstream commit 171f8a49f212e87a8b04087568e1b3d132e36a18 ] Through empirical testing it has been determined that sometimes RX SPI transfers with DMA enabled return corrupted data. This is down to single or even multiple bytes lost during DMA transfer from SPI peripheral to memory. It seems the RX FIFO within the SPI peripheral can become confused when performing bus read accesses wider than a single byte to it during an active SPI transfer. This patch reduces the width of individual DMA read accesses to the RX FIFO to a single byte to mitigate that issue. Signed-off-by: Tobias Schramm Link: https://lore.kernel.org/r/20230827152558.5368-2-t.schramm@manjaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 30d541612253e..8fcb2696ec099 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -207,7 +207,7 @@ static int sun6i_spi_prepare_dma(struct sun6i_spi *sspi, struct dma_slave_config rxconf = { .direction = DMA_DEV_TO_MEM, .src_addr = sspi->dma_addr_rx, - .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, + .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, .src_maxburst = 8, }; -- 2.40.1