Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2486543pxb; Tue, 21 Sep 2021 00:24:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrn7BBfuv6fHB7w0KyXasZRoRGHR3dJkLGpfOKbdxOu55m/W/3lViQoEHo3v8dxJudfYNU X-Received: by 2002:a05:6e02:2144:: with SMTP id d4mr803649ilv.250.1632209053713; Tue, 21 Sep 2021 00:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632209053; cv=none; d=google.com; s=arc-20160816; b=MtdH5qwct0Nf5m0nV9bYLho3D4oAqsvmWwFo+I8MMwJrd+3TLUzorp9QGemRixkoum TBuoWe8HVSm0mW0bbKIBTZrP5n4j2XChQoc3DOHUqs9lU6qsa13lTltJLU9Bk6cwoWhP EIzWWalNlfrNVNmR7+NNsQNiZT2fiEQYRPXvH2TvjMhIVus6qBNiAwnO8GpkOcIEtbOU xIYvgZNv7ypc0Qon4jbkwBpXr/mRMnKI3hqNvMqzliMNeF8sWZjMREryzPeojH+MlXY3 jJjK00np+WbMzrfxoOJVK1DQSQZGNTCveygEnVhttE4PGPMHfIeRR8ZtABa7MTsN94C5 sb0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=olV+aV1KZLqoLJrQaMwZwQ/lt1n9RpnReKW7wGQJSVo=; b=cx4q4NE0DEEKlEwxI/UDgiC2JGwc6sTvZ1xgdw6v0C0I2qAP5Ua9yONojnmO5Vq3Ax 72/IyGqx+2LQ1p+DASrjiQSNU+Z6VkjbINo3Po1TbOWp6uTY+2QoEoAw3oG9jx659Omi +S9rA7OB4XpYR+6K9jiShdF0xMpW6CXYeE7rVYKM/7kDfnJ/ecCm5vA6Df4/A8gNO85t C/GQzGnw5UAsuxv+Y7IJef34VST+U3SZaYT2uj3Ggx6UkLRFe+S87cLaUIVZme2LAzZu TAu9Yb0u3zTnYqF3pVKO3/eNe92nUXfAxUu6x+Kz3Es8JhuL2lHG9uk0do0TlM1ci6Ee Yp9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si6486980ilg.117.2021.09.21.00.24.02; Tue, 21 Sep 2021 00:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbhIUHXU (ORCPT + 99 others); Tue, 21 Sep 2021 03:23:20 -0400 Received: from mail.bytesnap.co.uk ([94.198.185.106]:27896 "EHLO exch2016.bytesnap.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230157AbhIUHXT (ORCPT ); Tue, 21 Sep 2021 03:23:19 -0400 Received: from villeb-dev.ByteSnap.local ([10.0.27.55]) by exch2016.bytesnap.co.uk with XWall v3.57 ; Tue, 21 Sep 2021 08:21:50 +0100 From: Ville Baillie To: Tudor Ambarus , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches Cc: Ville Baillie , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] spi: atmel: Fix PDC transfer setup bug Date: Tue, 21 Sep 2021 07:21:32 +0000 Message-Id: <20210921072132.21831-1-villeb@bytesnap.co.uk> X-Mailer: git-send-email 2.17.1 X-XWALL-BCKS: auto Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 5fa5e6dec762 ("spi: atmel: Switch to transfer_one transfer method") refactored the code and changed a conditional causing atmel_spi_dma_map_xfer to never be called in PDC mode. This causes the driver to silently fail. This patch changes the conditional to match the behaviour of the previous commit before the refactor. Signed-off-by: Ville Baillie --- drivers/spi/spi-atmel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 788dcdf25f00..f872cf196c2f 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1301,7 +1301,7 @@ static int atmel_spi_one_transfer(struct spi_master *master, * DMA map early, for performance (empties dcache ASAP) and * better fault reporting. */ - if ((!master->cur_msg_mapped) + if ((!master->cur_msg->is_dma_mapped) && as->use_pdc) { if (atmel_spi_dma_map_xfer(as, xfer) < 0) return -ENOMEM; @@ -1381,7 +1381,7 @@ static int atmel_spi_one_transfer(struct spi_master *master, } } - if (!master->cur_msg_mapped + if (!master->cur_msg->is_dma_mapped && as->use_pdc) atmel_spi_dma_unmap_xfer(master, xfer); -- 2.17.1