Skip to content

Commit d813a8c

Browse files
committed
Merge tag 'gpio-v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "Some late fixes: one IRQ issue and one compilation issue for UML. - Fix a compilation issue with User Mode Linux - Handle spurious interrupts properly in the PCA953x driver" * tag 'gpio-v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: pca953x: Survive spurious interrupts gpiolib: Disable compat ->read() code in UML case
2 parents f318052 + 8b81edd commit d813a8c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

drivers/gpio/gpio-pca953x.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,21 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
824824
ret = pca953x_irq_pending(chip, pending);
825825
mutex_unlock(&chip->i2c_lock);
826826

827-
for_each_set_bit(level, pending, gc->ngpio)
828-
handle_nested_irq(irq_find_mapping(gc->irq.domain, level));
827+
if (ret) {
828+
ret = 0;
829+
830+
for_each_set_bit(level, pending, gc->ngpio) {
831+
int nested_irq = irq_find_mapping(gc->irq.domain, level);
832+
833+
if (unlikely(nested_irq <= 0)) {
834+
dev_warn_ratelimited(gc->parent, "unmapped interrupt %d\n", level);
835+
continue;
836+
}
837+
838+
handle_nested_irq(nested_irq);
839+
ret = 1;
840+
}
841+
}
829842

830843
return IRQ_RETVAL(ret);
831844
}

drivers/gpio/gpiolib-cdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static __poll_t lineevent_poll(struct file *file,
425425

426426
static ssize_t lineevent_get_size(void)
427427
{
428-
#ifdef __x86_64__
428+
#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
429429
/* i386 has no padding after 'id' */
430430
if (in_ia32_syscall()) {
431431
struct compat_gpioeevent_data {

0 commit comments

Comments
 (0)