From patchwork Fri Jul 13 15:27:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 10523577 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 56DCF601C2 for ; Fri, 13 Jul 2018 15:27:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451E529BA1 for ; Fri, 13 Jul 2018 15:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 393F329BB6; Fri, 13 Jul 2018 15:27:58 +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 B3C8E29BA1 for ; Fri, 13 Jul 2018 15:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729770AbeGMPnC (ORCPT ); Fri, 13 Jul 2018 11:43:02 -0400 Received: from mail-eopbgr40104.outbound.protection.outlook.com ([40.107.4.104]:29040 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729772AbeGMPnC (ORCPT ); Fri, 13 Jul 2018 11:43:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rD/idf+3cYLtC9dQV4XZeHdy1NxMuo14L0aRZGHwDsI=; b=HmuL4jtR+iwSnx622ZluIFD3sP/8+ly+EYxU7UgiT1l/TkY0bQl/o8vdrmt70ewh2alzOT7zMg6lq2HMUXDl90wOC3uGNhcRzgIWByLJ4FTGkp23Ir67F8ZF9Dtko3gQGa/iyrFW7SHrofjQezLHCUG2/2iT9a1or6HgoZJF13U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=alexander.sverdlin@nokia.com; Received: from ulegcpsvdell.emea.nsn-net.net (131.228.2.20) by HE1PR0701MB1884.eurprd07.prod.outlook.com (2603:10a6:3:38::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.10; Fri, 13 Jul 2018 15:27:50 +0000 From: Alexander Sverdlin To: linux-spi@vger.kernel.org Cc: Alexander Sverdlin , Mark Brown , Linus Walleij , Magnus Templing Subject: [PATCH] spi: pl022: Remove timeout in polling mode operation Date: Fri, 13 Jul 2018 17:27:33 +0200 Message-Id: <20180713152733.2326-1-alexander.sverdlin@nokia.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [131.228.2.20] X-ClientProxiedBy: VI1PR0501CA0030.eurprd05.prod.outlook.com (2603:10a6:800:60::16) To HE1PR0701MB1884.eurprd07.prod.outlook.com (2603:10a6:3:38::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1a94198-8db6-46c1-d189-08d5e8d5328b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:(109105607167333); BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7193020); SRVR:HE1PR0701MB1884; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB1884; 3:EL+UoGO644x9FtRdOwl1nNDfql9N1XwDR/uoLp+Y0VF6TKDI1okdXf7KY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lsZUsuvlnBFjsSLAygAcx/wYJuthn1IGcQQg6A1844gGYVBuJART5ulgo/xMczMhOK/6dHABhaMhGzsQnKQogv+bJJd6KwuTLWSJK3bDsxL9mUrjGxK7OEudMzLv/+q7/rSOZ1zFemzZEZzgLmRqP46dniWaJasQy5gT1X7MnaN1uqYzH1PvTNrQXvv8OlMupLSP5O6btlDN9QsvJslb9sDDgAb06W5KglJDCj+1XLR0TqX89vhR6CNUV6AmFun4y39gQY2HgkQ+lcmofqmdgbyKPY8oUmVuuniCXTOQxFlmzx1prxrC0bFUYu4+LSHEwbKpTvMS+ync+ya7jkSvr4PtLz466uygCIxrfqB+1rmIedwOl4X1ddfOEzFcaMKSrnliUa3aAQmVv3GNLi6bKUEWTQOJSQlcXa8jPMWk7IwjolV48SB7Y/pn5pO98= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597)(109105607167333); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(11241501184)(806099)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:HE1PR0701MB1884; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0701MB1884; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB1884; 4:e7mm05ZWUb/q22byzER1D2BCBedGnV6PkcdC4iGXpjYgNjXj/nk+SrJuXv47zZMwPTY4qaSp/mtfwNnXMBGzpzyZDKtR7b3D7KWMZtdAdJHELg+iybGywuu9TxUYzUNLiXdW1SuZdTjzTtaBQzNahtPgtsDbl34uF4l4HPqMMONfKkazqyNVy43xynt3Qq6CHRcQgIuPOYixRuHvc9MHTQLWTb5K8LN3KHaGOCG5bj7n877Bxwe7IN2N8eiyZuzTybcIwyvJbUPuad4zRkYQYCzcbHnczQOVzLEC2zYkz0ibnRxJE9GhhF5QnzkM7mdwsdDjW9GOUzDzwoeOTOc3p1VvOJVobfkjArgBunW8CDo= X-Forefront-PRVS: 07326CFBC4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39860400002)(136003)(396003)(376002)(346002)(366004)(189003)(199004)(6916009)(50226002)(51416003)(52116002)(6506007)(81156014)(1857600001)(386003)(2906002)(26005)(6666003)(186003)(36756003)(44832011)(305945005)(7736002)(478600001)(47776003)(5660300001)(97736004)(81166006)(53936002)(6486002)(8676002)(86362001)(8936002)(68736007)(54906003)(316002)(25786009)(2361001)(6512007)(66066001)(2351001)(106356001)(50466002)(105586002)(16586007)(48376002)(486006)(2616005)(476003)(956004)(1076002)(3846002)(4326008)(16526019)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0701MB1884; H:ulegcpsvdell.emea.nsn-net.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0701MB1884; 23:jl3+c8ECbiu1UdJ8Y3FHshWTv68NopB5VD7vxLF?= =?us-ascii?Q?LbmZrrw+AE6h0NThMxrBkMeZPbb/RU+2ZWZddNTP+uLkyrGuGHou4ge8d+bG?= =?us-ascii?Q?muhOi6d2zX+t1UtxgZLfoiEh7lNy+cbAVziTkX8OVu9+KjqdPuz98O2ATyyG?= =?us-ascii?Q?n65yn1tBN0ts7rAETd6t92W0yfrVMeVurtgk0g+pZ/gm7jwkTlhsHXxklLHm?= =?us-ascii?Q?ftlF4IxFiTijGNcsG8T44KZCMpeMnGs8l8xA/ACYvKhnWKx00m4zMaBtTLM2?= =?us-ascii?Q?AukjwloPnjOjJgsvnEBsKlXj0cFMk0Ghj/OXchfu0KrhFHiyMVnpPFyoPVpY?= =?us-ascii?Q?2DrfdECns0rW0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9MoyFNDn6yQWGDBcRbm+pw3zv66dOh2G6XPKhI9ZBPl6yNB5J8xNVCjlW8l5lo=; 24:GLz3/tnQCFA//vWcs8O825x8UWexVVL5KjhdzR4p/pLlhKihxYeeB+O1oLqoMbdI44x3tuWaP5UuSxGO+0kgnzXutRI3xvVY6c7oEObHUxI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB1884; 7:BRWC7FfiC5YQHmf//pkMwgi+tt3vlmx/Kdzo7koT6lVvNUasjZ3LFvXbiLXnA79tSea9FYmY7tzsR0pyI66O3gk4tR157aXL6QyRlY1FB8jvb9JOzLQGtuyZvcRHx/ldAQaZjiMSbPqv/H8KT8Z5aizrHB9diBLf41LWu5ROLYSJPxd/JElYYgkiNrY5iWnZ9u1OfVsdwpNEOWOLdQ0HjenPZexO+zSvOKVcsEcIPd16357TP36gqh8QDq8vH0xl X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 15:27:50.6916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1a94198-8db6-46c1-d189-08d5e8d5328b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0701MB1884 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some tests show, that bulk SPI accesses (255 bytes, maximum PL022 can) may take seconds, depending on CPU load. In this case vital SPI accesses can fail because of user-space applications. Some other drivers already do not have timeouts in polling mode. Signed-off-by: Alexander Sverdlin --- drivers/spi/spi-pl022.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 1af8c96b940e..1816774714a4 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -294,8 +294,6 @@ #define CLEAR_ALL_INTERRUPTS 0x3 -#define SPI_POLLING_TIMEOUT 1000 - /* * The type of reading going on on this chip */ @@ -1491,7 +1489,6 @@ static void do_polling_transfer(struct pl022 *pl022) struct spi_transfer *transfer = NULL; struct spi_transfer *previous = NULL; struct chip_data *chip; - unsigned long time, timeout; chip = pl022->cur_chip; message = pl022->cur_msg; @@ -1531,16 +1528,8 @@ static void do_polling_transfer(struct pl022 *pl022) dev_dbg(&pl022->adev->dev, "polling transfer ongoing ...\n"); - timeout = jiffies + msecs_to_jiffies(SPI_POLLING_TIMEOUT); while (pl022->tx < pl022->tx_end || pl022->rx < pl022->rx_end) { - time = jiffies; readwriter(pl022); - if (time_after(time, timeout)) { - dev_warn(&pl022->adev->dev, - "%s: timeout!\n", __func__); - message->state = STATE_ERROR; - goto out; - } cpu_relax(); } @@ -1551,7 +1540,7 @@ static void do_polling_transfer(struct pl022 *pl022) /* Move to next transfer */ message->state = next_transfer(pl022); } -out: + /* Handle end of message */ if (message->state == STATE_DONE) message->status = 0; @@ -1559,7 +1548,6 @@ static void do_polling_transfer(struct pl022 *pl022) message->status = -EIO; giveback(pl022); - return; } static int pl022_transfer_one_message(struct spi_master *master,