Skip to content

Commit 17e41ea

Browse files
JeffyCNholtmann
authored andcommitted
Bluetooth: btmrvl: wake system up when receives a wake irq
Currrently we are disabling this wake irq after receiving it. If this happens before we finish suspend and the pm event check is disabled, the system will continue suspending, and this irq would not work again. We may need to abort system suspend to avoid that. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 017789f commit 17e41ea

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/bluetooth/btmrvl_sdio.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <linux/firmware.h>
2222
#include <linux/slab.h>
23+
#include <linux/suspend.h>
2324

2425
#include <linux/mmc/sdio_ids.h>
2526
#include <linux/mmc/sdio_func.h>
@@ -60,14 +61,18 @@ static const struct of_device_id btmrvl_sdio_of_match_table[] = {
6061

6162
static irqreturn_t btmrvl_wake_irq_bt(int irq, void *priv)
6263
{
63-
struct btmrvl_plt_wake_cfg *cfg = priv;
64+
struct btmrvl_sdio_card *card = priv;
65+
struct btmrvl_plt_wake_cfg *cfg = card->plt_wake_cfg;
6466

6567
if (cfg->irq_bt >= 0) {
6668
pr_info("%s: wake by bt", __func__);
6769
cfg->wake_by_bt = true;
6870
disable_irq_nosync(irq);
6971
}
7072

73+
pm_wakeup_event(&card->func->dev, 0);
74+
pm_system_wakeup();
75+
7176
return IRQ_HANDLED;
7277
}
7378

@@ -101,7 +106,7 @@ static int btmrvl_sdio_probe_of(struct device *dev,
101106
} else {
102107
ret = devm_request_irq(dev, cfg->irq_bt,
103108
btmrvl_wake_irq_bt,
104-
0, "bt_wake", cfg);
109+
0, "bt_wake", card);
105110
if (ret) {
106111
dev_err(dev,
107112
"Failed to request irq_bt %d (%d)\n",

0 commit comments

Comments
 (0)