From patchwork Fri Oct 2 12:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 287027 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 A9E3BC47426 for ; Fri, 2 Oct 2020 12:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77F3420719 for ; Fri, 2 Oct 2020 12:23:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="YYUL8CBe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387918AbgJBMXT (ORCPT ); Fri, 2 Oct 2020 08:23:19 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54168 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387892AbgJBMW6 (ORCPT ); Fri, 2 Oct 2020 08:22:58 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201002122253euoutp023048dbc133ab341916985c13143c6fb7~6LFfzqX2B2196421964euoutp02H for ; Fri, 2 Oct 2020 12:22:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201002122253euoutp023048dbc133ab341916985c13143c6fb7~6LFfzqX2B2196421964euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601641373; bh=iXskg/sx29oFhxvkuUJCTKesUirKCfDhLmYOrideYI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYUL8CBevNMnnWB5+a4bJ7zp/2/IAMUn2jXJx3sk9RKs2YmIhQKI/o7uoKDaqnwNU 9Ezmp/koB/OBUJ/OoEgafNYh0/XxjUkzcqkXdbm2jrWAmVmtACu0ZwDBWfdvH9lgxQ PpxjD7+9JrxGb3geY5qo9ok0aoH5H8gF12sNikNM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201002122253eucas1p29500b4eab654b6b88bfbbb001d8eba76~6LFfUQQQH1017010170eucas1p2y; Fri, 2 Oct 2020 12:22:53 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0D.EB.05997.D9B177F5; Fri, 2 Oct 2020 13:22:53 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201002122252eucas1p1496d896453d21acda6ab83ef9b7f0b8a~6LFe1JcCP0998409984eucas1p18; Fri, 2 Oct 2020 12:22:52 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201002122252eusmtrp28e2b31faae470ee4be13388ae961c29f~6LFe0knR00251002510eusmtrp2S; Fri, 2 Oct 2020 12:22:52 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-51-5f771b9d0384 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9F.B0.06017.C9B177F5; Fri, 2 Oct 2020 13:22:52 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201002122252eusmtip118bf3517dc183d5f8db4a6598c647f5b~6LFemdknH0635906359eusmtip1P; Fri, 2 Oct 2020 12:22:52 +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: Marek Szyprowski , =?utf-8?q?Bart=C5=82omiej?= =?utf-8?b?IMW7b8WCbmllcmtpZXdpY3o=?= , =?utf-8?q?=C5=81ukasz_Stelmach?= Subject: [PATCH v3 4/9] spi: spi-s3c64xx: Report more information when errors occur Date: Fri, 2 Oct 2020 14:22:38 +0200 Message-Id: <20201002122243.26849-5-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002122243.26849-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFKsWRmVeSWpSXmKPExsWy7djP87pzpcvjDToWcVos/vGcyWLjjPWs FlMfPmGz6H/8mtni/PkN7BY3D61gtNj0+BqrxeVdc9gsZpzfx2TR+PEmu8XaI3fZLVbt+sPo wONxfcknZo+ds+6ye2xa1cnmsXlJvUffllWMHp83yQWwRXHZpKTmZJalFunbJXBlzL03j7ng Jm/Fg00nmRoY33J1MXJySAiYSLw9+Iyli5GLQ0hgBaPE2jUnmCCcL4wSX6Y3MoFUCQl8ZpSY cbsCpmPBmT/MEEXLGSVed/5ig3CeM0os6prOCFLFJuAo0b/0BCtIQkRgO5PExM/nwZYwCxxl lNj84CqQw8EhLBAq8XSZIIjJIqAqcfKxDkgvr4C1xK41TWwQ2+Ql2pdvB7M5BWwkTi7axgZR IyhxcuYTFhCbX0BLYk3TdTCbGai+eetssOskBB6xS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scsJFULGJlXMYqklhbnpucWG+kVJ+YWl+al6yXn525iBMbk tmM/t+xg7HoXfIhRgINRiYdX4EBpvBBrYllxZe4hRgkOZiURXqezp+OEeFMSK6tSi/Lji0pz UosPMZoCfTmRWUo0OR+YLvJK4g1NDc0tLA3Njc2NzSyUxHk7BA7GCAmkJ5akZqemFqQWwfQx cXBKNTCyVX7T97l8v/UQ56nS0L/ndkV+/d56Ufe364fYz8cl6y8/X9W3XV+uLDV4r4Tt9Pwr x7fvEPPT2t637U7njn3lLxJ67yjF82gVzOWbN0XzX0Zdn7nlBlVjtjspLI/DHLUcm5vtHrMt jlZ15ZrJtuhLvd6eFa1Fp3886MuOFXboDbPedyzruLESS3FGoqEWc1FxIgDpESyj3wIAAA== X-CMS-MailID: 20201002122252eucas1p1496d896453d21acda6ab83ef9b7f0b8a X-Msg-Generator: CA X-RootMTR: 20201002122252eucas1p1496d896453d21acda6ab83ef9b7f0b8a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201002122252eucas1p1496d896453d21acda6ab83ef9b7f0b8a References: <20201002122243.26849-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 48afd4818558..86b6125b24a6 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);