From patchwork Mon Apr 16 15:40:19 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: 10343345 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 767E16039A for ; Mon, 16 Apr 2018 15:43:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 674542823D for ; Mon, 16 Apr 2018 15:43:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BD252869F; Mon, 16 Apr 2018 15:43:25 +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 CDA9328653 for ; Mon, 16 Apr 2018 15:43:24 +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: In-reply-to: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:List-Owner; bh=evMyBZZSskSuG6XK1eMGncQnp0XisfgiT7fMaG55y3k=; b=NQNaAulbQb1LPf3QyphH81o0TJ HI6GbEbeVqGOWcGRRP1koj54l4DDYh41y7AGW0NP5UmHSidKiuhqbijOZci1l1VV1pC7KyUPLBgX3 JJWj+Xc2qcHRueFegYDLSs4yJuyGPIMy2GZzKfqUj7+o6KVY53DsfN3P1Ld2KT2bBGQt2N9IFcbaf hVt3iHTVkRjeky5AAxJ/eACKCgP8Rq2WAWz9fjJyFZMCalnJezV4i46qy64sbueZ8XDj/SdplSkqj /M6XYWHMyt8fN0fGFdiWXiV21twlQNIDnxtGrlusmT3pjBFR+daXo14zz04/gcYtLdnR89RY/EhtZ E0WrdcXQ==; 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 1f86Hg-0006Ut-Iy; Mon, 16 Apr 2018 15:43:12 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f86GI-0005gd-Av for linux-arm-kernel@lists.infradead.org; Mon, 16 Apr 2018 15:42:01 +0000 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180416154133epoutp0211293f6d969bf41e79d9c886fd973096~l9OBjW_wI2566725667epoutp02e; Mon, 16 Apr 2018 15:41:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180416154133epoutp0211293f6d969bf41e79d9c886fd973096~l9OBjW_wI2566725667epoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523893293; bh=FgVR135VD9FpXHXpY2pGdXLig8reP0VqsWP7A4ASQY8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Tlh3eLo/6aQ0pX6HqnKd7lzki5sa94ZKLdUVBqDfvU5sb1jL2sKipNJpt6pG1yFSn KrP6AAQ23iJV/oxJrUoxAUvs4uxJQCIEocNd7Dc4mRxQLmaxU3cHx1m7WUFJK9WOxh oW+co8yJjdorLbjBua6QBUcrjIFjrXlRT2bl5dZc= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180416154132epcas1p1866278ff21a520ef9bcc693215ee2127~l9OAVK2HD1555915559epcas1p1L; Mon, 16 Apr 2018 15:41:32 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 0B.54.04084.C24C4DA5; Tue, 17 Apr 2018 00:41:32 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180416154130epcas1p492c86e911db645acf32d960281e8b297~l9N-KVPtD2416624166epcas1p4u; Mon, 16 Apr 2018 15:41:30 +0000 (GMT) X-AuditID: b6c32a39-579ff70000000ff4-07-5ad4c42cb05d Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D6.E1.03849.A24C4DA5; Tue, 17 Apr 2018 00:41:30 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P7A004PTBJEDK00@mmp2.samsung.com>; Tue, 17 Apr 2018 00:41:30 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Subject: [PATCH 4/6] spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode Date: Mon, 16 Apr 2018 17:40:19 +0200 Message-id: <20180416154021.25626-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180416154021.25626-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWy7bCmga7OkStRBk2ruCwW/3jOZLFxxnpW i6kPn7BZ9D9+zWxx/vwGdotNj6+xWsw4v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FZ oIlJ4v3nz8wgCWGBSIn2xl9gzSwCqhI9r76xgdi8AtYSR1r2MUFsk5d4v+A+2CBOARuJ439P MkMss5a4svQ16wRGngWMDKsYJVMLinPTc4uNCgzzUsv1ihNzi0vz0vWS83M3MQJDbNthrb4d jPeXxB9iFOBgVOLhldhxJUqINbGsuDL3EKMEB7OSCO/8Q0Ah3pTEyqrUovz4otKc1OJDjNIc LErivLfzjkUKCaQnlqRmp6YWpBbBZJk4OKUaGFWf1psb5G5tk/jxnrWr8cnik31bZRWvM3uk zGEymSE8V6TXTS3G6uCcd5InVz23DHrHL5BquG7r/NCT+bOe3pz56GFo3AKT+wcm+wrv3ueU f7vVetMWXtNHuW9KvCXKpCfbWv0RTl9/uH1NzpZ0TY1JsYscLnFb7+xqXXypZtEW7bmHu2YK LVBiKc5INNRiLipOBACA1iADLQIAAA== X-CMS-MailID: 20180416154130epcas1p492c86e911db645acf32d960281e8b297 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180416154130epcas1p492c86e911db645acf32d960281e8b297 X-RootMTR: 20180416154130epcas1p492c86e911db645acf32d960281e8b297 References: <20180416154021.25626-1-s.nawrocki@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180416_084146_592466_91693970 X-CRM114-Status: GOOD ( 14.08 ) 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. Signed-off-by: Sylwester Nawrocki Reviewed-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski --- 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 e90e60bc1ecc..d87fa7d9fad3 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -502,6 +502,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) {