Skip to content

Commit 3bf6f01

Browse files
committed
Merge tag 'gpio-fixes-for-v5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: - fix interrupts when replugging the device in gpio-dln2 - remove the arbitrary timeout on virtio requests from gpio-virtio * tag 'gpio-fixes-for-v5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: virtio: remove timeout gpio: dln2: Fix interrupts when replugging the device
2 parents 0d81b5f + 3e4d9a4 commit 3bf6f01

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

drivers/gpio/gpio-dln2.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
struct dln2_gpio {
4747
struct platform_device *pdev;
4848
struct gpio_chip gpio;
49+
struct irq_chip irqchip;
4950

5051
/*
5152
* Cache pin direction to save us one transfer, since the hardware has
@@ -383,15 +384,6 @@ static void dln2_irq_bus_unlock(struct irq_data *irqd)
383384
mutex_unlock(&dln2->irq_lock);
384385
}
385386

386-
static struct irq_chip dln2_gpio_irqchip = {
387-
.name = "dln2-irq",
388-
.irq_mask = dln2_irq_mask,
389-
.irq_unmask = dln2_irq_unmask,
390-
.irq_set_type = dln2_irq_set_type,
391-
.irq_bus_lock = dln2_irq_bus_lock,
392-
.irq_bus_sync_unlock = dln2_irq_bus_unlock,
393-
};
394-
395387
static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
396388
const void *data, int len)
397389
{
@@ -473,8 +465,15 @@ static int dln2_gpio_probe(struct platform_device *pdev)
473465
dln2->gpio.direction_output = dln2_gpio_direction_output;
474466
dln2->gpio.set_config = dln2_gpio_set_config;
475467

468+
dln2->irqchip.name = "dln2-irq",
469+
dln2->irqchip.irq_mask = dln2_irq_mask,
470+
dln2->irqchip.irq_unmask = dln2_irq_unmask,
471+
dln2->irqchip.irq_set_type = dln2_irq_set_type,
472+
dln2->irqchip.irq_bus_lock = dln2_irq_bus_lock,
473+
dln2->irqchip.irq_bus_sync_unlock = dln2_irq_bus_unlock,
474+
476475
girq = &dln2->gpio.irq;
477-
girq->chip = &dln2_gpio_irqchip;
476+
girq->chip = &dln2->irqchip;
478477
/* The event comes from the outside so no parent handler */
479478
girq->parent_handler = NULL;
480479
girq->num_parents = 0;

drivers/gpio/gpio-virtio.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,7 @@ static int _virtio_gpio_req(struct virtio_gpio *vgpio, u16 type, u16 gpio,
100100
virtqueue_kick(vgpio->request_vq);
101101
mutex_unlock(&vgpio->lock);
102102

103-
if (!wait_for_completion_timeout(&line->completion, HZ)) {
104-
dev_err(dev, "GPIO operation timed out\n");
105-
ret = -ETIMEDOUT;
106-
goto out;
107-
}
103+
wait_for_completion(&line->completion);
108104

109105
if (unlikely(res->status != VIRTIO_GPIO_STATUS_OK)) {
110106
dev_err(dev, "GPIO request failed: %d\n", gpio);

0 commit comments

Comments
 (0)