From patchwork Thu Oct 1 15:21:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 267039 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 D5C44C47420 for ; Thu, 1 Oct 2020 15:23:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A233A20672 for ; Thu, 1 Oct 2020 15:23:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="j8KQVKiT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732610AbgJAPWt (ORCPT ); Thu, 1 Oct 2020 11:22:49 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40825 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732563AbgJAPWs (ORCPT ); Thu, 1 Oct 2020 11:22:48 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152247euoutp01c8ee2a368367329237b658fc534bafa5~555R5z6Tq2734527345euoutp01B for ; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201001152247euoutp01c8ee2a368367329237b658fc534bafa5~555R5z6Tq2734527345euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565767; bh=BzRv9HJb8VaLbApMv1Dmlo0K8h3v8k5w87oec/cJk9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8KQVKiTtz1A3cik9vmEwSiDfPx+0BY/sNQSxsgcjwKJgFQRLAueuiqQczFJVhm+t wLhCHkBY5k1d32Ymh7d0tpLQr9EraWzkQSR5eapaFlN5d/2+zXFNw1Gxc8BRZl8Bbx rT1/Wtc+IHEZOKzYYf6JEH1BP3qpJ/B69BheqMxw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152246eucas1p2b7cb48c0444b0d6205f7e39ca90f4e08~555RhktW31941319413eucas1p2C; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 66.2F.06456.644F57F5; Thu, 1 Oct 2020 16:22:46 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152246eucas1p1b4155ab4f06a39cc88f205b4a7cd47f9~555RM524D1726917269eucas1p1R; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152246eusmtrp1a47e25d5e19d404120af06da9ae4192f~555RMHHyf2671526715eusmtrp1h; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-43-5f75f446f3bf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E3.D5.06017.644F57F5; Thu, 1 Oct 2020 16:22:46 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152246eusmtip2756b8b5264661f95b4e9dd99b220fe8b~555RCdfgq0103301033eusmtip25; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath() Date: Thu, 1 Oct 2020 17:21:40 +0200 Message-Id: <20201001152148.29747-2-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNKsWRmVeSWpSXmKPExsWy7djP87puX0rjDX7+MrdY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yW6za9YfR gcfj+pJPzB47Z91l99i0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DKeHI2p+Ap e0XLm2usDYx72boYOTkkBEwkXk/bB2RzcQgJrGCUmPvqKguE84VR4tS3KcwQzmdGiZ8/prPC tHw71QKVWM4oMW3SdXYI5zmjxLfGuYwgVWwCjhL9S0+wgiREBLYzSUz8fJ4FJMEsUCrRs/MQ 2HZhgSyJey9fg9ksAqoS83uWMIHYvALWEk2nbjFDrJOXaF++HayGU8BG4tzEw2wQNYISJ2c+ AZvJL6AlsabpOtR8eYnmrbPBzpMQuMcucWjFByaIQS4SN452Q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pXnpesn5uZsYgRG57djP LTsYu94FH2IU4GBU4uEVOFAaL8SaWFZcmXuIUYKDWUmE1+ns6Tgh3pTEyqrUovz4otKc1OJD jKZAb05klhJNzgcmi7ySeENTQ3MLS0NzY3NjMwslcd4OgYMxQgLpiSWp2ampBalFMH1MHJxS DYxr5+xZlKy4N+71D3GDJefDkvN4/0js27TlanJp3bY3NcaLb3NO1ZJW9j/bbdxeuuTYiqea WQuD8nYd6z7UzD9nrhr3rJB/y7SW7dizqKajz/Vo9XfVvYwvjgg8TfHjiRN9X+/9h22GT1Py o42rrki02qu5fzH0XVJ7/sGh+Yu3bHD04fxwu3aHEktxRqKhFnNRcSIALolJXd4CAAA= X-CMS-MailID: 20201001152246eucas1p1b4155ab4f06a39cc88f205b4a7cd47f9 X-Msg-Generator: CA X-RootMTR: 20201001152246eucas1p1b4155ab4f06a39cc88f205b4a7cd47f9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152246eucas1p1b4155ab4f06a39cc88f205b4a7cd47f9 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on Exynos3250. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 924b24441789..26c7cb79cd78 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -685,11 +685,11 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, sdd->state &= ~RXBUSY; sdd->state &= ~TXBUSY; - s3c64xx_enable_datapath(sdd, xfer, use_dma); - /* Start the signals */ s3c64xx_spi_set_cs(spi, true); + s3c64xx_enable_datapath(sdd, xfer, use_dma); + spin_unlock_irqrestore(&sdd->lock, flags); if (use_dma) From patchwork Thu Oct 1 15:21:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 257117 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 409DFC47420 for ; Thu, 1 Oct 2020 15:23:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08C5D20672 for ; Thu, 1 Oct 2020 15:23:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="QvQl2EKv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732691AbgJAPWv (ORCPT ); Thu, 1 Oct 2020 11:22:51 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41163 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732588AbgJAPWu (ORCPT ); Thu, 1 Oct 2020 11:22:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152247euoutp028969528ad25d893d2f71f865eee72e98~555SSIPp52406624066euoutp02M for ; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152247euoutp028969528ad25d893d2f71f865eee72e98~555SSIPp52406624066euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565767; bh=NVNjGrE9vr/guygdPxlaMnYBop/HI2z2S3vR10IzuAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvQl2EKvZtR8PKpbE4qe5O9IYCbC/ATe5JeFiv1+eDg131EABmkpicDmZY1j8EzBH B6mHGUl6V0Ted261WvmEN0VnGyOIm6CPzSkIkpj6CALEMTFy/yLWy2MXW9yEiknlKu aOThnfj7xJn10pq7ufHB9BvNoV5wcA2AnhcxezF0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152247eucas1p2d0abdd77d7f2bf0700485d6bef62a965~555R0lvLb1942719427eucas1p2D; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 1C.EC.06318.744F57F5; Thu, 1 Oct 2020 16:22:47 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201001152246eucas1p2fb22ab55c276d76c4508142842c90ab8~555RhXwJv2407924079eucas1p2G; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201001152246eusmtrp231fc89d4e2d3b9d29335647b6206df2a~555RgJmmH3010130101eusmtrp2P; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-9a-5f75f447e2a4 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 60.A5.06314.644F57F5; Thu, 1 Oct 2020 16:22:46 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152246eusmtip27567bf4ee78a026fc47809313be6e230~555RXVCPs0082600826eusmtip28; Thu, 1 Oct 2020 15:22:46 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 2/9] spi: spi-s3s64xx: Add S3C64XX_SPI_QUIRK_CS_AUTO for Exynos3250 Date: Thu, 1 Oct 2020 17:21:41 +0200 Message-Id: <20201001152148.29747-3-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFKsWRmVeSWpSXmKPExsWy7djPc7ruX0rjDb4sFLRY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yW6za9YfR gcfj+pJPzB47Z91l99i0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DK2PLtPXvB DraKgz+fszYwbmLtYuTkkBAwkTh9ZAuQzcUhJLCCUeJc9wwo5wujxPKO6ywQzmdGid1PNjDD tCyYMIUdIrGcUeLvt0VsEM5zRonW/beZQKrYBBwl+peeAJslIrCdSWLi5/MsIAlmgVKJnp2H 2EBsYYF4ic29m4HiHBwsAqoSz9+bgYR5Bawl+o5sgdomL9G+fDtYOaeAjc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F+nhBImF9AS2JN03Wo rfISzVtnM09gFJqFpGMWQscsJFULGJlXMYqklhbnpucWG+oVJ+YWl+al6yXn525iBEbktmM/ N+9gvLQx+BCjAAejEg+vwIHSeCHWxLLiytxDjBIczEoivE5nT8cJ8aYkVlalFuXHF5XmpBYf YjQF+nIis5Rocj4wWeSVxBuaGppbWBqaG5sbm1koifN2CByMERJITyxJzU5NLUgtgulj4uCU amAsXeFgOTcrUOmsYHXaovd6MmI5qtOfxdrzpLFvenm/PJvXaNERLkfHia3Kf14e3BCVpfCs 0zHultVP790JJROnmM+9/XFlcDNvVfuueYuMla5Hux9XcXsxeblQUmNN+VLp5HcPSmcpRd1V cd94wzr/ZjOPhv8cjZ1q0z0U7rv2JtnlLp4lEqTEUpyRaKjFXFScCAAx+xko3gIAAA== X-CMS-MailID: 20201001152246eucas1p2fb22ab55c276d76c4508142842c90ab8 X-Msg-Generator: CA X-RootMTR: 20201001152246eucas1p2fb22ab55c276d76c4508142842c90ab8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152246eucas1p2fb22ab55c276d76c4508142842c90ab8 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail. The vendor kernel for ARTIK5 handles CS in a simmilar way. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 26c7cb79cd78..22bf8c75580a 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1379,6 +1379,7 @@ static struct s3c64xx_spi_port_config exynos4_spi_port_config = { .tx_st_done = 25, .high_speed = true, .clk_from_cmu = true, + .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, }; static struct s3c64xx_spi_port_config exynos7_spi_port_config = { From patchwork Thu Oct 1 15:21:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 257119 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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT 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 69A20C4741F for ; Thu, 1 Oct 2020 15:22:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 166F3221F0 for ; Thu, 1 Oct 2020 15:22:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="tfiWrU6w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732694AbgJAPWv (ORCPT ); Thu, 1 Oct 2020 11:22:51 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41174 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732622AbgJAPWu (ORCPT ); Thu, 1 Oct 2020 11:22:50 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152248euoutp02c9290c20bb15174a81103f9f7d5a2c31~555S0d7ZW2406624066euoutp02O for ; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152248euoutp02c9290c20bb15174a81103f9f7d5a2c31~555S0d7ZW2406624066euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565768; bh=ZPDdKXrWSOpD0gqlEEMqVBHjyee2s4wL5xY64uskRHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tfiWrU6wJitgeU3KlwinvNklhFaIa93k44q7kvARnBpeV14i4+/aLfUHiOOlzD/fw B/2oBsVQ5W6WR1u5qRNdGoTIzUnKtAA1GHS09i00WS4E2R+tpSMBwFDSrH3JH29KIK iKj7oNAeSBRjD32p+jG+Pp3dhqueWgazZw3dosQQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201001152247eucas1p10ab190c72b4121e816dd78ae507aa854~555SODJSr1727717277eucas1p10; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 29.29.05997.744F57F5; Thu, 1 Oct 2020 16:22:47 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201001152247eucas1p2b6b1cc61b9b175b0a621609cd58effbd~555R35PWp0234802348eucas1p2w; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152247eusmtrp10699e8a6e029508c8fc9c49893535e15~555R3PFr_2671526715eusmtrp1j; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-52-5f75f44706c4 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 61.A5.06314.744F57F5; Thu, 1 Oct 2020 16:22:47 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152247eusmtip213a4aa992176591bd792eeffd552a52f~555RsLrr-0513205132eusmtip2T; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 3/9] spi: spi-s3c64xx: Check return values Date: Thu, 1 Oct 2020 17:21:42 +0200 Message-Id: <20201001152148.29747-4-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDKsWRmVeSWpSXmKPExsWy7djPc7ruX0rjDbav1bJY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yW6za9YfR gcfj+pJPzB47Z91l99i0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DKmLh0GVvB b42KpQsvMDUwrlXsYuTkkBAwkbi06Bx7FyMXh5DACkaJNS+3sUI4XxgljsyYDuV8ZpSY0zOb Ba7lezsLRGI5o8T5lkVQ/c8ZJTZNb2AGqWITcJToX3oCrF1EYDuTxMTP58HamQVKJXp2HmID sYUFXCSWPLsDFmcRUJU4/WwdE4jNK2AtcftVIxvEOnmJ9uXbwWxOARuJcxMPs0HUCEqcnPkE rJdfQEtiTdN1qPnyEs1b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zkHTMQuiYhaRqASPzKkaR1NLi3PTcYkO94sTc4tK8dL3k/NxNjMCY3Hbs5+Yd jJc2Bh9iFOBgVOLhFThQGi/EmlhWXJl7iFGCg1lJhNfp7Ok4Id6UxMqq1KL8+KLSnNTiQ4ym QG9OZJYSTc4Hpou8knhDU0NzC0tDc2NzYzMLJXHeDoGDMUIC6YklqdmpqQWpRTB9TBycUg2M Jqwd/cs2iD51KHq3yOLei9Dqmbf0dhzRuHMgWsa3PWVqRIrROv27Hqt1/gape7Ddnu3445mt V0bB5+mK+f2+e3Kv/liutCVqwk5F1/UZDEXZKh/LdN6fSl185MXTj7fP1Fs9+f9HZlGSx8+9 +h6djU+2/X7i3J3mEMxumff5AxO7qs3CMuYJSizFGYmGWsxFxYkAr+VeSt8CAAA= X-CMS-MailID: 20201001152247eucas1p2b6b1cc61b9b175b0a621609cd58effbd X-Msg-Generator: CA X-RootMTR: 20201001152247eucas1p2b6b1cc61b9b175b0a621609cd58effbd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152247eucas1p2b6b1cc61b9b175b0a621609cd58effbd References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Check return values in prepare_dma() and s3c64xx_spi_config() and propagate errors upwards. Fixes: 788437273fa8 ("spi: s3c64xx: move to generic dmaengine API") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 50 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 22bf8c75580a..f7482f2f1e13 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -122,6 +122,7 @@ struct s3c64xx_spi_dma_data { struct dma_chan *ch; + dma_cookie_t cookie; enum dma_transfer_direction direction; }; @@ -271,12 +272,13 @@ static void s3c64xx_spi_dmacb(void *data) spin_unlock_irqrestore(&sdd->lock, flags); } -static void prepare_dma(struct s3c64xx_spi_dma_data *dma, +static int prepare_dma(struct s3c64xx_spi_dma_data *dma, struct sg_table *sgt) { struct s3c64xx_spi_driver_data *sdd; struct dma_slave_config config; struct dma_async_tx_descriptor *desc; + int ret; memset(&config, 0, sizeof(config)); @@ -300,12 +302,24 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT); + if (!desc) { + dev_err(&sdd->pdev->dev, "unable to prepare %s scatterlist", + dma->direction == DMA_DEV_TO_MEM ? "rx" : "tx"); + return -ENOMEM; + } desc->callback = s3c64xx_spi_dmacb; desc->callback_param = dma; - dmaengine_submit(desc); + dma->cookie = dmaengine_submit(desc); + ret = dma_submit_error(dma->cookie); + if (ret) { + dev_err(&sdd->pdev->dev, "DMA submission failed"); + return -EIO; + } + dma_async_issue_pending(dma->ch); + return 0; } static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable) @@ -355,11 +369,12 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master, return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1; } -static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, +static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, struct spi_transfer *xfer, int dma_mode) { void __iomem *regs = sdd->regs; u32 modecfg, chcfg; + int ret = 0; modecfg = readl(regs + S3C64XX_SPI_MODE_CFG); modecfg &= ~(S3C64XX_SPI_MODE_TXDMA_ON | S3C64XX_SPI_MODE_RXDMA_ON); @@ -385,7 +400,7 @@ static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, chcfg |= S3C64XX_SPI_CH_TXCH_ON; if (dma_mode) { modecfg |= S3C64XX_SPI_MODE_TXDMA_ON; - prepare_dma(&sdd->tx_dma, &xfer->tx_sg); + ret = prepare_dma(&sdd->tx_dma, &xfer->tx_sg); } else { switch (sdd->cur_bpw) { case 32: @@ -417,12 +432,17 @@ static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, writel(((xfer->len * 8 / sdd->cur_bpw) & 0xffff) | S3C64XX_SPI_PACKET_CNT_EN, regs + S3C64XX_SPI_PACKET_CNT); - prepare_dma(&sdd->rx_dma, &xfer->rx_sg); + ret = prepare_dma(&sdd->rx_dma, &xfer->rx_sg); } } + if (ret) + return ret; + writel(modecfg, regs + S3C64XX_SPI_MODE_CFG); writel(chcfg, regs + S3C64XX_SPI_CH_CFG); + + return 0; } static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd, @@ -555,9 +575,10 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, return 0; } -static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) +static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) { void __iomem *regs = sdd->regs; + int ret; u32 val; /* Disable Clock */ @@ -605,7 +626,9 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) if (sdd->port_conf->clk_from_cmu) { /* The src_clk clock is divided internally by 2 */ - clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); + ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); + if (ret) + return ret; } else { /* Configure Clock */ val = readl(regs + S3C64XX_SPI_CLK_CFG); @@ -619,6 +642,8 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) val |= S3C64XX_SPI_ENCLK_ENABLE; writel(val, regs + S3C64XX_SPI_CLK_CFG); } + + return 0; } #define XFER_DMAADDR_INVALID DMA_BIT_MASK(32) @@ -661,7 +686,9 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, sdd->cur_bpw = bpw; sdd->cur_speed = speed; sdd->cur_mode = spi->mode; - s3c64xx_spi_config(sdd); + status = s3c64xx_spi_config(sdd); + if (status) + return status; } if (!is_polling(sdd) && (xfer->len > fifo_len) && @@ -688,10 +715,15 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, /* Start the signals */ s3c64xx_spi_set_cs(spi, true); - s3c64xx_enable_datapath(sdd, xfer, use_dma); + status = s3c64xx_enable_datapath(sdd, xfer, use_dma); spin_unlock_irqrestore(&sdd->lock, flags); + if (status) { + dev_err(&spi->dev, "failed to enable data path for transfer: %d\n", status); + break; + } + if (use_dma) status = s3c64xx_wait_for_dma(sdd, xfer); else From patchwork Thu Oct 1 15:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 257116 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 1CBBCC47427 for ; Thu, 1 Oct 2020 15:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0A0820719 for ; Thu, 1 Oct 2020 15:23:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="f+OjS8rM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732684AbgJAPWu (ORCPT ); Thu, 1 Oct 2020 11:22:50 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41177 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732555AbgJAPWt (ORCPT ); Thu, 1 Oct 2020 11:22:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152248euoutp028e9f5652efe58003bf5d6b633a15498a~555TFv_sQ2406624066euoutp02P for ; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152248euoutp028e9f5652efe58003bf5d6b633a15498a~555TFv_sQ2406624066euoutp02P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565768; bh=Rv21L8gszpO5by2jlyKs6+bspQDGl/g+ezAY1QP7hmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+OjS8rM3GU5zQhxzR+dczmMRHuhfLmykQTw8K5jqJwXTZhjghVp2eYtBUBvhFyVe j+8YVgMqfHGM6d6o5BKIy8yG55XzhoamaVzF6TZncloRg34iT/53N49rsbZCkSQDpn +kWX63vaNqjbnUjaaXPb6vq0nnpCbF8mHFexFOsc= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152248eucas1p2f9a090b2e102c60b6fca9a5a7e238bdb~555SpMVon0243902439eucas1p2r; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 37.2F.06456.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201001152247eucas1p2afff5b5b73f78d7c5111ac1c800e718a~555SRLhsW2407924079eucas1p2H; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152247eusmtrp17da508423efebc6111439d94e089926e~555SQj2xH2671626716eusmtrp1f; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-45-5f75f448300d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 25.D5.06017.744F57F5; Thu, 1 Oct 2020 16:22:47 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152247eusmtip2a59a8e0502d96f5b43cf74ad7456662f~555SGTk_s0103301033eusmtip26; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 4/9] spi: spi-s3c64xx: Report more information when errors occur Date: Thu, 1 Oct 2020 17:21:43 +0200 Message-Id: <20201001152148.29747-5-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUgTYRjv3W1353D2tgQf7EMYFWRljfVxkX0YQROC6t+o1qrDWW7ari2N IE3ItJVNkWwOLK1co+Uy29Qi8YqsJBcp6UwlsVqWC0ojC8223SL/+73P7+t54KUJeYskkc40 HGeNBm2WgpSKPU9/da5Qj5s0qz68oJnaiYCIuVtZL2Eqht6TTOnwF4Lx+dwU4+cdiGkYfiNh ulrsJFPpeyRiCr75K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lFHidPcJIIcDKCElsXJuOkSNsMSfa11sEDVPGSUmL2tlAkmwCThK9C89 wQqSEBHYzyRx6cJ9FpAEs0C5xKVZz9lBBgkLREn8vugOEmYRUJW49OANWC+vgLXEjp57LBAL 5CXal29nA7E5BWwkzk08DGYLCeRK7N59lA2iXlDi5MwnYLcxC6hLrJ8nBBLmF9CSWNN0HWqr vETz1tnMExiFZiHpmIXQMQtJ1QJG5lWMIqmlxbnpucVGesWJucWleel6yfm5mxiBEbnt2M8t Oxi73gUfYhTgYFTi4RU4UBovxJpYVlyZe4hRgoNZSYTX6ezpOCHelMTKqtSi/Pii0pzU4kOM pkBvTmSWEk3OByaLvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFIN jFVNv7w9PX6cfa3i8Cvgu6qUzlRLhSpll5/1qcz/d4ZX1VqWrMvWn2Z+2ENhes42rkt1ccpW y5ZYfp40I1o3RcMgz+biBnWJzTee/bu+TYIh9sESUcuvXgJ7nwnKVyUtU/u2mv2J7TSbPuuO fLcHq45kMzqohtyoFix9JXz+Ttus5WsiMu+wK7EUZyQaajEXFScCAIhNVlHeAgAA X-CMS-MailID: 20201001152247eucas1p2afff5b5b73f78d7c5111ac1c800e718a X-Msg-Generator: CA X-RootMTR: 20201001152247eucas1p2afff5b5b73f78d7c5111ac1c800e718a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152247eucas1p2afff5b5b73f78d7c5111ac1c800e718a References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Report amount of pending data when a transfer stops due to errors. Report if DMA was used to transfer data and print the status code. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index f7482f2f1e13..5be6f2484e86 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -731,17 +731,28 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, if (status) { dev_err(&spi->dev, - "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n", + "I/O Error: rx-%d tx-%d rx-%c tx-%c len-%d dma-%d res-(%d)\n", xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0, (sdd->state & RXBUSY) ? 'f' : 'p', (sdd->state & TXBUSY) ? 'f' : 'p', - xfer->len); + xfer->len, use_dma ? 1 : 0, status); if (use_dma) { - if (xfer->tx_buf && (sdd->state & TXBUSY)) + struct dma_tx_state s; + + if (xfer->tx_buf && (sdd->state & TXBUSY)) { + dmaengine_pause(sdd->tx_dma.ch); + dmaengine_tx_status(sdd->tx_dma.ch, sdd->tx_dma.cookie, &s); dmaengine_terminate_all(sdd->tx_dma.ch); - if (xfer->rx_buf && (sdd->state & RXBUSY)) + dev_err(&spi->dev, "TX residue: %d\n", s.residue); + + } + if (xfer->rx_buf && (sdd->state & RXBUSY)) { + dmaengine_pause(sdd->rx_dma.ch); + dmaengine_tx_status(sdd->rx_dma.ch, sdd->rx_dma.cookie, &s); dmaengine_terminate_all(sdd->rx_dma.ch); + dev_err(&spi->dev, "RX residue: %d\n", s.residue); + } } } else { s3c64xx_flush_fifo(sdd); From patchwork Thu Oct 1 15:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 267042 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 ABA86C4727C for ; Thu, 1 Oct 2020 15:23:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F56E21D24 for ; Thu, 1 Oct 2020 15:23:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="TdEjeD3j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732700AbgJAPWw (ORCPT ); Thu, 1 Oct 2020 11:22:52 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41185 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732546AbgJAPWu (ORCPT ); Thu, 1 Oct 2020 11:22:50 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152249euoutp0254241581030924af840ec1b86f2a78ad~555TduTqA2409324093euoutp02I for ; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152249euoutp0254241581030924af840ec1b86f2a78ad~555TduTqA2409324093euoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565769; bh=F7lc4bNVQrq/uJ6QtYI8r7CnZWm8NNaS58UeBeaW5GA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TdEjeD3jrkSZkfjNzkdjaShGnyI65qnBJaZ0hWpwfeT8c3KaqxrD8XkTsE23waNKP GGZSRcYnT5SHDWwaMv1pLILCWBkLNtyAWSW/WC47a5U0cfYLLNAW9/uo/gMkEd22co D7RZCNFXWNzoVHG0pDPQVIDjSpMfyvdsYLysAi7w= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152248eucas1p26c9e10839bf9cae4f295f353ee4f7c6c~555TIEhlr1941319413eucas1p2E; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5D.EC.06318.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eucas1p10219600aaa0df6e030d2493b2aefbe92~555SpEBmC1729617296eucas1p1i; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152248eusmtrp116d2e24d4c7abc58e47a58a225c1c159~555Sofy2m2671526715eusmtrp1l; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-9f-5f75f448a878 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F5.D5.06017.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152247eusmtip28e692c3e7a775c4fbd1a34263ac75ea4~555SbCl7k0513205132eusmtip2U; Thu, 1 Oct 2020 15:22:47 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 5/9] spi: spi-s3c64xx: Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* Date: Thu, 1 Oct 2020 17:21:44 +0200 Message-Id: <20201001152148.29747-6-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBKsWRmVeSWpSXmKPExsWy7djPc7oeX0rjDY4vUbVY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yW6za9YfR gcfj+pJPzB47Z91l99i0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DK+LxnE2PB etGK9ctvsDUwPhfsYuTkkBAwkVj68QlrFyMXh5DACkaJ8/dvskM4XxglJn58wAbhfGaU+PVq HTNMy7lF06ASyxklzm5fwwLhPGeUON18mh2kik3AUaJ/6QmwwSIC25kkJn4+zwKSYBYolejZ eQionYNDWCBR4ulVPxCTRUBVYs0eQ5AKXgFriQkfLrFBLJOXaF++HczmFLCRODfxMBtEjaDE yZlPwCbyC2hJrGm6DjVdXqJ562yoQ++xS/S3eICMlxBwkWj9VgMRFpZ4dXwLO4QtI3F6cg8L REm9xORJZiAHSwj0MEpsm/ODBaLGWuLOuV9gBzMLaEqs36UPEXaUeNu2hRWilU/ixltBiAP4 JCZtm84MEeaV6GgTgqhWkVjXvwdqoJRE76sVjBMYlWYheWUWkvNnIexawMi8ilE8tbQ4Nz21 2DgvtVyvODG3uDQvXS85P3cTIzA9nf53/OsOxn1/kg4xCnAwKvHwZhwqjRdiTSwrrsw9xCjB wawkwut09nScEG9KYmVValF+fFFpTmrxIUZpDhYlcV7jRS9jhQTSE0tSs1NTC1KLY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MXbZHMz/2njPL 5E2HeeLWy6b6TV+9qc9y/e6O2Sfrd+jKeM0RPH9IiaU4I9FQi7moOBEA9MK/p94CAAA= X-CMS-MailID: 20201001152248eucas1p10219600aaa0df6e030d2493b2aefbe92 X-Msg-Generator: CA X-RootMTR: 20201001152248eucas1p10219600aaa0df6e030d2493b2aefbe92 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152248eucas1p10219600aaa0df6e030d2493b2aefbe92 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* to match documentation. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 5be6f2484e86..adc5593ca2ca 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -29,7 +29,7 @@ #define S3C64XX_SPI_CH_CFG 0x00 #define S3C64XX_SPI_CLK_CFG 0x04 #define S3C64XX_SPI_MODE_CFG 0x08 -#define S3C64XX_SPI_SLAVE_SEL 0x0C +#define S3C64XX_SPI_CS_REG 0x0C #define S3C64XX_SPI_INT_EN 0x10 #define S3C64XX_SPI_STATUS 0x14 #define S3C64XX_SPI_TX_DATA 0x18 @@ -64,9 +64,9 @@ #define S3C64XX_SPI_MODE_TXDMA_ON (1<<1) #define S3C64XX_SPI_MODE_4BURST (1<<0) -#define S3C64XX_SPI_SLAVE_AUTO (1<<1) -#define S3C64XX_SPI_SLAVE_SIG_INACT (1<<0) -#define S3C64XX_SPI_SLAVE_NSC_CNT_2 (2<<4) +#define S3C64XX_SPI_CS_NSC_CNT_2 (2<<4) +#define S3C64XX_SPI_CS_AUTO (1<<1) +#define S3C64XX_SPI_CS_SIG_INACT (1<<0) #define S3C64XX_SPI_INT_TRAILING_EN (1<<6) #define S3C64XX_SPI_INT_RX_OVERRUN_EN (1<<5) @@ -332,18 +332,18 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable) if (enable) { if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) { - writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); + writel(0, sdd->regs + S3C64XX_SPI_CS_REG); } else { - u32 ssel = readl(sdd->regs + S3C64XX_SPI_SLAVE_SEL); + u32 ssel = readl(sdd->regs + S3C64XX_SPI_CS_REG); - ssel |= (S3C64XX_SPI_SLAVE_AUTO | - S3C64XX_SPI_SLAVE_NSC_CNT_2); - writel(ssel, sdd->regs + S3C64XX_SPI_SLAVE_SEL); + ssel |= (S3C64XX_SPI_CS_AUTO | + S3C64XX_SPI_CS_NSC_CNT_2); + writel(ssel, sdd->regs + S3C64XX_SPI_CS_REG); } } else { if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) - writel(S3C64XX_SPI_SLAVE_SIG_INACT, - sdd->regs + S3C64XX_SPI_SLAVE_SEL); + writel(S3C64XX_SPI_CS_SIG_INACT, + sdd->regs + S3C64XX_SPI_CS_REG); } } @@ -982,9 +982,9 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd) sdd->cur_speed = 0; if (sci->no_cs) - writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); + writel(0, sdd->regs + S3C64XX_SPI_CS_REG); else if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) - writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); + writel(S3C64XX_SPI_CS_SIG_INACT, sdd->regs + S3C64XX_SPI_CS_REG); /* Disable Interrupts - we use Polling if not DMA mode */ writel(0, regs + S3C64XX_SPI_INT_EN); From patchwork Thu Oct 1 15:21:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 267040 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 B508CC4727E for ; Thu, 1 Oct 2020 15:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81C3620672 for ; Thu, 1 Oct 2020 15:23:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="RKBban36" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732535AbgJAPXO (ORCPT ); Thu, 1 Oct 2020 11:23:14 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41194 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732665AbgJAPWu (ORCPT ); Thu, 1 Oct 2020 11:22:50 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152249euoutp022f5f33aac8bb6fea1cdbed6025f8eca8~555TsjHFH2406624066euoutp02S for ; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152249euoutp022f5f33aac8bb6fea1cdbed6025f8eca8~555TsjHFH2406624066euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565769; bh=AZIlVNZBDC5UKC2U+MQYh+ihNhSv5nvwrR6mp6tepnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKBban36JBWJcH5pF1v0tjw6go1/YjgrXvkuMCoyCM6YMxe2W76DvJ6gJgDD2Av9A Q9CgsgC26i6xTtJ9eXvY1spnv8phW2hkcw4vkdGCCPtTEWxs9CJB96+fO8Gkq9lNIU UhwC3QQep9H1UTntDTFBiIUvfuDFWISmgmwVQ25Q= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152248eucas1p2213b2031a69ccb396971b66f93e6c2d3~555TT_Y_F0232902329eucas1p23; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 48.2F.06456.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eucas1p12f71c21a5873b6360e4b38efebb50271~555S6nGU51512815128eucas1p12; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152248eusmtrp166a327d93742a07c0d33a3026ff47b89~555S5_yF72671526715eusmtrp1m; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-48-5f75f4484103 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C6.D5.06017.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eusmtip1429f6811b3c967fc29871e4ec193a309~555Sv20TE2448824488eusmtip1b; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 6/9] spi: spi-s3c64xx: Fix doc comment for struct s3c64xx_spi_driver_data Date: Thu, 1 Oct 2020 17:21:45 +0200 Message-Id: <20201001152148.29747-7-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTcRjtt7vdezedXaflhz3EYUFCmiRxQw2NiP1RYCBIounKi0qbyuas FehUSJ3TpSK+0XygDdNc5vJBwhI1JB8ZPiqFUBFnkboJak+3a+R/5zvnfOc7P/iRmMjE8yST ktMYRbJUJsYF3O6hnbGzEpsq9px2LZBu3F7h0J0VHTy67MsSTusX1zB6fPw5Qc+ZWxFtXJzm 0VO9NThdMf6aQ2dtzBH0s8F5gjb0/kShzpKZpk1M0lM1T0iMhnxc8qIpU1LUZUASq/FkOB4l CI5nZEnpjML/UpwgcWS5gJe65HT/h43SID1fi/gkUIHwRP+BY8ciqhXBskWqRYI9bEOwU1CJ s4MVwdyiltAi0rHxafI0y7cgKNetYuywgmB3S+OIwqkw0DeP8OyCO2XiQLF1nGsXMEoFuh4z bsduFAODRbPInsqlTkH5vMJOC6kgaO8rRGw9L8htMTnsfCoYxorf4KzHFd5WLjkiD1O+0JY9 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vXS87P3cQIjMZtx35u 2cHY9S74EKMAB6MSD6/AgdJ4IdbEsuLK3EOMEhzMSiK8TmdPxwnxpiRWVqUW5ccXleakFh9i NAX6ciKzlGhyPjBR5JXEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRq YAzwmctlp7b04gRL9zeLU1PktxldWly97N/5N//Mr1mG3vQ6Ur/Sfp38fJa+ppOO+TNbth18 WPLbZNOElWw9/LvOb31RfzNg84Mv95S+i3+/0xqqzPA7eGtWt60nI3MRW5Axi6jJERXWAwy1 KaeuCuqdZNx++PqaDLfg53M1/gbJObIeNmNeH67EUpyRaKjFXFScCAATG8dW3AIAAA== X-CMS-MailID: 20201001152248eucas1p12f71c21a5873b6360e4b38efebb50271 X-Msg-Generator: CA X-RootMTR: 20201001152248eucas1p12f71c21a5873b6360e4b38efebb50271 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152248eucas1p12f71c21a5873b6360e4b38efebb50271 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Remove descriptions for non-existent fields and fix indentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index adc5593ca2ca..02de734b8ab1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -162,11 +162,8 @@ struct s3c64xx_spi_port_config { * @cntrlr_info: Platform specific data for the controller this driver manages. * @lock: Controller specific lock. * @state: Set of FLAGS to indicate status. - * @rx_dmach: Controller's DMA channel for Rx. - * @tx_dmach: Controller's DMA channel for Tx. * @sfr_start: BUS address of SPI controller regs. * @regs: Pointer to ioremap'ed controller registers. - * @irq: interrupt * @xfer_completion: To indicate completion of xfer task. * @cur_mode: Stores the active configuration of the controller. * @cur_bpw: Stores the active bits per word settings. @@ -183,7 +180,7 @@ struct s3c64xx_spi_driver_data { struct clk *ioclk; struct platform_device *pdev; struct spi_master *master; - struct s3c64xx_spi_info *cntrlr_info; + struct s3c64xx_spi_info *cntrlr_info; spinlock_t lock; unsigned long sfr_start; struct completion xfer_completion; From patchwork Thu Oct 1 15:21:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 267041 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 D7D1DC4741F for ; Thu, 1 Oct 2020 15:23:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A003220672 for ; Thu, 1 Oct 2020 15:23:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="MMthWRY3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732730AbgJAPXJ (ORCPT ); Thu, 1 Oct 2020 11:23:09 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40872 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732680AbgJAPWv (ORCPT ); Thu, 1 Oct 2020 11:22:51 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152249euoutp01185b296194d4c6c1715c396b4c334309~555UAs7TY2706927069euoutp01f for ; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201001152249euoutp01185b296194d4c6c1715c396b4c334309~555UAs7TY2706927069euoutp01f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565769; bh=+RhGw1aBvT/TFJWvkjxUmVoP7hLaAZ8E8m5e3M8QeyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MMthWRY3T+6jsz5IrxrbH31WcxEeUoyGrigEM/q634Kg/tPwVsc7IB5jczw3Kw4zo PG3PFW5rqb9t+gMH0I9b6qFcWhXjTr63Si5a0wV+FRTvx2ASkXdKCyPCWNx1fZmV3/ gPvhMHvons5HEWUovJiS2sxn6im+aVqQOMEu6PDo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152249eucas1p2a8d25d31e37e9de575a04164d63354ae~555Tk1Pms2407924079eucas1p2I; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 59.2F.06456.944F57F5; Thu, 1 Oct 2020 16:22:49 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eucas1p132a63f588f62d902879322ebadd67173~555TRY1gd0137901379eucas1p1o; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152248eusmtrp1bbb5a920e4e336c568a84ae502568476~555TQtt1-2671626716eusmtrp1j; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-4b-5f75f44983c0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 03.A5.06314.844F57F5; Thu, 1 Oct 2020 16:22:48 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eusmtip1c2222e55fb3d01f3e8a527901003c2e4~555TEpvrl2696126961eusmtip1L; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Date: Thu, 1 Oct 2020 17:21:46 +0200 Message-Id: <20201001152148.29747-8-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+Xa2c47i9DgXvthFHAUpOBMrDqmRZjH/6kYYZdnMg5PclB1n aoFmqGWmqVi2pKQsRcrLvF8QndFK04FBaqk51LwheSUVyzweI/973u/9vc/7vPCRmKRG5ERG aGIYrUYZKcOthbXvV8zugYu6kAOPDAT9cnlcQFfml4voPMsoTmeNTGO02VxB0P3GEkQbRr6I 6M+NBTidb24R0Lfn+gn67btBgi5tXEPHbBS9RfOYokE/SCgMpfdwRVVRoiKzuhQpFgx7TuMX rX3CmMiIWEbrcfSqtcpk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k4OZoFyiUuznrOD2MICURKPV+xgBxnKIqAq8eKnC0iYV8Ba4s/X+ewQ C+Ql2pdvZwOxOQVsJM5NPAxmCwnkSuzefZQNol5Q4uTMJ2C3MQuoS6yfJwQS5hfQkljTdB1q q7xE89bZzBMYhWYh6ZiF0DELSdUCRuZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgRG57djP zTsYL20MPsQowMGoxMMrcKA0Xog1say4MvcQowQHs5IIr9PZ03FCvCmJlVWpRfnxRaU5qcWH GE2BvpzILCWanA9MFnkl8YamhuYWlobmxubGZhZK4rwdAgdjhATSE0tSs1NTC1KLYPqYODil GhgTtsZsE2/60f6nz/z6+mmBz2qvVWn/vvY1Szt3aYPI4vwgp5IlHM8TNi1dMe3oi6hc2zN7 JV+3Tv0vmBQ479LD+v/Fzm7hVUvWrmI9PG8xf7J3+zFZeUuNeTnLWVeovTrU6KARVsYpPP3H xj82v8/Me+r7K2H147lanNt2V2+c9z99RUwBN5evEktxRqKhFnNRcSIAweqE8t4CAAA= X-CMS-MailID: 20201001152248eucas1p132a63f588f62d902879322ebadd67173 X-Msg-Generator: CA X-RootMTR: 20201001152248eucas1p132a63f588f62d902879322ebadd67173 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152248eucas1p132a63f588f62d902879322ebadd67173 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Make sure the cur_speed value used in s3c64xx_enable_datapath() to configure DMA channel and in s3c64xx_wait_for_*() to calculate the transfer timeout is set to the actual value of (half) the clock speed. Suggested-by: Tomasz Figa Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 02de734b8ab1..89c162efe355 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -626,6 +626,7 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); if (ret) return ret; + sdd->cur_speed = clk_get_rate(sdd->src_clk) / 2; } else { /* Configure Clock */ val = readl(regs + S3C64XX_SPI_CLK_CFG); From patchwork Thu Oct 1 15:21:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 267043 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 96AB0C4727C for ; Thu, 1 Oct 2020 15:22:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61E5F20672 for ; Thu, 1 Oct 2020 15:22:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Cdutv5RU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732717AbgJAPW5 (ORCPT ); Thu, 1 Oct 2020 11:22:57 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41176 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732679AbgJAPWw (ORCPT ); Thu, 1 Oct 2020 11:22:52 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152249euoutp024fc5ff1679fb5119e37993b3d81968e3~555UL5KJe2406624066euoutp02U for ; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152249euoutp024fc5ff1679fb5119e37993b3d81968e3~555UL5KJe2406624066euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565769; bh=GJq8Rrl/NqY+M8Jy9Il23NXnXWGEb+l5rpI2RMGL5uE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cdutv5RUGBIMkf0u7JITUZ0D1+mh+Z9YHnhULtczKivt+/zomYJtAy2kJBy7LU8ek MTq2CfzjmaBX9qMigVoRDChl+1sSlhmnK1bg4B5OGX+olYL3peHcmsYbIIScrWHm/P c4b/c0ZP7elDz/dEeR8zJr/1iLhcngBVazXbUxqE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201001152249eucas1p2b495c0905e73ec5122f74683f74f1acf~555T3vaaj1941819418eucas1p2F; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2F.EC.06318.944F57F5; Thu, 1 Oct 2020 16:22:49 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152249eucas1p1c3bbe7b2a677affe4e1a1e4d469f94c8~555TjTztC1646216462eucas1p1O; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152249eusmtrp16ccaa3ffc2978b39f9c17abb2b48db92~555TipH3K2671626716eusmtrp1k; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-a2-5f75f4492abb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D3.A5.06314.944F57F5; Thu, 1 Oct 2020 16:22:49 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152248eusmtip24cdda12d8517106e67e5454a644fa5c5~555TZRzJ_0513205132eusmtip2V; Thu, 1 Oct 2020 15:22:48 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 8/9] spi: spi-s3c64xx: Increase transfer timeout Date: Thu, 1 Oct 2020 17:21:47 +0200 Message-Id: <20201001152148.29747-9-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFKsWRmVeSWpSXmKPExsWy7djP87qeX0rjDZ73S1os/vGcyWLjjPWs FlMfPmGz6H/8mtni/PkN7BY3D61gtNj0+BqrxeVdc9gsZpzfx2TR+PEmu8XaI3fZLVbt+sPo wONxfcknZo+ds+6ye2xa1cnmsXlJvUffllWMHp83yQWwRXHZpKTmZJalFunbJXBlLGtvYCz4 zFFx5cxMtgbGmexdjJwcEgImEs0dJ5i6GLk4hARWMEqsPbEGyvnCKPH1azMzhPOZUWLVq0Nw Lf9vtk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VaQhIjAfiaJSxfus4AkmAXKJS7Neg5WJCzgJfF58nlGEJtFQFXiw+LFTCA2r4C1xMX775kh NshLtC/fzgZicwrYSJybeBjMFhLIldi9+ygbRL2gxMmZT1hAjmMWUJdYP08IJMwvoCWxpuk6 1Fp5ieats5knMArNQtIxC6FjFpKqBYzMqxhFUkuLc9Nziw31ihNzi0vz0vWS83M3MQJjctux n5t3MF7aGHyIUYCDUYmHV+BAabwQa2JZcWXuIUYJDmYlEV6ns6fjhHhTEiurUovy44tKc1KL DzGaAr05kVlKNDkfmC7ySuINTQ3NLSwNzY3Njc0slMR5OwQOxggJpCeWpGanphakFsH0MXFw SjUwVt7ecPTlJ0mJ0hwPz5R19x43n12+7YTIf8mWE2pP/zcpxF/56LH0ibxxx+xLctL7T+/Q NDz/LG197PpZnq7m270cC5u2CUWFm7imtjnffrHo49KJtqeFuredF3oX/LI96JuM8IV9+bue hn1rM6ndOeVeuQXTrOSpLz49SZsxV2/hkoZnUdw7JymxFGckGmoxFxUnAgAd7q793wIAAA== X-CMS-MailID: 20201001152249eucas1p1c3bbe7b2a677affe4e1a1e4d469f94c8 X-Msg-Generator: CA X-RootMTR: 20201001152249eucas1p1c3bbe7b2a677affe4e1a1e4d469f94c8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152249eucas1p1c3bbe7b2a677affe4e1a1e4d469f94c8 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Increase timeout by 30 ms for some wiggle room and set the minimum value to 100 ms. This ensures a non-zero value for short transfers which may take less than 1 ms. The timeout value does not affect performance because it is used with a completion. Similar formula is used in other drivers e.g. sun4i, sun6i. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 89c162efe355..ea5a22dec53d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -473,7 +473,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* millisecs to xfer 'len' bytes @ 'cur_speed' */ ms = xfer->len * 8 * 1000 / sdd->cur_speed; - ms += 10; /* some tolerance */ + ms += 30; /* some tolerance */ + ms = max(ms, 100); /* minimum timeout */ val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); From patchwork Thu Oct 1 15:21:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 257118 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 69A79C4741F for ; Thu, 1 Oct 2020 15:23:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A81F20672 for ; Thu, 1 Oct 2020 15:23:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="glDkB4uR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732586AbgJAPW5 (ORCPT ); Thu, 1 Oct 2020 11:22:57 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41213 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732539AbgJAPWw (ORCPT ); Thu, 1 Oct 2020 11:22:52 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201001152250euoutp0262046fb2de96140c07bccf6120ec01ae~555UwAnqD2410224102euoutp02K for ; Thu, 1 Oct 2020 15:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201001152250euoutp0262046fb2de96140c07bccf6120ec01ae~555UwAnqD2410224102euoutp02K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601565770; bh=tbbrF9drxp3pC+sI39T9dolcDVWc06CYhVYWFYzZKJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glDkB4uR9YmcfihHbkadImGxgNUHe/R8lbGURVk/J3b1+sleSJnhaJEnfogZw3h7i BGQ4q/qHpIdcMiDVKFqpFSZAxnyMUa+gKOjH/e6zwtD6CkgQMq6ciUKkPW1pTxj/IV dmX9t3dr4S51vktBxD/0w+L4RLFfIcWI6AorW2r4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201001152250eucas1p162a51ed471768b7e38a2ef5c9682dfad~555UXMCq-0403504035eucas1p1V; Thu, 1 Oct 2020 15:22:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8A.29.05997.944F57F5; Thu, 1 Oct 2020 16:22:49 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201001152249eucas1p165b78adf542a48b38b49cb5e00500e26~555T8naj52388923889eucas1p1U; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201001152249eusmtrp159095f80c45780b374022dbabb6274ef~555T8ByB42671626716eusmtrp1l; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-58-5f75f4495ebf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F7.D5.06017.944F57F5; Thu, 1 Oct 2020 16:22:49 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201001152249eusmtip2788ed82cb2e3736d5270d8767df6eeee~555TuJjq70082600826eusmtip2_; Thu, 1 Oct 2020 15:22:49 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?utf-8?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 RESEND 9/9] spi: spi-s3c64xx: Turn on interrupts upon resume Date: Thu, 1 Oct 2020 17:21:48 +0200 Message-Id: <20201001152148.29747-10-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152148.29747-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTcRTnf+92dxWn1yl4ME0aFmSlWSJXE0kJWV96fQgKfEy9qORUNmcZ 5BMy36mUz/Ktw2zma04xk5WZaK5spmYLREU0InKj1ETbdpX89jvn/B7nwCFxwSDXmYxLSGak CeJ4IWHNUb3dnDx10SgPP63r86cbN1YwurOig0s/Wlgi6OLF7zit1b7g0XMaBaK7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xLLdK3S9DLeLh/KVPBK7aKzXuvMjYwPmftYuTkkBAw kZj+6woTiC0ksJRRYutVmy5GDqC4lMTKuekQJcISf651sXUxcgGVPGWUaF9znw0kwSbgKNG/ 9AQrSEJEYD+TxKUL91lAEswC5RKXZj1nB7GFBfwlPpy5DNbAIqAq8e1JA1icV8BG4un2+ewQ G+Ql2pdvB6vhBIqfm3iYDeKgXIndu4+yQdQLSpyc+YQF5DhmAXWJ9fOEQML8AloSa5quQ62V l2jeOpt5AqPQLCQdsxA6ZiGpWsDIvIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMwIrcd+7ll B2PXu+BDjAIcjEo8vAIHSuOFWBPLiitzDzFKcDArifA6nT0dJ8SbklhZlVqUH19UmpNafIjR FOjNicxSosn5wGSRVxJvaGpobmFpaG5sbmxmoSTO2yFwMEZIID2xJDU7NbUgtQimj4mDU6qB 8YplQpxeTeBHttmTX7QeFfSfvy3pqYZc3qVJWT+WvD3C7aB963Gi4MrpQlXdaWGz7j2wNMni jp90d1OMbsHHM10P7zv/d/wY/u63h9JG/2Sx9k9Wzg83XTT7or717r9vTv2Snl0bXv/w7dOJ NGXvMPbw/5Ted+nruWOhDnaGXlo5WfGHFrJZKbEUZyQaajEXFScCAPKNMsPeAgAA X-CMS-MailID: 20201001152249eucas1p165b78adf542a48b38b49cb5e00500e26 X-Msg-Generator: CA X-RootMTR: 20201001152249eucas1p165b78adf542a48b38b49cb5e00500e26 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201001152249eucas1p165b78adf542a48b38b49cb5e00500e26 References: <20200821161401.11307-1-l.stelmach@samsung.com> <20201001152148.29747-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org s3c64xx_spi_hwinit() disables interrupts. In s3c64xx_spi_probe() after calling s3c64xx_spi_hwinit() they are enabled with the following call. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index ea5a22dec53d..53e3581bcd7b 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1378,6 +1378,10 @@ static int s3c64xx_spi_runtime_resume(struct device *dev) s3c64xx_spi_hwinit(sdd); + writel(S3C64XX_SPI_INT_RX_OVERRUN_EN | S3C64XX_SPI_INT_RX_UNDERRUN_EN | + S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, + sdd->regs + S3C64XX_SPI_INT_EN); + return 0; err_disable_src_clk: