From patchwork Tue Apr 17 14:29:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10345345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89AF960542 for ; Tue, 17 Apr 2018 14:39:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33AA4212D5 for ; Tue, 17 Apr 2018 14:39:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2541B28112; Tue, 17 Apr 2018 14:39:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 37C97212D5 for ; Tue, 17 Apr 2018 14:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: Message-id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:List-Owner; bh=enacuqzV9lhI3dQYiQSEHaTKcIk5L5waC7nrWWQ8ifU=; b=XC SVxYnBD3iILFQ94rGR6CGgu1SeAEWpxuYlKbns5JTEYYQP8+iG6la4djsjhU9MA90v8gECMKHL5V2 1gpaflp96oZhyb0oF//Ohdzeumjh16ZITM4cdEyFfUMeyrx4vuoUvjKHyXiPV86z3Od5Wl766y9m1 M5LDsHzdv7ck/ohrvbOE8tkpAgUF5pPzDeXXOiWcWbUs0Bx4ewnUGKjJZgVpGDcZOlW4Q81bfx1hg NAL8Qr5NmjATTV/mw2DMhHhp5N4Z8U+c3HAj63/zqB1qeri/ZM0DshdpsxtxvMqambQrFM6I758x/ ySTNhF1nkJmEAioKNfJzc+ZAh/ooquzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8RlS-0006MC-VA; Tue, 17 Apr 2018 14:39:22 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8Rcz-0000H5-Ni for linux-arm-kernel@lists.infradead.org; Tue, 17 Apr 2018 14:30:40 +0000 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180417143023epoutp049ca982d2e70dd7ec7c0651e6859fe935~mP5KnkNU42915629156epoutp04g; Tue, 17 Apr 2018 14:30:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180417143023epoutp049ca982d2e70dd7ec7c0651e6859fe935~mP5KnkNU42915629156epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523975423; bh=bx9hgERcBV5SprK/pXXDzFIf/Jb2ihcwsgqoH+aDjyI=; h=From:To:Cc:Subject:Date:References:From; b=vfqO1h0baBeNY6XfJ4FeTlMz2EU+uAvTubHoaPVy8GU2ZyDbGl2DWMzfAc8jHklEr uoB+bfsH0lwooJAdVSMsSRVuz0iVE17x/KQzCR+N5c6/RIlGe0YMDFbVpEZDOCgvOV iqIjlz/eiaGwCy2yT1j0dZN4e77qvqixGJvy/ByI= Received: from epsmges2p1.samsung.com (unknown [182.195.42.69]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20180417143022epcas2p430760b599a73d0f89b70df7af99ada31~mP5KcqcDc0847808478epcas2p4F; Tue, 17 Apr 2018 14:30:22 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 17.D7.04068.EF406DA5; Tue, 17 Apr 2018 23:30:22 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180417143022epcas2p1185d48998a1659ce6580180ea6725607~mP5KADKtH0777007770epcas2p1Z; Tue, 17 Apr 2018 14:30:22 +0000 (GMT) X-AuditID: b6c32a45-6d3ff70000000fe4-9a-5ad604fed376 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E5.5E.03827.EF406DA5; Tue, 17 Apr 2018 23:30:22 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P7C0012A2Y8EI10@mmp1.samsung.com>; Tue, 17 Apr 2018 23:30:22 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Subject: [PATCH v2 1/8] spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode Date: Tue, 17 Apr 2018 16:29:47 +0200 Message-id: <20180417142954.5507-1-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsWy7bCmhe4/lmtRBr836Vss/vGcyWLjjPWs FlMfPmGz6H/8mtni/PkN7BabHl9jtZhxfh+TRePHm+wWa4/cZbc4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PxZPAVsLIuAqkT7w6UsXYwcHLwCVhIPTyRBbJOXeL/gPuMERq4FjAyr GCVTC4pz03OLjQqM8lLL9YoTc4tL89L1kvNzNzECQ2bbYa3+HYyPl8QfYhTgYFTi4ZXYcSVK iDWxrLgy9xCjBAezkgjvzsdAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rz8+ccihQTSE0tSs1NT C1KLYLJMHJxSDYxz+pY5BzLeKVR2eRN/eWtP8K/pv+IT+f7dsCprjnneUK4obyRu0iz4LHvb ts7JjJ8a9IrOVW3jZl8ZeqVLbn/qdMbrxwy/ZD2aqPtbdofn4wKfJaHyD5Pv/lBrMHTdu/3C v54td15MfsL6/fTSTodbSq/uRvVWV7Ofdo7mDjGbdcskaY6pk5YSS3FGoqEWc1FxIgAYnddx FQIAAA== X-CMS-MailID: 20180417143022epcas2p1185d48998a1659ce6580180ea6725607 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180417143022epcas2p1185d48998a1659ce6580180ea6725607 X-RootMTR: 20180417143022epcas2p1185d48998a1659ce6580180ea6725607 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180417_073038_518967_7BEED7E2 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , b.zolnierkie@samsung.com, krzk@kernel.org, linux-spi@vger.kernel.org, kgene@kernel.org, andi@etezian.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently timeout errors in polling I/O mode transfer are silently ignored. Fix it by returning an error when we time out waiting on the RX FIFO level to reach the transfer length. Reviewed-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sylwester Nawrocki --- drivers/spi/spi-s3c64xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index baa3a9fa2638..9a990bc3138a 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -505,6 +505,8 @@ static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd, status = readl(regs + S3C64XX_SPI_STATUS); } while (RX_FIFO_LVL(status, sdd) < xfer->len && --val); + if (!val) + return -EIO; /* If it was only Tx */ if (!xfer->rx_buf) {