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

Commit 321d24f9 authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Greg Kroah-Hartman
Browse files

mfd: tps65010: Use IRQF_NO_AUTOEN flag in request_irq() to fix race



[ Upstream commit 2174f9a8c9db50f74df769edd5a4ab822c73b6d2 ]

As the comment said, disable_irq() after request_irq() still has a
time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN
flag will disable IRQ auto-enable when request IRQ.

Fixes: 72cd7995 ("[PATCH] I2C: add i2c driver for TPS6501x")
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240912031530.2211654-1-ruanjinjie@huawei.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7022d187
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -550,17 +550,13 @@ static int tps65010_probe(struct i2c_client *client,
	 */
	if (client->irq > 0) {
		status = request_irq(client->irq, tps65010_irq,
				     IRQF_TRIGGER_FALLING, DRIVER_NAME, tps);
				     IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
				     DRIVER_NAME, tps);
		if (status < 0) {
			dev_dbg(&client->dev, "can't get IRQ %d, err %d\n",
					client->irq, status);
			return status;
		}
		/* annoying race here, ideally we'd have an option
		 * to claim the irq now and enable it later.
		 * FIXME genirq IRQF_NOAUTOEN now solves that ...
		 */
		disable_irq(client->irq);
		set_bit(FLAG_IRQ_ENABLE, &tps->flags);
	} else
		dev_warn(&client->dev, "IRQ not configured!\n");