From: Chandrashekar Devegowda chandrashekar.devegowda@intel.com
[ Upstream commit 3e94262921990e2884ff7a49064c12fb6d3a0733 ]
Implement hdev->wakeup() callback to support Wake On BT feature.
Test steps: 1. echo enabled > /sys/bus/pci/devices/0000:00:14.7/power/wakeup 2. connect bluetooth hid device 3. put the system to suspend - rtcwake -m mem -s 300 4. press any key on hid to wake up the system
Signed-off-by: Kiran K kiran.k@intel.com Signed-off-by: Chandrashekar Devegowda chandrashekar.devegowda@intel.com Signed-off-by: Luiz Augusto von Dentz luiz.von.dentz@intel.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES - `drivers/bluetooth/btintel_pcie.c:2350` introduces `btintel_pcie_wakeup()`, which just calls `device_may_wakeup(&data->pdev->dev)`; this mirrors the existing pattern in other Bluetooth transports (for example `drivers/bluetooth/btusb.c:3758`) and safely queries whether userspace enabled PCIe wakeups for the device that is already stored at `drivers/bluetooth/btintel_pcie.c:2411`. - Hooking that helper via `hdev->wakeup = btintel_pcie_wakeup;` at `drivers/bluetooth/btintel_pcie.c:2382` lets the HCI core mark the controller as remote‑wakeup capable (`net/bluetooth/hci_core.c:2661`) and, during system suspend, actually run the wake-capable configuration instead of bailing out early (`net/bluetooth/hci_sync.c:6214`). Without this patch, the Intel PCIe controller never programs accept lists/event masks for wake-on- Bluetooth even when `/sys/bus/pci/.../power/wakeup` is set to `enabled`, so Bluetooth HID devices cannot wake the machine—an obvious user-visible regression for WoBT capable hardware. - The change is self-contained: it neither alters suspend/resume sequencing nor touches shared subsystems beyond wiring the standard callback, and it relies only on long-standing primitives (`device_may_wakeup`, `hci_get_drvdata`) already present in stable releases beginning with v6.10 where `btintel_pcie` first appeared. - Because it fixes a real functionality gap with minimal, well- understood code and matches existing drivers’ behaviour, the risk of regression is low while the benefit (restoring Wake-on-BT support) is high, making this patch a strong candidate for stable backporting.
drivers/bluetooth/btintel_pcie.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 58cff211ec2c1..a91e768c0c4c0 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -2341,6 +2341,13 @@ static void btintel_pcie_hw_error(struct hci_dev *hdev, u8 code) btintel_pcie_reset(hdev); }
+static bool btintel_pcie_wakeup(struct hci_dev *hdev) +{ + struct btintel_pcie_data *data = hci_get_drvdata(hdev); + + return device_may_wakeup(&data->pdev->dev); +} + static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data) { int err; @@ -2366,6 +2373,7 @@ static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data) hdev->set_diag = btintel_set_diag; hdev->set_bdaddr = btintel_set_bdaddr; hdev->reset = btintel_pcie_reset; + hdev->wakeup = btintel_pcie_wakeup;
err = hci_register_dev(hdev); if (err < 0) {