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: 10343331 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 5FFD460542 for ; Mon, 16 Apr 2018 15:41:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 520B028787 for ; Mon, 16 Apr 2018 15:41:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4700728790; Mon, 16 Apr 2018 15:41:37 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0162287B2 for ; Mon, 16 Apr 2018 15:41:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbeDPPlg (ORCPT ); Mon, 16 Apr 2018 11:41:36 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:15379 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbeDPPlf (ORCPT ); Mon, 16 Apr 2018 11:41:35 -0400 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 Cc: andi@etezian.org, krzk@kernel.org, kgene@kernel.org, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, Sylwester Nawrocki 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+xWsw4v4/JovHjTXaLtUfuslscftPO6sDlcX3JJ2aPTas6 2Tw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroz2s8dZC6awVfw5fI25gbGNtYuRk0NC wETiz8zrQDYXh5DADkaJmw1tTCAJIYHvjBJPPvLCFJ3f85EdomgDo8SdWWuYIJxfjBK/1rUw glSxCRhK9B7tA7NFBMQkbs/pZAYpYhZoYpJofbAObJ+wQKREW/sSsBUsAqoSPa++sYHYvALW Ekda9jFBrJOXeL/gPtggTgEbieN/T4INkhBYwiZxY/0rRogiF4lvd55CPSEs8er4FqD7OIBs aYlLR20hwtUSnW1d7BC9LYwSf6ZdYoNIWEscPn4RrJdZgE/i3dceVoheXomONiGIEg+JnpZH UKscJbr+TGOD+LgfGCzPfzFOYJRawMiwilEstaA4Nz212LDAVK84Mbe4NC9dLzk/dxMjOGa1 LHcwHjvnc4hRgINRiYdXYseVKCHWxLLiytxDjBIczEoivPMPAYV4UxIrq1KL8uOLSnNSiw8x SnOwKInzPvU5EyUkkJ5YkpqdmlqQWgSTZeLglGpgFMz5+uT02+qNAk+MfiaenLprHUtio1VG ra5gcuj59ry8sndF2xfWPYtMuXRA4f1xi0SPaQb7N6kklxtVWlrNeaq1vrlikfHHD4u+CU1k ylob1a7YXX4idVLc/qpfXb2//G1e9xy8NU1o/vs1MbluN5m3LAtjPfyULbrewv4Bo1cav9L5 rfe+K7EUZyQaajEXFScCAFxYYwDVAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFLMWRmVeSWpSXmKPExsVy+t9jQV2tI1eiDHpbLSwW/3jOZLFxxnpW i6kPn7BZ9D9+zWxx/vwGdotNj6+xWsw4v4/JovHjTXaLtUfuslscftPO6sDlcX3JJ2aPTas6 2Tw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroz2s8dZC6awVfw5fI25gbGNtYuRk0NC wETi/J6P7F2MXBxCAusYJW7fvsIOkhAS+MUoMXeXNojNJmAo0Xu0jxHEFhEQk7g9p5MZpIFZ 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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) {