Bluetooth: btnxpuart: Uses threaded IRQ for host wakeup handling
Subsystems (2)
Neeraj Sanjay Kale
maintainerPATCH v2 1/1 Bluetooth: btnxpuart: Uses threaded IRQ for host wakeup handling
This replaces devm_request_irq() with devm_request_threaded_irq().
On iMX93 11x11 EVK platform, the BT chip's BT_WAKE_OUT pin is connected to an I2C GPIO expander instead of directly been connected to iMX GPIO.
When I2C GPIO expander's (PCAL6524) host driver receives an interrupt on it's INTR line, the driver's interrupt handler needs to query the interrupt source with PCAL6524 first, and then call the actual interrupt handler, in this case the IRQ handler in BTNXPUART.
In order to handle interrupts when such I2C GPIO expanders are between the host and interrupt source, devm_request_threaded_irq() is needed.
This commit also removes the IRQF_TRIGGER_FALLING flag, to allow setting the IRQ trigger type from the device tree setting instead of hardcoding in the driver.
---
v2: Add reason for removing IRQF_TRIGGER_FALLING in commit message.
(Sherry Sun)
--- drivers/bluetooth/btnxpuart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/bluetooth/btnxpuart.c +4 -4
@@ -543,10 +543,10 @@ static int ps_setup(struct hci_dev *hdev) }if (psdata->wakeup_source) { - ret =devm_request_irq (&serdev->dev, psdata->irq_handler, - ps_host_wakeup_irq_handler, -IRQF_ONESHOT |IRQF_TRIGGER_FALLING , -dev_name (&serdev->dev), nxpdev); + ret =devm_request_threaded_irq (&serdev->dev, psdata->irq_handler, +NULL , ps_host_wakeup_irq_handler, +IRQF_ONESHOT , +dev_name (&serdev->dev), nxpdev);if (ret)bt_dev_info (hdev,"error setting wakeup IRQ handler, ignoring\n" );disable_irq (psdata->irq_handler);
Signature · 1 line
2.34.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=988084
---Test result---
Test Summary:
CheckPatch PENDING 0.26 seconds GitLint PENDING 0.21 seconds SubjectPrefix PASS 0.13 seconds BuildKernel PASS 23.92 seconds CheckAllWarning PASS 26.78 seconds CheckSparse PASS 30.25 seconds BuildKernel32 PASS 24.39 seconds TestRunnerSetup PASS 477.80 seconds TestRunner_l2cap-tester PASS 26.75 seconds TestRunner_iso-tester PASS 38.03 seconds TestRunner_bnep-tester PASS 6.05 seconds TestRunner_mgmt-tester PASS 129.49 seconds TestRunner_rfcomm-tester PASS 9.30 seconds TestRunner_sco-tester PASS 14.63 seconds TestRunner_ioctl-tester PASS 10.01 seconds TestRunner_mesh-tester FAIL 11.40 seconds TestRunner_smp-tester PASS 8.71 seconds TestRunner_userchan-tester PASS 6.21 seconds IncrementalBuild PENDING 0.48 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.197 seconds Mesh - Send cancel - 2 Timed out 1.997 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth
Quoted 22 lines
-----Original Message-----
From: Neeraj Sanjay Kale <[email protected]>
Sent: Monday, August 4, 2025 6:30 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; Amitkumar Karwar <[email protected]>; Sherry Sun <[email protected]>; Neeraj Sanjay Kale <[email protected]>
Subject: [PATCH v2] Bluetooth: btnxpuart: Uses threaded IRQ for host wakeup handlingThis replaces
devm_request_irq()withdevm_request_threaded_irq().On iMX93 11x11 EVK platform, the BT chip's
BT_WAKE_OUTpin is connected to an I2C GPIO expander instead of directly been connected to iMX GPIO.When I2C GPIO expander's (PCAL6524) host driver receives an interrupt on it's INTR line, the driver's interrupt handler needs to query the interrupt source with PCAL6524 first, and then call the actual interrupt handler, in this case the IRQ handler in BTNXPUART.
Quoted 8 lines
In order to handle interrupts when such I2C GPIO expanders are between the host and interrupt source,
devm_request_threaded_irq()is needed.This commit also removes the
IRQF_TRIGGER_FALLINGflag, to allow setting the IRQ trigger type from the device tree setting instead of hardcoding in the driver.Signed-off-by Neeraj Sanjay Kale <[email protected]>
Best Regards
Sherry
Quoted 33 lines
---
v2: Add reason for removingIRQF_TRIGGER_FALLINGin commit message.
(Sherry Sun)--- drivers/bluetooth/btnxpuart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/bluetooth/btnxpuart.c +4
-4@@ -543,10 +543,10 @@ static int ps_setup(struct hci_dev *hdev) }if (psdata->wakeup_source) { - ret =devm_request_irq (&serdev->dev, psdata->irq_handler, - ps_host_wakeup_irq_handler, -IRQF_ONESHOT |IRQF_TRIGGER_FALLING , -dev_name (&serdev->dev), nxpdev); + ret = devm_request_threaded_irq(&serdev->dev, psdata- >irq_handler, + NULL, ps_host_wakeup_irq_handler, + IRQF_ONESHOT, + dev_name(&serdev->dev),nxpdev);
drivers/bluetooth/btnxpuart.c +0
-0if (ret) bt_dev_info(hdev, "error setting wakeup IRQ handler,ignoring\n");
disable_irq(psdata->irq_handler);
--
2.34.1
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 11 lines · On Mon, 4 Aug 2025 16:00:15 +0530 you wrote:
This replaces
devm_request_irq()withdevm_request_threaded_irq().On iMX93 11x11 EVK platform, the BT chip's
BT_WAKE_OUTpin is connected to an I2C GPIO expander instead of directly been connected to iMX GPIO.When I2C GPIO expander's (PCAL6524) host driver receives an interrupt on it's INTR line, the driver's interrupt handler needs to query the interrupt source with PCAL6524 first, and then call the actual interrupt handler, in this case the IRQ handler in BTNXPUART.
[...]
Here is the summary with links:
- [v2] Bluetooth: btnxpuart: Uses threaded IRQ for host wakeup handling
https://git.kernel.org/bluetooth/bluetooth-next/c/3f9a516852b6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html