lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211220103435-mutt-send-email-mst@kernel.org>
Date:   Mon, 20 Dec 2021 10:35:08 -0500
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Vincent Whitchurch <vincent.whitchurch@...s.com>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        Viresh Kumar <vireshk@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>, kernel@...s.com,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        virtualization@...ts.linux-foundation.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: virtio: remove timeout

On Mon, Dec 20, 2021 at 03:54:56PM +0100, Bartosz Golaszewski wrote:
> On Mon, Dec 20, 2021 at 2:07 PM Vincent Whitchurch
> <vincent.whitchurch@...s.com> wrote:
> >
> > 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 <vincent.whitchurch@...s.com>
> > ---
> >  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
> >
> 
> My knowledge of virtio is limited, I hope this is not a stupid question.
> 
> Does this mean the operation can get stuck indefinitely?
> 
> Bart

Only if the device is broken. which given it's part of the
hypervisor, is par for the course.

-- 
MST

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ