lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADg1FFdVu7BjLi+Jr4KaHnkQBJCShOCpc7veXmqKN0nYkdhAYg@mail.gmail.com>
Date: Tue, 27 May 2025 17:04:42 +0800
From: Hsin-chen Chuang <chharry@...gle.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Marcel Holtmann <marcel@...tmann.org>, Luiz Augusto von Dentz <luiz.dentz@...il.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, 
	Balakrishna Godavarthi <bgodavar@....qualcomm.com>, Jiating Wang <jiatingw@....qualcomm.com>, 
	Vincent Chuang <vincentch@...gle.com>, linux-bluetooth@...r.kernel.org, 
	linux-kernel@...r.kernel.org, 
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, stable@...r.kernel.org
Subject: Re: [PATCH] Bluetooth: hci_qca: move the SoC type check to the right place

On Tue, May 27, 2025 at 3:47 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> Commit 3d05fc82237a ("Bluetooth: qca: set power_ctrl_enabled on NULL
> returned by gpiod_get_optional()") accidentally changed the prevous

typo: previous

> behavior where power control would be disabled without the BT_EN GPIO
> only on QCA_WCN6750 and QCA_WCN6855 while also getting the error check
> wrong. We should treat every IS_ERR() return value from
> devm_gpiod_get_optional() as a reason to bail-out while we should only
> set power_ctrl_enabled to false on the two models mentioned above. While
> at it: use dev_err_probe() to save a LOC.
>
> Cc: stable@...r.kernel.org
> Fixes: 3d05fc82237a ("Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional()")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> ---
>  drivers/bluetooth/hci_qca.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index e00590ba24fdb..a2dc39c005f4f 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -2415,14 +2415,14 @@ static int qca_serdev_probe(struct serdev_device *serdev)
>
>                 qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable",
>                                                GPIOD_OUT_LOW);
> -               if (IS_ERR(qcadev->bt_en) &&
> -                   (data->soc_type == QCA_WCN6750 ||
> -                    data->soc_type == QCA_WCN6855)) {
> -                       dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n");
> -                       return PTR_ERR(qcadev->bt_en);
> -               }
> +               if (IS_ERR(qcadev->bt_en))
> +                       return dev_err_probe(&serdev->dev,
> +                                            PTR_ERR(qcadev->bt_en),
> +                                            "failed to acquire BT_EN gpio\n");
>
> -               if (!qcadev->bt_en)
> +               if (!qcadev->bt_en &&
> +                   (data->soc_type == QCA_WCN6750 ||
> +                    data->soc_type == QCA_WCN6855))
>                         power_ctrl_enabled = false;
>
>                 qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl",
> --
> 2.48.1
>

Thanks for the fix!

Tested on a Chromebook device with WCN3991 chip.
Without the patch the hdev->reset callback would make the HCI device
unrecoverable, and with the patch the callback can reset the HCI
device smoothly.

Tested-by: Hsin-chen Chuang <chharry@...omium.org>
Reviewed-by: Hsin-chen Chuang <chharry@...omium.org>


Best Regards,
Hsin-chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ