mediatek: add v4.19 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0390-bcm2835-mmc-Fix-duplicate-free_irq-on-remove.patch
1 From d2ba7664d279bf06ad8ffc281cbefe29ddc180e7 Mon Sep 17 00:00:00 2001
2 From: Lukas Wunner <lukas@wunner.de>
3 Date: Sat, 19 Jan 2019 09:00:26 +0100
4 Subject: [PATCH 390/703] bcm2835-mmc: Fix duplicate free_irq() on remove
5
6 The BCM2835 MMC host driver requests its interrupt as a device-managed
7 resource, so the interrupt is automatically freed after the driver is
8 unbound.
9
10 However on driver unbind, bcm2835_mmc_remove() frees the interrupt
11 explicitly to avoid invocation of the interrupt handler after driver
12 structures have been torn down.
13
14 The interrupt is thus freed twice, leading to a WARN splat in
15 __free_irq(). Fix by not requesting the interrupt as a device-managed
16 resource.
17
18 Signed-off-by: Lukas Wunner <lukas@wunner.de>
19 Cc: Frank Pavlic <f.pavlic@kunbus.de>
20 ---
21 drivers/mmc/host/bcm2835-mmc.c | 6 +++---
22 1 file changed, 3 insertions(+), 3 deletions(-)
23
24 --- a/drivers/mmc/host/bcm2835-mmc.c
25 +++ b/drivers/mmc/host/bcm2835-mmc.c
26 @@ -1389,9 +1389,9 @@ static int bcm2835_mmc_add_host(struct b
27 init_waitqueue_head(&host->buf_ready_int);
28
29 bcm2835_mmc_init(host, 0);
30 - ret = devm_request_threaded_irq(dev, host->irq, bcm2835_mmc_irq,
31 - bcm2835_mmc_thread_irq, IRQF_SHARED,
32 - mmc_hostname(mmc), host);
33 + ret = request_threaded_irq(host->irq, bcm2835_mmc_irq,
34 + bcm2835_mmc_thread_irq, IRQF_SHARED,
35 + mmc_hostname(mmc), host);
36 if (ret) {
37 dev_err(dev, "Failed to request IRQ %d: %d\n", host->irq, ret);
38 goto untasklet;