From patchwork Fri Aug 21 16:13:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11729893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD39D1731 for ; Fri, 21 Aug 2020 16:14:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A59342086A for ; Fri, 21 Aug 2020 16:14:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sgpwJA7D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725834AbgHUQOL (ORCPT ); Fri, 21 Aug 2020 12:14:11 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37164 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgHUQOI (ORCPT ); Fri, 21 Aug 2020 12:14:08 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161406euoutp013eb335e00f37ac06e73787b444fefa76~tVJYbciUv2432124321euoutp01I for ; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200821161406euoutp013eb335e00f37ac06e73787b444fefa76~tVJYbciUv2432124321euoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026446; bh=PpDBZdajjDlgQHRWyQ9W5bbkjE+LhSCprllGPHPQdnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sgpwJA7D9ftM6l82BbCVMbOYHUpC9VphRNwTKBwGJj8kmoECB+I+Qi42G0vPf9Clv 5DxiT7DJMzbhf1sGBYp3QpRi7pS/rcTCM/TUl8Lw2nsp/lFWjJj1BOVuEVb5sMLoL2 mFtMbyj4ASPcxV070a0vrqvak1AdgohsIvny5wAI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200821161405eucas1p1718cc0c7b3a44e59858c0a903cd46272~tVJX34oAl0797107971eucas1p1V; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9F.9E.05997.DC2FF3F5; Fri, 21 Aug 2020 17:14:05 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eucas1p1d43a5970c6a26389cd506aab5f986bc8~tVJXWdlvZ3197331973eucas1p1v; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161405eusmtrp22d4f9c7b9b686ad1a253939c0c8f3ab1~tVJXVxjNn2998229982eusmtrp2b; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-c2-5f3ff2cdec30 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D9.17.06314.DC2FF3F5; Fri, 21 Aug 2020 17:14:05 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eusmtip1af489f3f01105dae12c2bd3ed9135448~tVJXJ5vys1595415954eusmtip1E; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath() Date: Fri, 21 Aug 2020 18:13:53 +0200 Message-Id: <20200821161401.11307-2-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPKsWRmVeSWpSXmKPExsWy7djP87pnP9nHG+w+YGyx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8atz/4Fp9grtm07ytbAuJCt i5GTQ0LAROLjjF/sXYxcHEICKxgl1uzZzgjhfGGUOHFnKQuE85lRYsX6zewwLZs67zNBJJYz SizuXQ42S0jgOaPE/WPaIDabgKNE/9ITrCBFIgITmCQennsDVsQsUCrRs/MQmC0skCyxbuNe oEkcHCwCqhK/V/mDhHkFrCX613ezQiyTl2hfvh2snFPARuL4pSZWiBpBiZMzn7CA2PwCWhJr mq6zQIyXl2jeOpsZZK+EwCV2ibXHpkENcpH4v+giM4QtLPHq+Baob2Qk/u+cD3aDhEC9xORJ ZhC9PYwS2+b8YIGosZa4c+4XG0gNs4CmxPpd+hBhR4mnU+azQ7TySdx4KwhxAp/EpG3TmSHC vBIdbUIQ1SoS6/r3QA2Ukuh9tYJxAqPSLCTPzELywCyEXQsYmVcxiqeWFuempxYb5aWW6xUn 5haX5qXrJefnbmIEJqPT/45/2cG460/SIUYBDkYlHt4fh+zjhVgTy4orcw8xSnAwK4nwOp09 HSfEm5JYWZValB9fVJqTWnyIUZqDRUmc13j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1c7zrBtvz15ou+sPPVb/FJxV35P XujypujlYW6RipT1FcWzm5l+/FZiKc5INNRiLipOBAA1fNNU0gIAAA== X-CMS-MailID: 20200821161405eucas1p1d43a5970c6a26389cd506aab5f986bc8 X-Msg-Generator: CA X-RootMTR: 20200821161405eucas1p1d43a5970c6a26389cd506aab5f986bc8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161405eucas1p1d43a5970c6a26389cd506aab5f986bc8 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This and the next patch 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. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- 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 Fri Aug 21 16:13:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11730067 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FC3615E4 for ; Fri, 21 Aug 2020 17:30:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74B9820FC3 for ; Fri, 21 Aug 2020 17:30:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="aScxBX/H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbgHURah (ORCPT ); Fri, 21 Aug 2020 13:30:37 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38787 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbgHUQOK (ORCPT ); Fri, 21 Aug 2020 12:14:10 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161406euoutp025a5c9fcc640c10b9ac24a5a4cabfc253~tVJYyB2Cb0659906599euoutp02J for ; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161406euoutp025a5c9fcc640c10b9ac24a5a4cabfc253~tVJYyB2Cb0659906599euoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026446; bh=KeqMlAnQDioCCu8vW3lN/TARMJriFxWP6OI28/BAWlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aScxBX/H9Dp1x6jyam5vwzJDJJr3efXztBr2k+/4S3luCx/mVnzSN2iZ0mbxKpwnf 2wFtk4lJkrvg+2kWZYhlNi6DnGECYvV1Ws8OCVyx2fdkC6aR18A/ITSzkd/bmsPy2E p+g1vfFFRKzVt7yFLdAYcVkFxGX5iL3WVM7XeU6I= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161406eucas1p2111ed4bdeb3a760d71a878cfd0798d39~tVJYJCXCm1870518705eucas1p2l; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A1.B2.06318.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eucas1p20aad659cd41bc4f56d5123d3c63394f0~tVJXtZ90P1823418234eucas1p2h; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200821161405eusmtrp1c7883aee9cc58d774fe9cd425768a4ca~tVJXsxwz-1179011790eusmtrp13; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-d0-5f3ff2ce3dbb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id ED.A9.06017.DC2FF3F5; Fri, 21 Aug 2020 17:14:05 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eusmtip1fbfb185c6d98c1845c601bf4c1ed7cdd~tVJXevJ1R1633816338eusmtip1J; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 2/9] spi: spi-s3s64xx: Add S3C64XX_SPI_QUIRK_CS_AUTO for Exynos3250 Date: Fri, 21 Aug 2020 18:13:54 +0200 Message-Id: <20200821161401.11307-3-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRjm29nZOS5nZ5vh2wqFlUGCWihyItEMf4xIMPoTYdnSg5o6ZcdZ U8oblBNvaJJNMfGCyy6rpdPMVJZlJk3zkkkpeEFLDUwzTEvTnUn+e97vubzvAx+JSUy4jIxR JTFqlTJOLhDyzW9+93paFwPDj+inCLp6ZYZHPy014nTJ+JSALpicw+je3icEPWIxINo0+RGn B1rKBXRpbxuPzvgxQtCPOkeJE7sUwzWLmMJUrxMontWkKfIb6pFiyeQaip8X+kcycTHJjNo7 4JIwuml1EE+sFFyrHXtApCM9noMcSKB8YcCgQzlISEooA4LMyhqMG34iaF/L5nHDEoKNETN/ 29L+edpO1CEYmqrFuWEGQb9undhSCaggKKh9ayOcqUIejFvnBVsERmkg97nFhqXUOTD+XbPF 8il3aH71Gm1hEXUcvnRsENw6N7hV12TTO1D+0NWfiXMaMXTfnbJ5d1Me8DBzmM/lu0FWY5mt BFBWAj505iMuKBh+9c3ZQ6Uw29Vgx/uhpzh300xu4jQoLvLjvLkIzOUr9s6bB1lXBVsajDoM xhZv7jkIht7peJzVCT59F3MnOEGR+Q7GPYsg+6aEUx+ExwWt9kAZ5M0aUCGS63eU0e8ooP+/ qxJh9ciF0bDxUQzro2KuerHKeFajivKKSIg3oc2f1LPetdyM2v5ctiCKRHJH0YolMFyCK5NZ bbwFAYnJnUUn3/dclIgildoURp0QrtbEMawF7SP5cheRT9W3CxIqSpnExDJMIqPeZnmkgywd NYhjB5eMEyWpGcslCdUT189aKcm9G2Ed6f7mtqyxUBkbqu8T+0j9qiYP0RGu9HJYdEkepq06 FYDRsoX0kAqiJrl7tHbxyoS7WRWysKY95ojvmZ5Wo/nZF5638/LDvlpOS6GCeOlrQGfClQf2 lrUuNN5XpBxISI0NbtKM9cn5bLTyqAemZpX/AEFpOvtFAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRmVeSWpSXmKPExsVy+t/xu7pnP9nHG6xcqmyx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGuUnk1RfmlJqkJGfnGJrVK0oYWRnqGlhZ6RiaWeobF5 rJWRqZK+nU1Kak5mWWqRvl2CXsb2X1dYCxawVSy9t5q9gXEWaxcjJ4eEgInE/tvPmEBsIYGl jBK934HiHEBxKYmVc9MhSoQl/lzrYuti5AIqecoosXPCdnaQBJuAo0T/0hOsIAkRgRlMEk9u TAYbyixQLnFp1nN2kEHCAmESjxbWg4RZBFQldhw+yghi8wpYS9w58J8dYoG8RPvy7WwgNqeA jcTxS02sEPdYS2xbfJkFol5Q4uTMJywgI5kF1CXWzxMCCfMLaEmsabrOArFVXqJ562zmCYxC s5B0zELomIWkagEj8ypGkdTS4tz03GIjveLE3OLSvHS95PzcTYzA2Nt27OeWHYxd74IPMQpw MCrx8P44ZB8vxJpYVlyZe4hRgoNZSYTX6ezpOCHelMTKqtSi/Pii0pzU4kOMpkBvTmSWEk3O B6aFvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFINjDp+/Ku9ypme Ch8/lPeWI3bKgYNC3yM2CahPjOw3Ntl54LyBsl//1eX96c6niprOd1/u4W67NP23psz7Bs+A GmXWB53af7mWbKq93b53506rJCluzk2ez/efaTU44vs1+6y0j3J5+/RvWZ83nSoRlXDzesCv eP5p8D6DuDT2jl9B13wb439cUGIpzkg01GIuKk4EAIuL3bjTAgAA X-CMS-MailID: 20200821161405eucas1p20aad659cd41bc4f56d5123d3c63394f0 X-Msg-Generator: CA X-RootMTR: 20200821161405eucas1p20aad659cd41bc4f56d5123d3c63394f0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161405eucas1p20aad659cd41bc4f56d5123d3c63394f0 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This and the previous patch 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 Fri Aug 21 16:13:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11729901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31CB3109B for ; Fri, 21 Aug 2020 16:14:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 146D320855 for ; Fri, 21 Aug 2020 16:14:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="VKCmIHFD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbgHUQOU (ORCPT ); Fri, 21 Aug 2020 12:14:20 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38741 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbgHUQOI (ORCPT ); Fri, 21 Aug 2020 12:14:08 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161406euoutp0203f970a24129cabc910359328a82335e~tVJYwY4FS0371003710euoutp02f for ; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161406euoutp0203f970a24129cabc910359328a82335e~tVJYwY4FS0371003710euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026446; bh=ccU0tT3tsz9DJYTKMLpd1LpyWr9vzOvbufZouJOY0YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VKCmIHFDlSFXI2/ZztE9Fhnc/CGFc4hB+THYVqIRTkgXZvNprOl1kjgMToCyba6Mv tl/LHBPwbMBwBsc0naXcEd1REZHV3yxEIk7X8ivrQVJz1k9i4gDlvhi+Koz2BbHpLh o05tFgBPLINa4d3QSFuyFpG+QNCx2uwlnpbw1M1I= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161406eucas1p2870eafd118f65f4d8f90f8f3033c0738~tVJYbvCw21823418234eucas1p2i; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B0.AE.05997.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eucas1p19280babcd73926b5c22a48830f5fecd7~tVJX99PZB2678326783eucas1p1C; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161405eusmtrp2223e2fc934230c1c7f1c8c6d00434110~tVJX9XnAT2998229982eusmtrp2c; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-c3-5f3ff2ceb9f8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AA.17.06314.DC2FF3F5; Fri, 21 Aug 2020 17:14:05 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161405eusmtip211f4dbf242ffa723f842573625fdb2c1~tVJX0TxsU2051720517eusmtip2l; Fri, 21 Aug 2020 16:14:05 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 3/9] spi: spi-s3c64xx: Report more information when errors occur Date: Fri, 21 Aug 2020 18:13:55 +0200 Message-Id: <20200821161401.11307-4-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djPc7rnPtnHG9zfLGmx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8a19ZsYC04JVCyZspClgXEq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J4eEgInE2UfLGbsYuTiE BJYySsydfZq1i5EDKCElsXJuOkSNsMSfa11sEDVPGSXuzd/LCJJgE3CU6F96ghUkISIwg0ni yY3JrCAJZoFyiUuznrOD2MICwRJtH9YwgwxlEVCVaD8tChLmFbCWmLz8CSPEAnmJ9uXb2UBs TgEbieOXmsDGCAHVbFt8mQWiXlDi5MwnLCBjmAXUJdbPEwIJ8wtoSaxpus4CsVVeonnrbOYJ jEKzkHTMQuiYhaRqASPzKkaR1NLi3PTcYkO94sTc4tK8dL3k/NxNjMDo23bs5+YdjJc2Bh9i FOBgVOLh/XHIPl6INbGsuDL3EKMEB7OSCK/T2dNxQrwpiZVVqUX58UWlOanFhxhNgb6cyCwl mpwPTAx5JfGGpobmFpaG5sbmxmYWSuK8HQIHY4QE0hNLUrNTUwtSi2D6mDg4pRoYq1n0b82X 3rdwSbXXXGWz518uzlLqy03zUWmN2rtyfX9ei5LxG7F3xbq3J5nb9563yzly78ffH7tSe1VF bdJ+bq5+mux/KiVeqzjI8Potj1+RdmUW6z1uu5rpPzLvfFq0uURc+QDzwubCQOYpXr47X2iq f4rPC7Trmi94ZbaspZbAlYKTvnZKLMUZiYZazEXFiQAupp4b1AIAAA== X-CMS-MailID: 20200821161405eucas1p19280babcd73926b5c22a48830f5fecd7 X-Msg-Generator: CA X-RootMTR: 20200821161405eucas1p19280babcd73926b5c22a48830f5fecd7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161405eucas1p19280babcd73926b5c22a48830f5fecd7 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org 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. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 22bf8c75580a..3364d362ed21 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; }; @@ -304,7 +305,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, desc->callback = s3c64xx_spi_dmacb; desc->callback_param = dma; - dmaengine_submit(desc); + dma->cookie = dmaengine_submit(desc); dma_async_issue_pending(dma->ch); } @@ -699,17 +700,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 Fri Aug 21 16:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11729905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AF4715E4 for ; Fri, 21 Aug 2020 16:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E9FA214F1 for ; Fri, 21 Aug 2020 16:14:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="eseW2q+q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgHUQOd (ORCPT ); Fri, 21 Aug 2020 12:14:33 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38793 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgHUQOM (ORCPT ); Fri, 21 Aug 2020 12:14:12 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161407euoutp02b1fb0c69fce840fe73993ff9ecaccde0~tVJZE35ZN0696006960euoutp02C for ; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161407euoutp02b1fb0c69fce840fe73993ff9ecaccde0~tVJZE35ZN0696006960euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026447; bh=axDL6sluj5xlo96GTCxVwhlUTt8MkkA+5p9ugSmGU9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eseW2q+qu3KPVliloXQxVSu0+cdcikfPMSPh8dMH+W30dXcsqDVlZa1RTidaG07tB nkxFJvITH/gUJfvUemmaJmcwopxeyXIDrtjM9GsCb3xek8TstixrWgirGy6P4WcoGj FY4GefsgBw95JnkmKEAHXS6LXZGuRbDUB7lr/4Dk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200821161406eucas1p1b4e6d827233652edce283502ebebb13b~tVJYw8rW-0799907999eucas1p1e; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 55.D9.06456.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161406eucas1p2be3221183a855afd0213f8ce58bd8942~tVJYXQO7A1578115781eucas1p2k; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200821161406eusmtrp1362332e2149498732b1d6ae5059a9c1f~tVJYWjVmN1179011790eusmtrp15; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-d4-5f3ff2cef0c9 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CE.A9.06017.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161406eusmtip26e6c03e133428d45de6e68d8da2bb565~tVJYJPEpw2051720517eusmtip2m; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 4/9] spi: spi-s3c64xx: Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* Date: Fri, 21 Aug 2020 18:13:56 +0200 Message-Id: <20200821161401.11307-5-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djPc7rnPtnHG3w4Y2Cx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8bWp9vYCtaLVrxaeYylgfG5 YBcjJ4eEgInE94332LoYuTiEBFYwSvw4NoMVwvnCKPF08XUWCOczo8SzRX+Zuxg5wFoeL+aB iC9nlJj74jRU+3NGif3nTrGAzGUTcJToX3oCbJSIwAQmiYfn3rCBJJgFSiV6dh4Cs4UFoiSa pl1nB7FZBFQl3j2YzwSygVfAWmLGK0+I++Ql2pdvByvnFLCROH6piRXE5hUQlDg58wnYLn4B LYk1TddZIMbLSzRvnc0MsldC4BK7xO39a9kgBrlIfOjdyQphC0u8Or6FHcKWkTg9uYcF4rN6 icmTzCB6exglts35wQJRYy1x59wvNpAaZgFNifW79CHCjhInd++FBgqfxI23ghAn8ElM2jYd Kswr0dEmBFGtIrGufw/UQCmJ3lcrGCcwKs1C8swsJA/MQti1gJF5FaN4amlxbnpqsWFearle cWJucWleul5yfu4mRmA6Ov3v+KcdjF8vJR1iFOBgVOLh/XHIPl6INbGsuDL3EKMEB7OSCK/T 2dNxQrwpiZVVqUX58UWlOanFhxilOViUxHmNF72MFRJITyxJzU5NLUgtgskycXBKNTA6/lm+ Nzm64D1PqI6guOBk/pMK04xWGgr9u9w0KX7ZodSPc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VCLuag4EQB/sswZ0wIAAA== X-CMS-MailID: 20200821161406eucas1p2be3221183a855afd0213f8ce58bd8942 X-Msg-Generator: CA X-RootMTR: 20200821161406eucas1p2be3221183a855afd0213f8ce58bd8942 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161406eucas1p2be3221183a855afd0213f8ce58bd8942 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org 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 3364d362ed21..433b9d77b914 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) @@ -319,18 +319,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); } } @@ -951,9 +951,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 Fri Aug 21 16:13:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11730055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D6ED1392 for ; Fri, 21 Aug 2020 17:30:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AF8220656 for ; Fri, 21 Aug 2020 17:30:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="cEik/R6f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729180AbgHURaS (ORCPT ); Fri, 21 Aug 2020 13:30:18 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37231 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbgHUQOL (ORCPT ); Fri, 21 Aug 2020 12:14:11 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161407euoutp01ac3e660b2654ca44a0fb904c37036c71~tVJZRQt6I2276222762euoutp01s for ; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200821161407euoutp01ac3e660b2654ca44a0fb904c37036c71~tVJZRQt6I2276222762euoutp01s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026447; bh=rhBsub9wjuMeOLZuAmFwGL8Y5MlYJoQUBEjSxehD7oQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cEik/R6fdob4nD8Z2XZtWmhG4YEMcJLvDZNTliTxwtZoRPP775mUMmebTqk+Xfuxb PfTpWjXfoOhtHWb/SfpP0sUYS7CjFluQFo3uOid7fHJUwqegrg8orJoaFP6v0Ao171 WGnrXIlVc8HurlVdA5E9nbm6hw3oyl6b7YOA0H9M= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161407eucas1p2be320a91a60463a5166e0c03cbb661b0~tVJY8N0I21844518445eucas1p2e; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 36.D9.06456.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200821161406eucas1p121553719d4e9cc020d2c557a69000f0c~tVJYpdGJT0803808038eucas1p1U; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200821161406eusmtrp10efe21b7cf620757b68ea4503b40a27d~tVJYox_3g1179011790eusmtrp17; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-d5-5f3ff2ce6145 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 22.B9.06017.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200821161406eusmtip1d752dc1e58f598870119d8412c7be1b8~tVJYeDRr91141711417eusmtip1B; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 5/9] spi: spi-s3c64xx: Fix doc comment for struct s3c64xx_spi_driver_data Date: Fri, 21 Aug 2020 18:13:57 +0200 Message-Id: <20200821161401.11307-6-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djPc7rnPtnHGzQdtrJY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK+PN2YPMBRu4Kz7+f8bawPiA o4uRk0NCwESi4e5E9i5GLg4hgRWMEv17+lkgnC+MEvPfXWKFcD4zSvxb/ZYFpuVP2z6oluWM EmcnvmeEcJ4zSjyeMIkJpIpNwFGif+kJsHYRgQlMEg/PvWEDSTALlEr07DwEZHNwCAvESaxp VwAJswioSrxafosFJMwrYC3xb6INxDJ5ifbl28E6OQVsJI5famIFsXkFBCVOznwCdhC/gJbE mqbrLBDT5SWat85mBlkrIXCJXeJQzzomiEEuEmte3mKEsIUlXh3fwg5hy0icntwDtldCoF5i 8iQziN4eRoltc35AfWwtcefcL7CTmQU0Jdbv0ocIO0o8O7sIqpVP4sZbQYgT+CQmbZvODBHm lehoE4KoVpFY178HaqCURO+rFYwTGJVmIXlmFpIHZiHsWsDIvIpRPLW0ODc9tdgwL7Vcrzgx t7g0L10vOT93EyMwHZ3+d/zTDsavl5IOMQpwMCrx8P44ZB8vxJpYVlyZe4hRgoNZSYTX6ezp OCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8xotexgoJpCeWpGanphakFsFkmTg4pRoYF1y5t3n+ 5aoY26m8d7M3x3udZte2emrx71WmcH67bMXVqxPteHP73tl6RPg0HGVocKz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== X-CMS-MailID: 20200821161406eucas1p121553719d4e9cc020d2c557a69000f0c X-Msg-Generator: CA X-RootMTR: 20200821161406eucas1p121553719d4e9cc020d2c557a69000f0c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161406eucas1p121553719d4e9cc020d2c557a69000f0c References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Remove descriptions for non-existent fields and fix indentation. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- 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 433b9d77b914..6381a7557def 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 Fri Aug 21 16:13:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11730039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49EBB15E4 for ; Fri, 21 Aug 2020 17:29:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E5FA22BF3 for ; Fri, 21 Aug 2020 17:29:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HIVLq6e4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727936AbgHUR3b (ORCPT ); Fri, 21 Aug 2020 13:29:31 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38787 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbgHUQOV (ORCPT ); Fri, 21 Aug 2020 12:14:21 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161408euoutp02f6d6fefcafb683476d89b3800dee1f7b~tVJaQVvNA0393803938euoutp02U for ; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161408euoutp02f6d6fefcafb683476d89b3800dee1f7b~tVJaQVvNA0393803938euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026448; bh=UU83HvZa8Yjdm2hI09P/AOUI/1Uzpv5njQG9t3z9YZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HIVLq6e4g00Sm87HZLXlBpem70x64gvg60JcIjLiYQDxjlWehnm6KZaqLjQd+8hIh /Alk/WMaZotaid5LZ7dvxWrG85PVfDt5qQRrUtbp8feR36v5+U95DwK1XXtNf0aTmB m9uPxh0vl07e27xeNUId9xczTNf47flOLJmuyG1U= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200821161407eucas1p1372792605e4f6365b7c46882fa660f8c~tVJZsHQPW1516315163eucas1p1e; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 98.D9.06456.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eucas1p116af63a668bdbb75fa974589e5f6139f~tVJZBsn9i0797107971eucas1p1X; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161407eusmtrp2f835d2d7162d3cf5448a525bc761cdd5~tVJZBG4jf2998229982eusmtrp2g; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-d9-5f3ff2cf2286 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DB.17.06314.EC2FF3F5; Fri, 21 Aug 2020 17:14:06 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200821161406eusmtip19910d1e8fe8f987164954fb383ca7c1a~tVJYzATYO1593515935eusmtip1y; Fri, 21 Aug 2020 16:14:06 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 6/9] spi: spi-s3c64xx: Check return values Date: Fri, 21 Aug 2020 18:13:58 +0200 Message-Id: <20200821161401.11307-7-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEKsWRmVeSWpSXmKPExsWy7djPc7rnP9nHG3z4qmOx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8bh9w3sBWfVKmYuncbWwLhZ vouRk0NCwETieNd7ti5GLg4hgRWMEp23/jBBOF8YJU7dX80K4XxmlNjWfZ8JpmXFy7NQLcsZ Ja50T4Jqec4oca15MxtIFZuAo0T/0hNg7SICE5gkHp57A5ZgFiiV6Nl5CMwWFrCVuNY5A2ws i4CqxMJbS1hBbF4Ba4l926ewQqyTl2hfvh2snlPARuL4pSaoGkGJkzOfsIDY/AJaEmuarrNA zJeXaN46mxlksYTAOXaJJe+2sUAMcpHYfvkPG4QtLPHq+BZ2CFtG4v/O+UBHcADZ9RKTJ5lB 9PYA/TznB1SvtcSdc7/YQGqYBTQl1u/Shwg7Siye8IYNopVP4sZbQYgT+CQmbZvODBHmleho E4KoVpFY178HaqCURO+rFYwTGJVmIXlmFpIHZiHsWsDIvIpRPLW0ODc9tdgwL7Vcrzgxt7g0 L10vOT93EyMwJZ3+d/zTDsavl5IOMQpwMCrx8P44ZB8vxJpYVlyZe4hRgoNZSYTX6ezpOCHe lMTKqtSi/Pii0pzU4kOM0hwsSuK8xotexgoJpCeWpGanphakFsFkmTg4pRoYcwPOnNvK4RZl ++VX4ATmFdPDPVeWMgppW5v88hSKszv9dtur02mSJ9ekmD8x3DbX+nbj8e3Ozf//b0hp4hPm sKw8nZVz/uXnr1eDfhe56olKazw916Xrtt1SM1T6TKXdFaFtxz0/Xu6TXW3Sf0xLb/dao/L/ zifX5z5wkrzqtfDdDOat/zM+KLEUZyQaajEXFScCAP0280pFAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsVy+t/xu7rnPtnHG2zcYGOx+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGuUnk1RfmlJqkJGfnGJrVK0oYWRnqGlhZ6RiaWeobF5 rJWRqZK+nU1Kak5mWWqRvl2CXsbh9w3sBWfVKmYuncbWwLhZvouRk0NCwERixcuzbF2MXBxC AksZJVZd+MjexcgBlJCSWDk3HaJGWOLPtS6omqeMEnu+72AESbAJOEr0Lz3BCpIQEZjBJPHk xmRWkASzQLnEpVnP2UFsYQFbiWudM5hAbBYBVYmFt5aA1fAKWEvs2z6FFWKDvET78u1sIDan gI3E8UtNYHEhoJptiy+zQNQLSpyc+YQF5DhmAXWJ9fOEQML8AloSa5qus0CslZdo3jqbeQKj 0CwkHbMQOmYhqVrAyLyKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMjMP62Hfu5eQfjpY3BhxgF OBiVeHh/HLKPF2JNLCuuzD3EKMHBrCTC63T2dJwQb0piZVVqUX58UWlOavEhRlOgNycyS4km 5wNTQ15JvKGpobmFpaG5sbmxmYWSOG+HwMEYIYH0xJLU7NTUgtQimD4mDk6pBsYax5XFEYrZ wX737LP6dWeH9+VMPFi39kB/w9VdoYxPJn5KTdT6/lGCaaOEtOV9Tp3s8EP9rxmk1hjFHytZ s2GHV/Gx7W+ZGZ6L7H+wzmbaal/d3rKnMb8edMvyh/pJn3PMk9+Rlvf9ALNpfU3QAfZUHTfP nnXcGfF90mEH8p10yzfW3Wk4psRSnJFoqMVcVJwIANHYjyLVAgAA X-CMS-MailID: 20200821161407eucas1p116af63a668bdbb75fa974589e5f6139f X-Msg-Generator: CA X-RootMTR: 20200821161407eucas1p116af63a668bdbb75fa974589e5f6139f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161407eucas1p116af63a668bdbb75fa974589e5f6139f References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org 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. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 47 ++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 6381a7557def..02de734b8ab1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -269,12 +269,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)); @@ -298,12 +299,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; 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) @@ -353,11 +366,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); @@ -383,7 +397,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: @@ -415,12 +429,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, @@ -553,9 +572,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 */ @@ -603,7 +623,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); @@ -617,6 +639,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) @@ -659,7 +683,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) && @@ -686,10 +712,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 Fri Aug 21 16:13:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11730045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC61E1731 for ; Fri, 21 Aug 2020 17:29:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94FD022BEA for ; Fri, 21 Aug 2020 17:29:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HwT8AwNG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbgHUR3i (ORCPT ); Fri, 21 Aug 2020 13:29:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38842 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726919AbgHUQOV (ORCPT ); Fri, 21 Aug 2020 12:14:21 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161408euoutp0258cc353df1b9f99109db865ba3a4a90e~tVJaJ33240696006960euoutp02E for ; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161408euoutp0258cc353df1b9f99109db865ba3a4a90e~tVJaJ33240696006960euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026448; bh=ELtloJOmnPn+Z5FT9bjX2f4AQc1qGik0EonV1Nsy8yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HwT8AwNGH9XHwQ126s0HzoxR/FplwnzZiYl8bpir0rDBe0w99mPAhyTWxlNSLNvQS 4bSWcEyiBzWgP6DsB45Bnx8XHhORrcmhEEbHbAAd3Jfg1tXLJ6dfTMerCjJphYBie+ 1sfImtpESYeqkACLqVZGwLnmCvbEIKNDcL7hHN8c= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200821161407eucas1p1a2d41ca21fb435b7f8245db4846c33a9~tVJZpUPP50799907999eucas1p1g; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D1.AE.05997.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2~tVJZTohaQ2033420334eucas1p2g; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161407eusmtrp22df030d66edc36898d86dff9387529e4~tVJZTB1i42998229982eusmtrp2h; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-c6-5f3ff2cfcec8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AC.17.06314.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eusmtip20e88d7dc8b87e49bb3c07ed8a38d71a4~tVJZICu6-3023630236eusmtip2T; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= , Tomasz Figa Subject: [PATCH v2 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Date: Fri, 21 Aug 2020 18:13:59 +0200 Message-Id: <20200821161401.11307-8-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02SfSyUcRzA+91zz3OPm+NxbL5Jtd2yOhuK2LN5N39c/5Q/ar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8u75rBZzDi/j8mi8eNNdou1R+6yW3xu/cfm wOMxu+Eii8f1JZ+YPTat6mTz2Lyk3qNvyypGj8+b5ALYovRsivJLS1IVMvKLS2yVog0tjPQM LS30jEws9QyNzWOtjEyV9O1sUlJzMstSi/TtEvQytj1/wV6wka3i5UrxBsbFrF2MnBwSAiYS J89+B7K5OIQEljJKfPyymbmLkQMoISWxcm46RI2wxJ9rXWwgtpDAU0aJf81FIDabgKNE/9IT YL0iAjOYJJ7cmAzmMAvMZpTo/9HMAlIlLBAsMengXkYQm0VAVeLV/wVgk3gFrCU6tu5ihtgg L9G+fDtYnFPARuL4pSZWiG3WEtsWX2aBqBeUODnzCQvIccwC6hLr5wmBhPkFtCTWNF0HK2EG GtO8dTbzBEahWUg6ZiF0zEJStYCReRWjSGppcW56brGhXnFibnFpXrpecn7uJkZgRG479nPz DsZLG4MPMQpwMCrx8P44ZB8vxJpYVlyZe4hRgoNZSYTX6ezpOCHelMTKqtSi/Pii0pzU4kOM pkBvTmSWEk3OByaLvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFIN jBbdB+VM//bwN3P3b9L7qrb34r2tDVprt2b3y4TpWR81vPpnnb/epnsTLV3rXAp3VwoeLDt5 wTvr03WXQzu+rdz7375JuTR2X33lidntntcCny1PEvT7umHis1t3/byiGw9Y3nWP+7Tyydl0 Q+XMN/V/T8z6FPts7noZy44qk2gvTiaXDzaTw5VYijMSDbWYi4oTAcS6UfjeAgAA X-CMS-MailID: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 X-Msg-Generator: CA X-RootMTR: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org cur_speed is used to calculate transfer timeout and needs to be set to the actual value of (half) the clock speed for precise calculations. Cc: Tomasz Figa Signed-off-by: Łukasz Stelmach --- 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 Fri Aug 21 16:14:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11729907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2083109B for ; Fri, 21 Aug 2020 16:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA83E22B4E for ; Fri, 21 Aug 2020 16:14:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Ofdfivze" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726989AbgHUQOi (ORCPT ); Fri, 21 Aug 2020 12:14:38 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37233 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbgHUQON (ORCPT ); Fri, 21 Aug 2020 12:14:13 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161409euoutp018dee6e20e2ea3df1f47ae4400ec1da8e~tVJbCQhQh2432124321euoutp01N for ; Fri, 21 Aug 2020 16:14:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200821161409euoutp018dee6e20e2ea3df1f47ae4400ec1da8e~tVJbCQhQh2432124321euoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026449; bh=Dxb1SZqMxibqUhl7VyWNPNEmP5zeKa3acFNVfEqRw/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfdfivzeID+QoggnK8XOEVNIPQgAVgy9s/4/dsDxCMcelyYsqZ55fFVQAzWqAo9p1 LVDhQCO5AzEl4hiPYlEALMMCb3+8TEgq8qqFTFUEZtghWqtPG/6ypFp2gHHbMVzqaz 29WbXxGh/96oueBnmCJ50Xq98W9pV40VLuVbgGSI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161408eucas1p2cafb7eeed6d5b4efac5898f5a39f8204~tVJaHwHFv1578115781eucas1p2l; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 05.B2.06318.0D2FF3F5; Fri, 21 Aug 2020 17:14:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eucas1p23a283ac117d4381e087e9bacec537665~tVJZrBcp81823418234eucas1p2m; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200821161407eusmtrp10acbb38b7aa0954ac61f8e63a2c5ccda~tVJZqYXBt1179011790eusmtrp19; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-d5-5f3ff2d0fc0e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E2.B9.06017.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eusmtip2fe0ec413613697189cd2361948227403~tVJZdOHJ_2051720517eusmtip2n; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 8/9] spi: spi-s3c64xx: Increase transfer timeout Date: Fri, 21 Aug 2020 18:14:00 +0200 Message-Id: <20200821161401.11307-9-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIKsWRmVeSWpSXmKPExsWy7djPc7oXPtnHG/zv5LNY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK2P19tfsBbs4KjoWTmZtYHzG 1sXIySEhYCJx7/hupi5GLg4hgRWMEicutjNDOF8YJX5NWsMEUiUk8JlR4sjmAJiO/b0HWSGK ljNKnN40hx3Cec4osa9pEStIFZuAo0T/0hNgVSICE5gkHp57A7aQWaBUomfnITBbWMBZ4sm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K8Qya4ltiy+zQNQLSpyc+QTsNmYBdYn184RAwvwCWhJrmq6zQKyVl2jeOpt5AqPQLCQd sxA6ZiGpWsDIvIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMw+rYd+7llB2PXu+BDjAIcjEo8 vD8O2ccLsSaWFVfmHmKU4GBWEuF1Ons6Tog3JbGyKrUoP76oNCe1+BCjKdCbE5mlRJPzgYkh ryTe0NTQ3MLS0NzY3NjMQkmct0PgYIyQQHpiSWp2ampBahFMHxMHp1QDo7xZd5Szt3//6eNX MxcLvvwbPD2Rp6T13+Lrisa/2VTmu7Iu1WK1bRFaUB3QssG843jhL2/x/ZPK4+efnxn81lcs O+9rh4/r/F5N8ZrerM0qU67fNJigMb3OrDDksETE6kc3BWUrXn9aYp0TarCM+R13vv3uKYp7 nj5ZohCxdXLSpYgrhgGPlFiKMxINtZiLihMBWyc9dNQCAAA= X-CMS-MailID: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 X-Msg-Generator: CA X-RootMTR: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Increase timeout by 30 ms for some wiggle 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. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- 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 Fri Aug 21 16:14:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11730049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 215A31392 for ; Fri, 21 Aug 2020 17:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0156F20656 for ; Fri, 21 Aug 2020 17:30:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Ff3yudBM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728073AbgHUR35 (ORCPT ); Fri, 21 Aug 2020 13:29:57 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37250 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbgHUQOO (ORCPT ); Fri, 21 Aug 2020 12:14:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161409euoutp014045bad267307e1642196c011dfe4cbb~tVJbHkcOK2473324733euoutp01D for ; Fri, 21 Aug 2020 16:14:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200821161409euoutp014045bad267307e1642196c011dfe4cbb~tVJbHkcOK2473324733euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026449; bh=f9ZoaiPzWLgD51UeFyh+Y/m4lqI80t9LqJw5EDwV3o4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ff3yudBMCM3oSkyke0r7TiTSjNobWWAzURQDgSfqlAAEyvpq3nE09kvfhmHJcmRB9 u+HoqkvM1vJqB05iAqPsIl+oJ/D5RjcIV5r9MGjcEPzLDjT2fN2M1unG8gwRaY/27Z 0V/zue6jR1XOxWQ2HUg+Djr+ME2ya/9WbGFM/+t0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161408eucas1p2f219698ed28e48498174566d657bb905~tVJaP7GNV1780817808eucas1p2i; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 59.D9.06456.0D2FF3F5; Fri, 21 Aug 2020 17:14:08 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200821161408eucas1p196aa4b954b3d19ad1b89a48dbbe41fbc~tVJZ9b1760797107971eucas1p1Y; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161408eusmtrp2a6fdfcf29771ff7b7170690ca3f78348~tVJZ80IoL2998229982eusmtrp2i; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-da-5f3ff2d0505d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7D.17.06314.0D2FF3F5; Fri, 21 Aug 2020 17:14:08 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eusmtip2b56ff438e1c05e1bcd9f07b3c42427d2~tVJZyH58K3023630236eusmtip2U; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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?q?=C5=81ukas?= =?utf-8?q?z_Stelmach?= Subject: [PATCH v2 9/9] spi: spi-s3c64xx: Turn on interrupts upon resume Date: Fri, 21 Aug 2020 18:14:01 +0200 Message-Id: <20200821161401.11307-10-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djP87oXPtnHGxy9L2ax+MdzJouNM9az Wkx9+ITNov/xa2aL8+c3sFvcPLSC0WLT42usFpd3zWGzmHF+H5NF48eb7BZrj9xld+D2uL7k E7PHplWdbB6bl9R79G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8by2UvZCraxVfz4N4mpgXEH axcjJ4eEgInE+iuzmLoYuTiEBFYwSly+v4UFwvnCKDF7z2qwKiGBz4wS/6d6w3Qcv7udHaJo OaPEnWczWCGc54wSWz7OYAKpYhNwlOhfegIsISIwgUni4bk3bCAJZoFSiZ6dh8BsYQEPicNf tzGC2CwCqhKH73WBxXkFbCQ2ntzJDrFOXqJ9+XawOCdQ/PilJlaIGkGJkzOfsIDY/AJaEmua rrNAzJeXaN46mxlksYTAOXaJnVM/MUIMcpFYMvMo1FBhiVfHt0DZMhL/d84HupoDyK6XmDzJ DKK3h1Fi25wfLBA11hJ3zv1iA6lhFtCUWL9LH6LcUeLCBA8Ik0/ixltB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GaAr05kVlKNDkf mBjySuINTQ3NLSwNzY3Njc0slMR5OwQOxggJpCeWpGanphakFsH0MXFwSjUwGkyUW3x6S/vN mA6NqN039eu3vVQQO73dwHp+lIn60dN+cpGim4w2uD95o/4kWHJ/fiQT614GP/EfXbsZue9n vzmnZPi74sYLXZFPO6Yy/agMun3NZLnUj9JDEa/K+6PvV319m/gzd8m9yL7k2aEsqdvjphX9 f7G314ll5oxfM0+kzUl+fVLpqRJLcUaioRZzUXEiAMi6GibUAgAA X-CMS-MailID: 20200821161408eucas1p196aa4b954b3d19ad1b89a48dbbe41fbc X-Msg-Generator: CA X-RootMTR: 20200821161408eucas1p196aa4b954b3d19ad1b89a48dbbe41fbc X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161408eucas1p196aa4b954b3d19ad1b89a48dbbe41fbc References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org 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. Signed-off-by: Łukasz Stelmach Reviewed-by: Krzysztof Kozlowski --- 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: