[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AS8PR04MB840464A53BB6FB11FE25EC9C92DBA@AS8PR04MB8404.eurprd04.prod.outlook.com>
Date: Fri, 20 Oct 2023 10:39:56 +0000
From: Sherry Sun <sherry.sun@....com>
To: Marcel Ziswiler <marcel@...wiler.com>,
"linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>
CC: Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
Neeraj sanjay kale <neeraj.sanjaykale@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Marcel Holtmann <marcel@...tmann.org>,
Marcel Ziswiler <marcel.ziswiler@...adex.com>,
Amitkumar Karwar <amitkumar.karwar@....com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: RE: [PATCH v1 2/2] Bluetooth: btnxpuart: Fix nxp_setup
> -----Original Message-----
> From: Marcel Ziswiler <marcel@...wiler.com>
> Sent: 2023年10月18日 22:56
> To: linux-bluetooth@...r.kernel.org
> Cc: Sherry Sun <sherry.sun@....com>; Johan Hedberg
> <johan.hedberg@...il.com>; Luiz Augusto von Dentz
> <luiz.dentz@...il.com>; Neeraj sanjay kale <neeraj.sanjaykale@....com>;
> linux-kernel@...r.kernel.org; Marcel Holtmann <marcel@...tmann.org>;
> Marcel Ziswiler <marcel.ziswiler@...adex.com>; Amitkumar Karwar
> <amitkumar.karwar@....com>; Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> Subject: [PATCH v1 2/2] Bluetooth: btnxpuart: Fix nxp_setup
>
> From: Marcel Ziswiler <marcel.ziswiler@...adex.com>
>
> Unfortunately, nxp_setup() may inadvertently assume that the firmware is
> already running while the module is not even powered yet.
> Fix this by waiting up to 10 seconds for the CTS to go up as the combo
> firmware might be loaded by the Wi-Fi driver over SDIO (mwifiex_sdio).
>
> Fixes: 689ca16e5232 ("Bluetooth: NXP: Add protocol support for NXP
> Bluetooth chipsets")
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@...adex.com>
>
> ---
> This is what may happen without this fix:
> [ 284.588177] Bluetooth: hci0: Opcode 0x0c03 failed: -110 [ 286.636167]
> Bluetooth: hci0: Setting wake-up method failed (-110) Unfortunately, even
> re-loading the btnxpuart kernel module would not recover from this
> condition.
>
> drivers/bluetooth/btnxpuart.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
> index 9cb7529eef09..4b83a0aa3459 100644
> --- a/drivers/bluetooth/btnxpuart.c
> +++ b/drivers/bluetooth/btnxpuart.c
> @@ -1021,6 +1021,16 @@ static int nxp_setup(struct hci_dev *hdev)
> if (err < 0)
> return err;
> } else {
> + /* The combo firmware might be loaded by the Wi-Fi driver
> over SDIO (mwifiex_sdio).
Hi Marcel,
Please remove the description of "over SDIO (mwifiex_sdio)" here, because the Wi-Fi driver corresponding to the NXP BT chip not only supports the SDIO interface, but also supports the PCIe bus.
That is to say, combo firmware can be loaded via the SDIO or PCIe bus.
Best Regards
Sherry
> + * We wait up to 10s for the CTS to go up. Afterwards, we
> know that the firmware is
> + * really ready.
> + */
> + err = serdev_device_wait_for_cts(nxpdev->serdev, true,
> 10000);
> + if (err) {
> + bt_dev_err(nxpdev->hdev, "Wait for CTS failed
> with %d", err);
> + return err;
> + }
> +
> bt_dev_dbg(hdev, "FW already running.");
> clear_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev-
> >tx_state);
> }
> --
> 2.36.1
Powered by blists - more mailing lists