Patch "hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hid-cp2112-fix-irq-shutdown-stopping-polling-for-all.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 15ec08258775e23372c5894b2b69d0b702129f97
Author: Danny Kaehn <danny.kaehn@xxxxxxxxxx>
Date:   Wed Oct 11 13:23:17 2023 -0500

    hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip
    
    [ Upstream commit dc3115e6c5d9863ec1a9ff1acf004ede93c34361 ]
    
    Previously cp2112_gpio_irq_shutdown() always cancelled the
    gpio_poll_worker, even if other IRQs were still active, and did not set
    the gpio_poll flag to false. This resulted in any call to _shutdown()
    resulting in interrupts no longer functioning on the chip until a
    _remove() occurred (a.e. the cp2112 is unplugged or system rebooted).
    
    Only cancel polling if all IRQs are disabled/masked, and correctly set
    the gpio_poll flag, allowing polling to restart when an interrupt is
    next enabled.
    
    Signed-off-by: Danny Kaehn <danny.kaehn@xxxxxxxxxx>
    Fixes: 13de9cca514e ("HID: cp2112: add IRQ chip handling")
    Link: https://lore.kernel.org/r/20231011182317.1053344-1-danny.kaehn@xxxxxxxxxx
    Signed-off-by: Benjamin Tissoires <bentiss@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 704aebb1a588f..ee983ddc7fd03 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1175,7 +1175,11 @@ static void cp2112_gpio_irq_shutdown(struct irq_data *d)
 	struct cp2112_device *dev = gpiochip_get_data(gc);
 
 	cp2112_gpio_irq_mask(d);
-	cancel_delayed_work_sync(&dev->gpio_poll_worker);
+
+	if (!dev->irq_mask) {
+		dev->gpio_poll = false;
+		cancel_delayed_work_sync(&dev->gpio_poll_worker);
+	}
 }
 
 static int cp2112_gpio_irq_type(struct irq_data *d, unsigned int type)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux