From patchwork Wed Aug 19 12:32: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: 258287 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 3FD0FC433DF for ; Wed, 19 Aug 2020 12:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 177D8206FA for ; Wed, 19 Aug 2020 12:32:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="PSroFa98" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728106AbgHSMce (ORCPT ); Wed, 19 Aug 2020 08:32:34 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60627 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727930AbgHSMc2 (ORCPT ); Wed, 19 Aug 2020 08:32:28 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200819123226euoutp027f69b40d3c6bfa40eccbf3a879fc22d6~sq1RqzmAV1325613256euoutp02y for ; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200819123226euoutp027f69b40d3c6bfa40eccbf3a879fc22d6~sq1RqzmAV1325613256euoutp02y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597840346; bh=ehEA55cTOHzp/hMa1IHkDqb7+RqzzRP8GducSwbT9uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSroFa98Fmed1nwxfcqjXMuudOEqxwg6Tx7356ZYtuUtsyiWGjEpxFgDbmDiWzioI i1awtD96oK8O46+kNtNA81FdeiBn0fJ4onSmDdJ2G81cLoUMfUjimEplFOhAGjyHBN 07M+Oh76hBt8eAUNaDpqk/5WORFqFBJC4UVHswB8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200819123226eucas1p2282009f27d2a3a6f20cee2b474ee357a~sq1RR8ZIx3168631686eucas1p2G; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 42.FC.05997.ADB1D3F5; Wed, 19 Aug 2020 13:32:26 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200819123226eucas1p16c9b90330d957344f99f6ee461190085~sq1RA90g21043110431eucas1p19; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200819123226eusmtrp229df06d59e344512679ff5ccc252e348~sq1Q-hoDU2933429334eusmtrp2R; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-3b-5f3d1bda48c8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 32.DF.06314.ADB1D3F5; Wed, 19 Aug 2020 13:32:26 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200819123225eusmtip22c5abf3c7b70d51305b66d17f306f693~sq1Q3Cpdz3236932369eusmtip2O; Wed, 19 Aug 2020 12:32:25 +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?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH 1/8] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath() Date: Wed, 19 Aug 2020 14:32:01 +0200 Message-Id: <20200819123208.12337-2-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200819123208.12337-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPKsWRmVeSWpSXmKPExsWy7djPc7q3pG3jDSb/lrBY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK+Ph9d2sBZPYKm6sf8DSwNjN 2sXIySEhYCJxZtd09i5GLg4hgRWMEssmT2KGcL4wSsw8fYURwvnMKHHzPUgLB1hL64IIiPhy RokPXy+xQjjPGSU6T99lAZnLJuAo0b/0BFhCRGACk8TDc2/YQBLMAqUSPTsPgdnCAgkS345O YAeZyiKgKtGytxIkzCtgLTFl33kmiPvkJdqXbwcr5xSwkXj4awobRI2gxMmZT8B28QtoSaxp us4CMV5eonnrbGaI3nPsEr86uCFsF4lTS2FmCku8Or6FHcKWkfi/cz4Tx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G4EOMAhyM Sjy8Fees44VYE8uKK3MPMUpwMCuJ8DqdPR0nxJuSWFmVWpQfX1Sak1p8iNEU6MuJzFKiyfnA pJBXEm9oamhuYWlobmxubGahJM7bIXAwRkggPbEkNTs1tSC1CKaPiYNTqoGxX8Xe6f5MjWwz 9qXHG99nH+NvC+p+4Hp21SGGmL70EyJ6Rh9vLn+9R491/9/XhX9szzmuSH7iMVHTOShwy4de VwatKYrPDyyc9L0+JXNtoeO3Yo3P63WMjP/Zf/jLZOXoVlh1x+1GiDNrUltrqXbx40+XujUY 12eEb3275ZLSh5wpj8QeKrAosRRnJBpqMRcVJwIA2w7Ux9ICAAA= X-CMS-MailID: 20200819123226eucas1p16c9b90330d957344f99f6ee461190085 X-Msg-Generator: CA X-RootMTR: 20200819123226eucas1p16c9b90330d957344f99f6ee461190085 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200819123226eucas1p16c9b90330d957344f99f6ee461190085 References: <20200819123208.12337-1-l.stelmach@samsung.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Fix issues with DMA transfers bigger than 512 on Exynos3250. 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 cf67ea60dc0e..fb5e2ba4b6b9 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -678,11 +678,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 Wed Aug 19 12:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 258286 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 BBF03C433E1 for ; Wed, 19 Aug 2020 12:32:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 965FF206FA for ; Wed, 19 Aug 2020 12:32:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="jJ9wvAcz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbgHSMct (ORCPT ); Wed, 19 Aug 2020 08:32:49 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60173 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727930AbgHSMch (ORCPT ); Wed, 19 Aug 2020 08:32:37 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200819123227euoutp0109687d0e9521fd305896730b40fadadb~sq1SagNII2727427274euoutp01j for ; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200819123227euoutp0109687d0e9521fd305896730b40fadadb~sq1SagNII2727427274euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597840347; bh=bD6acsWiSYtcxnLapp4okxd9iLVm6ou2mGNH7IDBWDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJ9wvAczDuFORSya0itZUngf79/lqHNTzGFumbhq4LuDfmoRaLdqyOMDv0mEz6qtG NaQIAhHgAUAaMumE9wLYW9vD5khbuVYsLRslGV4ZOd0IPjGLlHRgaT4ICi9NbkljGP QbAXRLQPNdVEeLETWXv9/4Sc3h5PcVr+gIE/3pb0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200819123227eucas1p21864bf4b7d237f4ffcfa7cbaf126be7a~sq1SBssiJ2958529585eucas1p2S; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C3.FC.05997.BDB1D3F5; Wed, 19 Aug 2020 13:32:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200819123226eucas1p2dc50cd60f71f2155524ec21bf4dcdd74~sq1Rsc4hE2428624286eucas1p2J; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200819123226eusmtrp1ddbce7041bdae136f2a3618dc98d54ba~sq1Rrw1-W1680116801eusmtrp18; Wed, 19 Aug 2020 12:32:26 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-3d-5f3d1bdb5791 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3E.63.06017.ADB1D3F5; Wed, 19 Aug 2020 13:32:26 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200819123226eusmtip1a68e77ea0c68b513f6c34ad23bfb81bb~sq1RgttCh3139831398eusmtip1Y; Wed, 19 Aug 2020 12:32:26 +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?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH 3/8] spi: spi-s3c64xx: Report more information when errors occur Date: Wed, 19 Aug 2020 14:32:03 +0200 Message-Id: <20200819123208.12337-4-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200819123208.12337-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01SfSyUcRzf757nnnscp8ex+Y5K3eqP5KW32WNonRr3V2v9U2y5rjwd6+7o HkRrKC2y8zIvkawUxizhHC6Z1dUQuSu2ZIVulJJMoXG11N3D8t/n9/u8fD/f334kJm7ie5Hx miRGq1GoJIQQb+9Zsfi/8w6T7xlbFNLVy9M8uqW8iU+XWqcIumDyK0ZbLM0CetRUj2j95Bs+ PdxZSdDllm4efeX7qIBufD4mOOQsG6n5gcn0DTcIWWtNhizf0IBkC/qtx/jRwtBYRhWfwmgD D54Wxlm7p/DEfip14aeBn4lKRbnIiQTqAFTZOni5SEiKqXoEtY/H+dxhEcHyyJM1ZgHBSE4e lotIh2VuzsvuFlN1CJ4uRXKaaQT14724nSAoKRTU9jmSPKhCHljNs4SdwKhk0D0yObA7dRxW 2/oEdoxTO6G8a55nxyIqBAZWDAKunw9k13U49E5UKFhtJQSncYMXt6YcwzZRvvDg6gjO5ftA VtttjPOaBTBfJ+XwETB/shIcdoeZ3vX8zTBQrMO5x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wpiZVVqUX58UWlOanFhxhNgd6cyCwlmpwP TAt5JfGGpobmFpaG5sbmxmYWSuK8HQIHY4QE0hNLUrNTUwtSi2D6mDg4pRoYdx6W/yCQYVah /NIvRlsgOixKUvFHwg/R7dtEMra0Tu/h+h36V/3hlt8fJy1PeHDsztxzxXM9XBTyWg+vZBWQ vjRd9vwxz+TE3+0Lk1IOPwr88UQuZOUM6zlG5yyu3NvSuVjmX9IlqVNB85+735n1MPLsrW1H H06+kyha/sfzwA/njLatq+N9C5RYijMSDbWYi4oTASYPkNHTAgAA X-CMS-MailID: 20200819123226eucas1p2dc50cd60f71f2155524ec21bf4dcdd74 X-Msg-Generator: CA X-RootMTR: 20200819123226eucas1p2dc50cd60f71f2155524ec21bf4dcdd74 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200819123226eucas1p2dc50cd60f71f2155524ec21bf4dcdd74 References: <20200819123208.12337-1-l.stelmach@samsung.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 --- 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 8fe44451d303..4ab68cd1b821 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; }; @@ -297,7 +298,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); } @@ -692,17 +693,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 Wed Aug 19 12:32:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 258283 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 BBBFAC433E3 for ; Wed, 19 Aug 2020 12:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B75A206FA for ; Wed, 19 Aug 2020 12:35:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="aqYUErki" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbgHSMf1 (ORCPT ); Wed, 19 Aug 2020 08:35:27 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60714 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728063AbgHSMch (ORCPT ); Wed, 19 Aug 2020 08:32:37 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200819123228euoutp020d3380d620f1cdc92a88d08083380b48~sq1S1jV9t1342313423euoutp02i for ; Wed, 19 Aug 2020 12:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200819123228euoutp020d3380d620f1cdc92a88d08083380b48~sq1S1jV9t1342313423euoutp02i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597840348; bh=7RCmfy2p+tT9CWqfwKdINiZGD57fYFdZKszRWdqclLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqYUErkiTZY2d+t92e7yUG95Qsc8HY7v+J//txDKQAAQ4gyadLxW4WvOo3EuAcUhZ RKAf4n58Y0Zztggu3oEaLCs5qWg80i1e3ZZ8vuKER4ZjtKv/fqyBpy6ECTiszd9CmA jV/+2sf3owItngX1EjRCvSDfp+ICU+ZN294l2d1M= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200819123227eucas1p2b5d318b29d9265a27126b4d221e9ed2c~sq1SagGCA2428624286eucas1p2K; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 97.3B.06456.BDB1D3F5; Wed, 19 Aug 2020 13:32:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eucas1p1f56cc06dc6c368abf2d3952ba04f37e2~sq1SESBNx1242912429eucas1p12; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200819123227eusmtrp1bec799b243d3a44abacec1d81b1dccd6~sq1SDl9801680116801eusmtrp19; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-af-5f3d1bdb9d64 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FE.63.06017.BDB1D3F5; Wed, 19 Aug 2020 13:32:27 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eusmtip2311306ee4d46a3cabcc7dae369dde216~sq1R1pO6Z0167401674eusmtip2W; Wed, 19 Aug 2020 12:32:27 +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?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH 4/8] spi: spi-s3c64xx: Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* Date: Wed, 19 Aug 2020 14:32:04 +0200 Message-Id: <20200819123208.12337-5-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200819123208.12337-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djPc7q3pW3jDRY8UrRY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK2PLtyamgt8iFbPnNbE3MO4Q 7GLk5JAQMJF4+HUPYxcjF4eQwApGiadN09kgnC+MErdW/GYBqRIS+Mwo0f88BKZjy+9TrBBF yxklpl2+wQZR9JxR4lhXPYjNJuAo0b/0BFiRiMAEJomH596AFTELlEr07DwEZgsLhEs0r1nP BGKzCKhK7D58EizOK2At0bfhCjPENnmJ9uXbweKcAjYSD39NgaoRlDg58wnYdfwCWhJrmq6z QMyXl2jeOpsZZLGEwDl2ibnvN7JDDHKRmH+hjQ3CFpZ4dXwLVFxG4vTkHqBmDiC7XmLyJDOI 3h5GiW1zfrBA1FhL3Dn3iw2khllAU2L9Ln2IsKPEvFlLmCFa+SRuvBWEOIFPYtK26VBhXomO NiGIahWJdf17oAZKSfS+WsE4gVFpFpJnZiF5YBbCrgWMzKsYxVNLi3PTU4sN81LL9YoTc4tL 89L1kvNzNzEC09Hpf8c/7WD8einpEKMAB6MSD2/FOet4IdbEsuLK3EOMEhzMSiK8TmdPxwnx piRWVqUW5ccXleakFh9ilOZgURLnNV70MlZIID2xJDU7NbUgtQgmy8TBKdXA2P/hX2Drk7+f ZA85Gy//vM2V4ZByzNrYyfO2FebeSHqRskBd7kOuYkLsMwbLLx8LGZy3dJzM/ibQa7ZrqqnX 8Y1huRs38T0L2ma/vbRk93a95sjjK+fFbNj36Kp/acOr2Ruk/A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ator: CA X-RootMTR: 20200819123227eucas1p1f56cc06dc6c368abf2d3952ba04f37e2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200819123227eucas1p1f56cc06dc6c368abf2d3952ba04f37e2 References: <20200819123208.12337-1-l.stelmach@samsung.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* to match documentation. Signed-off-by: Łukasz Stelmach --- 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 4ab68cd1b821..6fe896f2be18 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) @@ -312,18 +312,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); } } @@ -944,9 +944,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 Wed Aug 19 12:32:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 258285 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 B3616C433E3 for ; Wed, 19 Aug 2020 12:33:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 900DA20738 for ; Wed, 19 Aug 2020 12:33:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="NuaimugX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbgHSMdQ (ORCPT ); Wed, 19 Aug 2020 08:33:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60199 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728137AbgHSMck (ORCPT ); Wed, 19 Aug 2020 08:32:40 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200819123228euoutp010d21f811ff83b379cad9ddf2aa67cab2~sq1Tb6YRC2980229802euoutp01f for ; Wed, 19 Aug 2020 12:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200819123228euoutp010d21f811ff83b379cad9ddf2aa67cab2~sq1Tb6YRC2980229802euoutp01f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597840348; bh=dodgnAl4aQ9JHWLPjyth7Ek4AxDLNCjB7Q2ZDPyW0+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuaimugXLZRMElQAh0R57Va8jTcXjQ+CLPfqgkupGN/YUmXwiQdOXpF+umTE7fwMw Pkko905kbX9EUpjKaLzBpO+rjiby1HTK8Wy7rwobXdjhLBYsmxBRblnaRVoWmi0kC5 fxIBFtf78UYCoykM1gs6gDgDbGiYe/JZ4G49cBGA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200819123228eucas1p28ecf3a4492d5091978a0d8f59aa69301~sq1TERT9k2958529585eucas1p2U; Wed, 19 Aug 2020 12:32:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 58.3B.06456.CDB1D3F5; Wed, 19 Aug 2020 13:32:28 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604~sq1Sp-jTa0820708207eucas1p1J; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200819123227eusmtrp2101a6bb48ffcd56dc7f5fbb9180c5bb3~sq1SpYy982883128831eusmtrp2j; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-b2-5f3d1bdcc277 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 34.DF.06314.BDB1D3F5; Wed, 19 Aug 2020 13:32:27 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eusmtip28a317d3b9767d8c4e833ddbc2aa0ead6~sq1SgmJje0116101161eusmtip2W; Wed, 19 Aug 2020 12:32:27 +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?b?xYF1a2Fz?= =?utf-8?q?z_Stelmach?= Subject: [PATCH 6/8] spi: spi-s3c64xx: Check return values Date: Wed, 19 Aug 2020 14:32:06 +0200 Message-Id: <20200819123208.12337-7-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200819123208.12337-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIKsWRmVeSWpSXmKPExsWy7djP87p3pG3jDZ7fELZY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK6N/8gKWgpucFf/W/GVsYGzg 6GLk5JAQMJGYt/wNUxcjF4eQwApGiTmLdzNCOF8YJV5vn88C4XxmlFh5ZDkLTMvsri1QieWM Er0nZkE5zxklfu1/xAZSxSbgKNG/9AQrSEJEYAKTxMNzb8ASzAKlEj07D4HZwgJWEqtmHwUb yyKgKvG0r5ERxOYVsJY4sWEiE8Q6eYn25dvB6jkFbCQe/prCBlEjKHFy5hOwXn4BLYk1TddZ IObLSzRvnc0MslhC4By7xPsJ54CGcgA5LhKnLwlCzBSWeHV8CzuELSPxf+d8JoiSeonJk8wg WnsYJbbN+QH1srXEnXO/2EBqmAU0Jdbv0ocIO0ps/LoUqpVP4sZbQYgL+CQmbZvODBHmleho E4KoVpFY178HaqCURO+rFYwTGJVmIfllFpL7ZyHsWsDIvIpRPLW0ODc9tdgwL7Vcrzgxt7g0 L10vOT93EyMw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x2ZfX6Qo/uyTq7n4ajf3t1r/iMAHeWc0l4nEqd46t8Lu/u/ZGtn3uTzPnPG7Nmd2TG/M niX/ZHYY1KWaKKuo36jcebXiYn+a+I+AlztPr93qzcASYSp+8Y79+pPak53jnp//zXz5Tud+ 4z3pevH+Zv+XyOeW3Lx6JVJUiaU4I9FQi7moOBEA3rAYbtQCAAA= X-CMS-MailID: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 X-Msg-Generator: CA X-RootMTR: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 References: <20200819123208.12337-1-l.stelmach@samsung.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Signed-off-by: Łukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 505789f91fdf..27d77600a820 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -273,6 +273,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, struct s3c64xx_spi_driver_data *sdd; struct dma_slave_config config; struct dma_async_tx_descriptor *desc; + int ret; memset(&config, 0, sizeof(config)); @@ -296,11 +297,22 @@ 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; + } 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, "dmaengine_submit() failed %d", ret); + return; + } + dma_async_issue_pending(dma->ch); }