From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F80CC433F5 for ; Mon, 20 Dec 2021 13:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232630AbhLTNHB (ORCPT ); Mon, 20 Dec 2021 08:07:01 -0500 Received: from smtp1.axis.com ([195.60.68.17]:17070 "EHLO smtp1.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232629AbhLTNHB (ORCPT ); Mon, 20 Dec 2021 08:07:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1640005621; x=1671541621; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WaxVAs1ueWqebp9zPoOJfkKS0rODc9paXkK8rXkLlR4=; b=RYOAYm3aTTo93PYBnS/o9PQql4ahauq9I1GUso4u8I+NZBGwM8LrQqHl lcA8HZsOWp3CF0Ald+Ty00bRc+WVcXaQIuGAs3IZpjYvitEgpUISHbKc3 FQUitevYVfWIDXN4U6wqrZIUcDvzUxM3rJ3d1k3HmVk2FhoJ6jWttvCUR J3aPfMs88T231KY5y5/5h+waYMEnaKtZbVbgEfSCQ8ZcP3Ap3HJfNey1J lIYTRyY6vCgTZR9TdZ7MvuE0+dVRZtKqXS1VvsmPW7RT5RtBQCIAXCUgN l00x0pvU1Kq0BChAeLVZba7bYG8wBwoEVc85yDMs3jNuKFhQJ3GYFBlPW w==; From: Vincent Whitchurch To: "Enrico Weigelt, metux IT consult" , Viresh Kumar , Linus Walleij , "Bartosz Golaszewski" CC: , , Vincent Whitchurch , Bartosz Golaszewski , Viresh Kumar , , , Subject: [PATCH] gpio: virtio: remove timeout Date: Mon, 20 Dec 2021 14:06:56 +0100 Message-ID: <20211220130656.16900-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The driver imposes an arbitrary one second timeout on virtio requests, but the specification doesn't prevent the virtio device from taking longer to process requests, so remove this timeout to support all systems and device implementations. Fixes: 3a29355a22c0275fe86 ("gpio: Add virtio-gpio driver") Signed-off-by: Vincent Whitchurch --- drivers/gpio/gpio-virtio.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-virtio.c b/drivers/gpio/gpio-virtio.c index 84f96b78f32a..9f4941bc5760 100644 --- a/drivers/gpio/gpio-virtio.c +++ b/drivers/gpio/gpio-virtio.c @@ -100,11 +100,7 @@ static int _virtio_gpio_req(struct virtio_gpio *vgpio, u16 type, u16 gpio, virtqueue_kick(vgpio->request_vq); mutex_unlock(&vgpio->lock); - if (!wait_for_completion_timeout(&line->completion, HZ)) { - dev_err(dev, "GPIO operation timed out\n"); - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&line->completion); if (unlikely(res->status != VIRTIO_GPIO_STATUS_OK)) { dev_err(dev, "GPIO request failed: %d\n", gpio); -- 2.33.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E22BC433EF for ; Mon, 20 Dec 2021 13:07:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F215840598; Mon, 20 Dec 2021 13:07:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KYci_OFrvjf8; Mon, 20 Dec 2021 13:07:07 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3D7AF402E1; Mon, 20 Dec 2021 13:07:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E4ECAC001E; Mon, 20 Dec 2021 13:07:06 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 561BCC0012 for ; Mon, 20 Dec 2021 13:07:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 359BE81C0A for ; Mon, 20 Dec 2021 13:07:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=axis.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C19jEr45VNj3 for ; Mon, 20 Dec 2021 13:07:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by smtp1.osuosl.org (Postfix) with ESMTPS id E549B81BE3 for ; Mon, 20 Dec 2021 13:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1640005623; x=1671541623; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WaxVAs1ueWqebp9zPoOJfkKS0rODc9paXkK8rXkLlR4=; b=MMbPL9NuVm4KGJqFRHvuYNW6pC0zGZfdNPCIQchqS/ubt/2migrRGG9+ mFMYSCCLs97g/Y9cDDwm0EN7HEExORuyRRAZ4DxyTFBYs2Bt5OLdEGOQT /mUpXdat5J4jUUHLb4OeKkwU7qJUTMSnOi5P4SMuk1F8UPQWo8MNZ2ICM D9/yaiHCheFFm9jVB0RTlRixpY6y4OX6SpNMNhUwdB0zEHj8HeAmbYtQO Y9oSGz74qpR3iDV0biMAdcKGQpXYUtO6j2OtMLoZgJKXUkpV7eEL2dcB8 p7qQMHeMSW4QFaSjb1YP8t6e3zl1VQQvSvpFPSALjGoj/Fz4WGVbKh9NA A==; From: Vincent Whitchurch To: "Enrico Weigelt, metux IT consult" , Viresh Kumar , Linus Walleij , "Bartosz Golaszewski" Subject: [PATCH] gpio: virtio: remove timeout Date: Mon, 20 Dec 2021 14:06:56 +0100 Message-ID: <20211220130656.16900-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Cc: mst@redhat.com, linux-gpio@vger.kernel.org, Viresh Kumar , Vincent Whitchurch , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Bartosz Golaszewski , kernel@axis.com X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" The driver imposes an arbitrary one second timeout on virtio requests, but the specification doesn't prevent the virtio device from taking longer to process requests, so remove this timeout to support all systems and device implementations. Fixes: 3a29355a22c0275fe86 ("gpio: Add virtio-gpio driver") Signed-off-by: Vincent Whitchurch --- drivers/gpio/gpio-virtio.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-virtio.c b/drivers/gpio/gpio-virtio.c index 84f96b78f32a..9f4941bc5760 100644 --- a/drivers/gpio/gpio-virtio.c +++ b/drivers/gpio/gpio-virtio.c @@ -100,11 +100,7 @@ static int _virtio_gpio_req(struct virtio_gpio *vgpio, u16 type, u16 gpio, virtqueue_kick(vgpio->request_vq); mutex_unlock(&vgpio->lock); - if (!wait_for_completion_timeout(&line->completion, HZ)) { - dev_err(dev, "GPIO operation timed out\n"); - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&line->completion); if (unlikely(res->status != VIRTIO_GPIO_STATUS_OK)) { dev_err(dev, "GPIO request failed: %d\n", gpio); -- 2.33.1 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization