Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Loic Poulain" <loic.poulain@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v6 02/11] Bluetooth: hci_qca: Rename 'power_ctrl_enabled' to 'bt_en_available'
Date: Fri, 04 Sep 2026 16:00:50 +0000	[thread overview]
Message-ID: <20260904160050.B19601F00A3F@smtp.kernel.org> (raw)
In-Reply-To: <20260904-monza-wireless-v6-2-d8c5042b3efd@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Renaming 'power_ctrl_enabled' to 'bt_en_available' introduces conceptually flawed and misleading variable semantics that contradict the hardware configuration paths.
--

commit 17c23b3051787bb7fc513728ad005355fa649bd0
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Subject: Bluetooth: hci_qca: Rename 'power_ctrl_enabled' to 'bt_en_available'

This commit renames the 'power_ctrl_enabled' flag to 'bt_en_available' in
an effort to clarify the availability of the BT_EN GPIO in the devicetree
and avoid naming confusion with the new pwrctrl framework.

> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index c8ea5507bdc2c..f7a20138cb742 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -2396,7 +2396,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
>  	struct hci_dev *hdev;
>  	const struct qca_device_data *data;
>  	int err;
> -	bool power_ctrl_enabled = true;
> +	bool bt_en_available = true;

[Severity: Medium]
Does renaming this variable to bt_en_available introduce a semantic
contradiction? For devices like QCA_WCN3990 that use UART power pulses
rather than a dedicated BT_EN GPIO, this variable remains true throughout
qca_serdev_probe() even when qcadev->bt_en is NULL.

[ ... ]

> @@ -2504,7 +2504,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
>  		    (data->soc_type == QCA_WCN6750 ||
>  		     data->soc_type == QCA_WCN6855 ||
>  		     data->soc_type == QCA_WCN7850))
> -			power_ctrl_enabled = false;
> +			bt_en_available = false;

[Severity: Medium]
For SoCs outside of this specific list (like QCA_WCN3990), bt_en_available
remains true here even if qcadev->bt_en is NULL, which contradicts the
variable's new name.

[ ... ]

> @@ -2560,7 +2560,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
>  
>  	hdev = qcadev->serdev_hu.hdev;
>  
> -	if (power_ctrl_enabled) {
> +	if (bt_en_available) {
>  		hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP);
>  		hdev->shutdown = qca_hci_shutdown;
>  	}

[Severity: Medium]
By renaming the flag to bt_en_available, does this falsely imply the GPIO
is actively present? 

The commit message states the flag is used to indicate the availability of
the BT_EN GPIO. However, the flag actually seems to track whether the driver
manages the controller's power state via any mechanism (including UART
in-band pulses or pwrseq). 

Since this flag correctly remains true for SoCs where power control relies
on UART pulses so the shutdown callback is registered (even though
qcadev->bt_en is NULL), could this semantic mismatch lead to a NULL pointer
dereference if a future developer relies on bt_en_available being true as a
safe guarantee to dereference qcadev->bt_en?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-monza-wireless-v6-0-d8c5042b3efd@oss.qualcomm.com?part=2

  reply	other threads:[~2026-09-04 16:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 15:42 [PATCH v6 00/11] arm64: dts: monaco-arduino-monza: Add support for LGA WiFi/BT module Loic Poulain
2026-09-04 15:42 ` [PATCH v6 01/11] Bluetooth: hci_qca: Add M.2 Bluetooth device support using pwrseq Loic Poulain
2026-09-04 16:02   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 02/11] Bluetooth: hci_qca: Rename 'power_ctrl_enabled' to 'bt_en_available' Loic Poulain
2026-09-04 16:00   ` sashiko-bot [this message]
2026-09-04 15:42 ` [PATCH v6 03/11] power: sequencing: Add pwrseq_is_controllable() API Loic Poulain
2026-09-04 15:52   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 04/11] power: sequencing: pcie-m2: Report power controllability Loic Poulain
2026-09-04 15:48   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 05/11] power: sequencing: qcom-wcn: " Loic Poulain
2026-09-04 15:51   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 06/11] Bluetooth: hci_qca: Set 'bt_en_available' based on pwrseq " Loic Poulain
2026-09-04 15:59   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 07/11] Bluetooth: hci_qca: Embed bt_power in struct qca_serdev Loic Poulain
2026-09-04 15:53   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 08/11] Bluetooth: hci_qca: Support QCA2066 on M.2 connector via pwrseq Loic Poulain
2026-09-04 16:00   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 09/11] Bluetooth: hci_qca: Flatten struct qca_power into struct qca_serdev Loic Poulain
2026-09-04 15:57   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 10/11] dt-bindings: connector: pcie-m2-e: Add vendor LGA connector compatible Loic Poulain
2026-09-04 15:51   ` sashiko-bot
2026-09-04 15:42 ` [PATCH v6 11/11] arm64: dts: qcom: monaco-arduino-monza: Add QCA2066 M.2 WiFi/BT support Loic Poulain
2026-09-04 16:08   ` sashiko-bot

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=20260904160050.B19601F00A3F@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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