From: Manivannan Sadhasivam via B4 Relay <devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org>
To: Bartosz Golaszewski <brgl@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Shuai Zhang <quic_shuaz@quicinc.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-bluetooth@vger.kernel.org,
Wei Deng <wei.deng@oss.qualcomm.com>,
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
stable+noautosel@kernel.org
Subject: [PATCH 12/12] Bluetooth: hci_qca: Fix the broken BT_EN GPIO detection for Qcom WCN devices
Date: Wed, 22 Apr 2026 16:54:53 +0530 [thread overview]
Message-ID: <20260422-pwrseq-m2-bt-v1-12-720d02545a64@oss.qualcomm.com> (raw)
In-Reply-To: <20260422-pwrseq-m2-bt-v1-0-720d02545a64@oss.qualcomm.com>
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Commit 'db0ff7e15923 ("driver: bluetooth: hci_qca:fix unable to load the BT
driver")' tried to check the presence of the BT_EN GPIO in Qcom WCN devices
to indicate the HCI layer whether this BT device can be power controlled or
not.
But it was broken for two reasons:
1. Assumes that when devm_pwrseq_get() API returns an error, BT_EN is not
controllable. This is no way true as the API can fail for various reasons
and also the pwrseq-qcom-wcn driver treats the BT_EN GPIO as optional. So
even if the GPIO is not present, it will not fail the probe and this API
will not fail.
2. By skipping the error return, probe deferral is completely broken as the
API may return -EPROBE_DEFER to indicate the caller that the pwrseq driver
is not yet probed. Skipping the return value means, this driver is not
going to depend on pwrseq driver probing again and it just assumes that
the pwrseq is not available.
So to fix these issues, fail the probe if devm_pwrseq_get() returns an
error and if it succeeds, use the newly introduced pwrseq_is_fixed() API to
check whether the power sequencer is fixed or not (i.e., whether the
Bluetooth interface on the Qcom WCN device is controllable using BT_EN GPIO
or not) and set the 'bt_en_available' flag accordingly.
Cc: <stable+noautosel@kernel.org> # Depends on pwrseq change
Fixes: db0ff7e15923 ("driver: bluetooth: hci_qca:fix unable to load the BT driver")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
drivers/bluetooth/hci_qca.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 27e52b08ec47..dd1d93cbb3d8 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2470,16 +2470,13 @@ static int qca_serdev_probe(struct serdev_device *serdev)
qcadev->bt_power->pwrseq = devm_pwrseq_get(&serdev->dev,
"bluetooth");
- /*
- * Some modules have BT_EN enabled via a hardware pull-up,
- * meaning it is not defined in the DTS and is not controlled
- * through the power sequence. In such cases, fall through
- * to follow the legacy flow.
- */
if (IS_ERR(qcadev->bt_power->pwrseq))
- qcadev->bt_power->pwrseq = NULL;
- else
- break;
+ return PTR_ERR(qcadev->bt_power->pwrseq);
+
+ if (pwrseq_is_fixed(qcadev->bt_power->pwrseq))
+ bt_en_available = false;
+
+ break;
}
qcadev->bt_power->dev = &serdev->dev;
--
2.51.0
next prev parent reply other threads:[~2026-04-22 11:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 11:24 [PATCH 00/12] Fixes/improvements for the PCI M.2 power sequencing driver Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 01/12] power: sequencing: Introduce an API to check whether the pwrseq is fixed or controllable Manivannan Sadhasivam via B4 Relay
2026-04-23 16:24 ` Bartosz Golaszewski
2026-04-22 11:24 ` [PATCH 02/12] power: sequencing: pcie-m2: Add support for 'is_fixed()' callback to 'uart' target Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 03/12] power: sequencing: qcom-wcn: Add support for 'is_fixed()' callback to 'bluetooth' target Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 04/12] power: sequencing: pcie-m2: Fix inconsistent function prefixes Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 05/12] power: sequencing: pcie-m2: Allow creating serdev for multiple PCI devices Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 06/12] power: sequencing: pcie-m2: Improve PCI device ID check Manivannan Sadhasivam via B4 Relay
2026-04-22 12:17 ` Konrad Dybcio
2026-04-22 11:24 ` [PATCH 07/12] power: sequencing: pcie-m2: Create serdev for PCI devices present before probe Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 08/12] power: sequencing: pcie-m2: Create BT node based on the pci_device_id[] table Manivannan Sadhasivam via B4 Relay
2026-04-22 11:24 ` [PATCH 09/12] Bluetooth: hci_qca: Add M.2 Bluetooth device support using pwrseq Manivannan Sadhasivam via B4 Relay
2026-04-22 18:14 ` Dmitry Baryshkov
2026-04-22 11:24 ` [PATCH 10/12] Bluetooth: hci_qca: Rename 'power_ctrl_enabled' to 'bt_en_available' Manivannan Sadhasivam via B4 Relay
2026-04-22 18:16 ` Dmitry Baryshkov
2026-04-22 11:24 ` [PATCH 11/12] Bluetooth: hci_qca: Check whether the M.2 UART interface is fixed or not Manivannan Sadhasivam via B4 Relay
2026-04-22 18:17 ` Dmitry Baryshkov
2026-04-22 11:24 ` Manivannan Sadhasivam via B4 Relay [this message]
2026-04-22 18:13 ` [PATCH 12/12] Bluetooth: hci_qca: Fix the broken BT_EN GPIO detection for Qcom WCN devices Dmitry Baryshkov
2026-04-24 6:25 ` [PATCH 00/12] Fixes/improvements for the PCI M.2 power sequencing driver Wei Deng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260422-pwrseq-m2-bt-v1-12-720d02545a64@oss.qualcomm.com \
--to=devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org \
--cc=brgl@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=luiz.von.dentz@intel.com \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=marcel@holtmann.org \
--cc=quic_shuaz@quicinc.com \
--cc=stable+noautosel@kernel.org \
--cc=wei.deng@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox