From patchwork Thu Sep 16 15:16:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ville Baillie X-Patchwork-Id: 12499361 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 D2F4EC433F5 for ; Thu, 16 Sep 2021 15:19:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99F2860F4A for ; Thu, 16 Sep 2021 15:19:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 99F2860F4A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bytesnap.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u41TQhe1DAqU63FFNVq2HlZGmsVUBa47EVRIZzyqxY4=; b=CmLyu+8RbHYGja YWX8DqYrUZP7K/U7hE+niJSGbLdmkMCRXTk/PYM4Q5nIvuhTnJmXrIIp622FlpzLJ6i24W0L4gxtz DGFYEITvIONU3gkbFBtJ03Ett/gMq0xNCQvu08jewtj2jEYi/gB2NalDf04bOqxZPzdRawWVIWCgF IYu7rBjf1xb7O12LlLc2JEcLgCqjhnjxjQOVDoKvIMuB94Pm39Wc5XREbJBE8HiX4elcGrXW5X4oB o/sirtNF9rrAdPyE5QOvaww/PQJMCADH/EOU2xbmbzkD7iFGpDpSM3Wi5PFL7txzAr7YFbdg8p/cf 4RIHf4f8HWXy9p9svKXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQt7w-00BQTz-3A; Thu, 16 Sep 2021 15:16:40 +0000 Received: from mail.bytesnap.co.uk ([94.198.185.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQt7s-00BQTb-VJ for linux-arm-kernel@lists.infradead.org; Thu, 16 Sep 2021 15:16:38 +0000 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; Thu, 16 Sep 2021 16:16:31 +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; Thu, 16 Sep 2021 16:16:31 +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: [PATCH] spi: atmel: Fix PDC transfer setup bug Thread-Topic: [PATCH] spi: atmel: Fix PDC transfer setup bug Thread-Index: AderDWrzqf5xpvNgRsOaMaLInBknhQ== Date: Thu, 16 Sep 2021 15:16:31 +0000 Message-ID: <3804cb61226e433fb1f7cde911a2785a@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] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210916_081637_049509_3756E319 X-CRM114-Status: GOOD ( 13.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From 614bcf515cc8dbd1b7573a2fbf369fc84fca0501 Mon Sep 17 00:00:00 2001 From: Ville Baillie Date: Thu, 16 Sep 2021 14:16:46 +0000 Subject: [PATCH] spi: atmel: Fix PDC transfer setup bug Commit d370f4b2808d ("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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 788dcdf25f00..f00e9c9b426e 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;