Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 599473cf authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Pierre Ossman
Browse files

sdio: make the IRQ thread more resilient in the presence of bad states



Currently we print a message about some bad states wrt function IRQ
handlers but return 0 from process_sdio_pending_irqs() nevertheless.
This can lead to an infinite loop as nothing might have cleared the
condition for the pending card interrupt from the host controller by
the time host->ops->enable_sdio_irq(host, 1) is called.

Signed-off-by: default avatarNicolas Pitre <nico@marvell.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 3e01e4bc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -45,16 +45,22 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
				printk(KERN_WARNING "%s: pending IRQ for "
					"non-existant function\n",
					mmc_card_id(card));
				ret = -EINVAL;
			} else if (func->irq_handler) {
				func->irq_handler(func);
				count++;
			} else
			} else {
				printk(KERN_WARNING "%s: pending IRQ with no handler\n",
				       sdio_func_id(func));
				ret = -EINVAL;
			}
		}
	}

	if (count)
		return count;

	return ret;
}

static int sdio_irq_thread(void *_host)