Skip to contentSkip to conversation

More CONFIG_PM* simplifications

PATCH Applied Bastien Nocera 4 participants 6 messages Jan 19 – Jan 20

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

v3 cover More CONFIG_PM* simplifications

Follow-up from the earlier "Bluetooth: btusb: Use pm_ptr instead of #ifdef CONFIG_PM" patch.

Both drivers were successfully compiled with CONFIG_PM disabled.

Changes since v2:
- Drop btmtksdio.c changes, there's a fix in bluetooth-next

Changes since v1:
- Fix "defined but not used" warnings reported by the kernel test robot
- Modify commit messages following review comments

Bastien Nocera (2):
Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef
Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's

 drivers/bluetooth/btnxpuart.c |  6 ++----
 drivers/bluetooth/hci_intel.c | 10 ++--------
 2 files changed, 4 insertions(+), 12 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH v3 1/2 Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef

The functions are already disabled through the use of pm_ptr() when CONFIG_PM is disabled, and will be removed from the final linked code as not needed.

This increases build coverage and allows to drop an #ifdef.

---
 drivers/bluetooth/btnxpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/bluetooth/btnxpuart.c +2 -4
index 3b1e9224e965..e7036a48ce48 100644
@@ -1947,8 +1947,7 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
 	hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int nxp_serdev_suspend(struct device *dev)
+static int __maybe_unused nxp_serdev_suspend(struct device *dev)
 {
 	struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
 	struct ps_data *psdata = &nxpdev->psdata;
@@ -1962,7 +1961,7 @@ static int nxp_serdev_suspend(struct device *dev)
 	return 0;
 }
 
-static int nxp_serdev_resume(struct device *dev)
+static int __maybe_unused nxp_serdev_resume(struct device *dev)
 {
 	struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
 	struct ps_data *psdata = &nxpdev->psdata;
@@ -1975,7 +1974,6 @@ static int nxp_serdev_resume(struct device *dev)
 	ps_control(psdata->hdev, PS_STATE_AWAKE);
 	return 0;
 }
-#endif
 
 #ifdef CONFIG_DEV_COREDUMP
 static void nxp_serdev_coredump(struct device *dev)
Signature · 1 line
2.52.0
#2 lore raw

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

---Test result---

Test Summary:

CheckPatch                    PENDING   0.48 seconds
GitLint                       PENDING   0.35 seconds
SubjectPrefix                 PASS      0.15 seconds
BuildKernel                   PASS      23.61 seconds
CheckAllWarning               PASS      26.42 seconds
CheckSparse                   PASS      28.89 seconds
BuildKernel32                 PASS      23.45 seconds
TestRunnerSetup               PASS      515.78 seconds
TestRunner_l2cap-tester       PASS      28.67 seconds
TestRunner_iso-tester         FAIL      58.89 seconds
TestRunner_bnep-tester        PASS      6.37 seconds
TestRunner_mgmt-tester        FAIL      124.26 seconds
TestRunner_rfcomm-tester      PASS      9.53 seconds
TestRunner_sco-tester         FAIL      14.63 seconds
TestRunner_ioctl-tester       PASS      10.34 seconds
TestRunner_mesh-tester        FAIL      12.49 seconds
TestRunner_smp-tester         PASS      8.81 seconds
TestRunner_userchan-tester    PASS      6.83 seconds
IncrementalBuild              PENDING   0.71 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:

BUG: KASAN: slab-use-after-free in le_read_features_complete+0x7e/0x2b0

Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 488 (98.8%), Failed: 2, Not Run: 4

Failed Test Cases

Read Exp Feature - Success                           Failed       0.108 seconds
LL Privacy - Remove Device 3 (Disable RL)            Failed       0.204 seconds

##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected

BUG: sleeping function called from invalid context at net/core/sock.c:3782

Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
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.711 seconds
Mesh - Send cancel - 2                               Timed out    1.999 seconds

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#3 lore raw

PATCH v3 1/2 Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef

In reply to Bastien Nocera

Hi Bastien,

Thank you for the patch. I am okay with this.

Thanks,
Neeraj

Quoted 46 lines

The functions are already disabled through the use of pm_ptr() when CONFIG_PM is disabled, and will be removed from the final linked code as not needed.

This increases build coverage and allows to drop an #ifdef.

---
 drivers/bluetooth/btnxpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/bluetooth/btnxpuart.c +1 -2
index 3b1e9224e965..e7036a48ce48 100644
@@ -1947,8 +1947,7 @@ static void nxp_serdev_remove(struct
 serdev_device *serdev)
        hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int nxp_serdev_suspend(struct device *dev)
+static int __maybe_unused nxp_serdev_suspend(struct device *dev)
 {
        struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
        struct ps_data *psdata = &nxpdev->psdata; @@ -1962,7 +1961,7 @@
static int nxp_serdev_suspend(struct device *dev)
        return 0;

}

drivers/bluetooth/btnxpuart.c +1 -1
-static int nxp_serdev_resume(struct device *dev)
+static int __maybe_unused nxp_serdev_resume(struct device *dev)
 {
        struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
        struct ps_data *psdata = &nxpdev->psdata; @@ -1975,7 +1974,6 @@

static int nxp_serdev_resume(struct device *dev)

        ps_control(psdata->hdev, PS_STATE_AWAKE);
        return 0;

}
-#endif

#ifdef CONFIG_DEV_COREDUMP
static void nxp_serdev_coredump(struct device *dev)
--
2.52.0

#4 lore raw

PATCH v3 2/2 Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's

In reply to Bastien Nocera

The functions are already disabled if CONFIG_PM or CONFIG_PM_SLEEP are disabled through the use of SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS().

This increases build coverage and allows to drop a few #ifdef's.

---
 drivers/bluetooth/hci_intel.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/bluetooth/hci_intel.c +2 -8
index 20baf2895dec..f7570c2eaa46 100644
@@ -126,7 +126,6 @@ static int intel_wait_booting(struct hci_uart *hu)
 	return err;
 }
 
-#ifdef CONFIG_PM
 static int intel_wait_lpm_transaction(struct hci_uart *hu)
 {
 	struct intel_data *intel = hu->priv;
@@ -237,7 +236,6 @@ static int intel_lpm_resume(struct hci_uart *hu)
 
 	return 0;
 }
-#endif /* CONFIG_PM */
 
 static int intel_lpm_host_wake(struct hci_uart *hu)
 {
@@ -1066,7 +1064,6 @@ static const struct acpi_device_id intel_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, intel_acpi_match);
 #endif
 
-#ifdef CONFIG_PM
 static int intel_suspend_device(struct device *dev)
 {
 	struct intel_device *idev = dev_get_drvdata(dev);
@@ -1090,10 +1087,8 @@ static int intel_resume_device(struct device *dev)
 
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM_SLEEP
-static int intel_suspend(struct device *dev)
+static int __maybe_unused intel_suspend(struct device *dev)
 {
 	struct intel_device *idev = dev_get_drvdata(dev);
 
@@ -1103,7 +1098,7 @@ static int intel_suspend(struct device *dev)
 	return intel_suspend_device(dev);
 }
 
-static int intel_resume(struct device *dev)
+static int __maybe_unused intel_resume(struct device *dev)
 {
 	struct intel_device *idev = dev_get_drvdata(dev);
 
@@ -1112,7 +1107,6 @@ static int intel_resume(struct device *dev)
 
 	return intel_resume_device(dev);
 }
-#endif
 
 static const struct dev_pm_ops intel_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(intel_suspend, intel_resume)
Signature · 1 line
2.52.0
#5 lore raw
In reply to Bastien Nocera
This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 9 lines · On Mon, 19 Jan 2026 13:34:58 +0100 you wrote:

Follow-up from the earlier "Bluetooth: btusb: Use pm_ptr instead of #ifdef CONFIG_PM" patch.

Both drivers were successfully compiled with CONFIG_PM disabled.

Changes since v2:
- Drop btmtksdio.c changes, there's a fix in bluetooth-next

[...]

Here is the summary with links:
- [v3,1/2] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef

    https://git.kernel.org/bluetooth/bluetooth-next/c/854aa613b6b3
  - [v3,2/2] Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's
    https://git.kernel.org/bluetooth/bluetooth-next/c/ba93b539e8d4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html