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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6934C433F5 for ; Mon, 20 Sep 2021 14:31:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8657D61077 for ; Mon, 20 Sep 2021 14:31:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232023AbhITOdN convert rfc822-to-8bit (ORCPT ); Mon, 20 Sep 2021 10:33:13 -0400 Received: from mail.bytesnap.co.uk ([94.198.185.106]:45047 "EHLO mail.bytesnap.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbhITOdN (ORCPT ); Mon, 20 Sep 2021 10:33:13 -0400 Received: from exch2016.ByteSnap.local (10.0.28.253) by exch2016.ByteSnap.local (10.0.28.253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Mon, 20 Sep 2021 15:31:44 +0100 Received: from exch2016.ByteSnap.local ([fe80::fccc:6d14:b55e:d5a0]) by exch2016.ByteSnap.local ([fe80::fccc:6d14:b55e:d5a0%8]) with mapi id 15.01.2308.014; Mon, 20 Sep 2021 15:31:44 +0100 From: Ville Baillie To: "tudor.ambarus@microchip.com" , "broonie@kernel.org" , "nicolas.ferre@microchip.com" , "alexandre.belloni@bootlin.com" , "ludovic.desroches@microchip.com" CC: "linux-spi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "dan.sneddon@microchip.com" , Ville Baillie Subject: RE: [PATCH v3] spi: atmel: Fix PDC transfer setup bug Thread-Topic: [PATCH v3] spi: atmel: Fix PDC transfer setup bug Thread-Index: AdeuLBk8YnhgPjL7Rzy2vzFY84KgkA== Date: Mon, 20 Sep 2021 14:31:44 +0000 Message-ID: <60f0c65bbd52479cb83683b8475af435@bytesnap.co.uk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.27.202] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org >From 626b32a8db5b1904b0f0f7781e2375b2fd17a497 Mon Sep 17 00:00:00 2001 From: Ville Baillie Date: Thu, 16 Sep 2021 14:16:46 +0000 Subject: [PATCH v3] spi: atmel: Fix PDC transfer setup bug 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