Skip to contentSkip to conversation

Bluetooth: btintel_pcie: Fix build error when CONFIG_ACPI is disabled

PATCH In review Chandrashekar Devegowda 3 participants 4 messages Apr 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Bluetooth: btintel_pcie: Fix build error when CONFIG_ACPI is disabled

btintel_pcie_acpi_reset_method() uses ACPI APIs such as acpi_evaluate_object() and acpi_has_method() which are not available when CONFIG_ACPI is disabled, causing build errors on architectures that lack ACPI support.

Guard btintel_pcie_acpi_reset_method() and btintel_pcie_perform_pldr() with IS_ENABLED(CONFIG_ACPI). Since PLDR relies entirely on ACPI reset methods, skip the entire PLDR flow when ACPI is not enabled instead of unnecessarily unbinding and reprobing WiFi with no actual reset.

Fixes 912a499a7955 ("Bluetooth: btintel_pcie: Support Product level reset")

---
v1 -> v2:
- Guard btintel_pcie_perform_pldr() along with btintel_pcie_acpi_reset_method() under IS_ENABLED(CONFIG_ACPI) instead of providing a separate stub for the ACPI method, since PLDR is meaningless without ACPI support (Paul).
- Tested with CONFIG_ACPI=y, CONFIG_ACPI disabled, and 0day CI alpha config.

 drivers/bluetooth/btintel_pcie.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/btintel_pcie.c +7 -0
index 076beb45c410..07223965388a 100644
@@ -2280,6 +2280,7 @@ static void btintel_pcie_inc_recovery_count(struct pci_dev *pdev,
 static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data);
 static void btintel_pcie_reset(struct hci_dev *hdev);
 
+#if IS_ENABLED(CONFIG_ACPI)
 static int btintel_pcie_acpi_reset_method(struct btintel_pcie_data *data)
 {
 	union acpi_object *obj, argv4;
@@ -2389,6 +2390,12 @@ static void btintel_pcie_perform_pldr(struct btintel_pcie_data *data)
 			BT_ERR("BT reprobe failed for BDF:%s", pci_name(pdev));
 	}
 }
+#else
+static void btintel_pcie_perform_pldr(struct btintel_pcie_data *data)
+{
+	bt_dev_warn(data->hdev, "PLDR not supported, ACPI is disabled");
+}
+#endif
 
 static void btintel_pcie_reset_work(struct work_struct *wk)
 {
Signature · 1 line
2.43.0
#1 lore raw

Hi Chandrashekar,

Quoted 52 lines · Chandrashekar Devegowda

btintel_pcie_acpi_reset_method() uses ACPI APIs such as acpi_evaluate_object() and acpi_has_method() which are not available when CONFIG_ACPI is disabled, causing build errors on architectures that lack ACPI support.

Guard btintel_pcie_acpi_reset_method() and btintel_pcie_perform_pldr() with IS_ENABLED(CONFIG_ACPI). Since PLDR relies entirely on ACPI reset methods, skip the entire PLDR flow when ACPI is not enabled instead of unnecessarily unbinding and reprobing WiFi with no actual reset.

Fixes 912a499a7955 ("Bluetooth: btintel_pcie: Support Product level reset")

---
v1 -> v2:
- Guard btintel_pcie_perform_pldr() along with btintel_pcie_acpi_reset_method() under IS_ENABLED(CONFIG_ACPI) instead of providing a separate stub for the ACPI method, since PLDR is meaningless without ACPI support (Paul).
- Tested with CONFIG_ACPI=y, CONFIG_ACPI disabled, and 0day CI alpha config.

 drivers/bluetooth/btintel_pcie.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/btintel_pcie.c +7 -1
index 076beb45c410..07223965388a 100644
@@ -2280,6 +2280,7 @@ static void btintel_pcie_inc_recovery_count(struct pci_dev *pdev,
 static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data);
 static void btintel_pcie_reset(struct hci_dev *hdev);
 
+#if IS_ENABLED(CONFIG_ACPI)
 static int btintel_pcie_acpi_reset_method(struct btintel_pcie_data *data)
 {
        union acpi_object *obj, argv4;
@@ -2389,6 +2390,12 @@ static void btintel_pcie_perform_pldr(struct btintel_pcie_data *data)
                        BT_ERR("BT reprobe failed for BDF:%s", pci_name(pdev));
        }
 }
+#else
+static void btintel_pcie_perform_pldr(struct btintel_pcie_data *data)
+{
+       bt_dev_warn(data->hdev, "PLDR not supported, ACPI is disabled");
+}
+#endif
 
 static void btintel_pcie_reset_work(struct work_struct *wk)
 {
--
Quoted 1 line

2.43.0

Doesn't making btintel_pci depend only on ACPI resolve all of this? Or do we really need to support systems without ACPI?

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw
In reply to Chandrashekar Devegowda

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/btintel_pcie.c:2280
error: drivers/bluetooth/btintel_pcie.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Chandrashekar Devegowda

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=1082111

---Test result---

Test Summary:

CheckPatch                    FAIL      0.46 seconds
GitLint                       PASS      0.19 seconds
SubjectPrefix                 PASS      0.06 seconds
BuildKernel                   PASS      21.40 seconds
CheckAllWarning               PASS      23.48 seconds
CheckSparse                   PASS      22.69 seconds
BuildKernel32                 PASS      21.57 seconds
TestRunnerSetup               PASS      420.32 seconds
TestRunner_l2cap-tester       PASS      23.32 seconds
TestRunner_iso-tester         PASS      34.58 seconds
TestRunner_bnep-tester        PASS      5.01 seconds
TestRunner_mgmt-tester        FAIL      96.59 seconds
TestRunner_rfcomm-tester      PASS      7.48 seconds
TestRunner_sco-tester         PASS      11.88 seconds
TestRunner_ioctl-tester       PASS      8.47 seconds
TestRunner_mesh-tester        FAIL      9.96 seconds
TestRunner_smp-tester         PASS      6.96 seconds
TestRunner_userchan-tester    PASS      5.33 seconds
TestRunner_6lowpan-tester     FAIL      6.73 seconds
IncrementalBuild              PASS      20.92 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2] Bluetooth: btintel_pcie: Fix build error when CONFIG_ACPI is disabled
WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report #95:

total: 0 errors, 1 warnings, 19 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/patch/14527116.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success Failed 0.076 seconds
##############################
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.143 seconds
Mesh - Send cancel - 2                               Timed out    1.996 seconds

##############################
Test: TestRunner_6lowpan-tester - FAIL
Desc: Run 6lowpan-tester with test-runner
Output:
WARNING: possible circular locking dependency detected 7.0.0-rc7-gcac561d0a38b #1 Not tainted
------------------------------------------------------
kworker/0:1/11 is trying to acquire lock:
ffff8880026d9940 ((wq_completion)hci0#2){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x75/0x180

but task is already holding lock:
ffffffffbd44f960 (rtnl_mutex){+.+.}-{4:4}, at: lowpan_unregister_netdev+0xd/0x30

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #4 (rtnl_mutex){+.+.}-{4:4}:

       lock_acquire+0xf7/0x2c0
       __mutex_lock+0x16b/0x1fc0
       lowpan_register_netdev+0x11/0x30
       chan_ready_cb+0x836/0xd00
       l2cap_recv_frame+0x61bb/0x88e0
       l2cap_recv_acldata+0x790/0xdf0
       hci_rx_work+0x500/0xd00
       process_scheduled_works+0xba7/0x1a90
       worker_thread+0x514/0xbb0
       kthread+0x368/0x490
       ret_from_fork+0x498/0x7e0
       ret_from_fork_asm+0x19/0x30

-> #3 (&chan->lock#3/1){+.+.}-{4:4}:

       lock_acquire+0xf7/0x2c0
       __mutex_lock+0x16b/0x1fc0
       l2cap_chan_connect+0x74e/0x1980
       lowpan_control_write+0x523/0x660
       full_proxy_write+0x10b/0x190
       vfs_write+0x1c0/0xf60
       ksys_write+0xf1/0x1d0
       do_syscall_64+0xa0/0x570
       entry_SYSCALL_64_after_hwframe+0x74/0x7c

-> #2 (&conn->lock){+.+.}-{4:4}:
...
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

https://github.com/bluez/bluetooth-next/pull/96

---
Regards,
Linux Bluetooth