From: sashiko-bot@kernel.org
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 1/5] Bluetooth: hci_qca: Add auxiliary driver for PCIe M.2 modules
Date: Mon, 30 Nov 2026 12:38:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-241075@kernel.org> (raw)
In-Reply-To: <20261130-pci-m2-bt-rework-v2-1-922fcad88987@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] Bluetooth: hci_qca: NULL dereference in qca_dmp_hdr() for aux
devices
- [Medium] Bluetooth: hci_qca: missing PM and coredump ops on
qca_bt_aux_driver
--
commit 28d84e9c985d5fd3edfae6434f5aa52e0b7a1125
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Bluetooth: hci_qca: Add auxiliary driver for PCIe M.2 modules
This commit adds an auxiliary driver and shared header to bind to PCIe M.2
Bluetooth auxiliary devices created by the power sequencing driver,
registering the pre-allocated serdev UART transport and driving power via
devm_pwrseq_get().
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index d51db761f5a6d..1212520ab6f07 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
[ ... ]
> @@ -2920,15 +2922,118 @@ static struct serdev_device_driver qca_serdev_driver = {
> },
> };
>
> +static int qca_bt_aux_probe(struct auxiliary_device *adev,
> + const struct auxiliary_device_id *id)
> +{
> + struct pcie_m2_bt_auxdev *bt_auxdev = to_pcie_m2_bt_auxdev(adev);
> + struct serdev_device *serdev = bt_auxdev->serdev;
> + const struct qca_device_data *data;
> + struct device *dev = &adev->dev;
> + struct qca_serdev *qcadev;
> + struct hci_dev *hdev;
> + bool controllable;
> + int err;
> +
> + data = (const struct qca_device_data *)id->driver_data;
> + if (!data)
> + return -ENODATA;
> +
> + qcadev = devm_kzalloc_obj(dev, *qcadev);
> + if (!qcadev)
> + return -ENOMEM;
> +
> + qcadev->serdev_hu.serdev = serdev;
> + qcadev->btsoc_type = data->soc_type;
> + serdev_device_set_drvdata(serdev, qcadev);
[Severity: High]
Will qca_dmp_hdr() dereference a NULL serdev->dev.driver when generating a
devcoredump for an auxiliary device?
Because qca_bt_aux_driver binds to adev->dev rather than binding a serdev
driver to serdev->dev, hu->serdev is non-NULL while hu->serdev->dev.driver
remains NULL:
drivers/bluetooth/hci_qca.c:qca_dmp_hdr() {
...
snprintf(buf, sizeof(buf), "Driver: %s\n",
hu->serdev ? hu->serdev->dev.driver->name : "hci_ldisc_qca");
skb_put_data(skb, buf, strlen(buf));
}
When the controller crashes or a dump is triggered via force_devcd,
hci_devcd_init() invokes qca_dmp_hdr() and causes a NULL pointer
dereference.
[ ... ]
> +static struct auxiliary_driver qca_bt_aux_driver = {
> + .name = "qca_bt",
> + .probe = qca_bt_aux_probe,
> + .remove = qca_bt_aux_remove,
> + .id_table = qca_bt_aux_id_table,
> +};
[Severity: Medium]
Should qca_bt_aux_driver also wire up qca_pm_ops and hciqca_coredump in
qca_bt_aux_driver.driver?
Since serdev->dev has no bound driver on auxiliary devices, qca_suspend()
and qca_resume() will not run during system suspend/resume to quiesce
in-band sleep state, timers and work items or wait for in-flight firmware
downloads and SSR dumps, and the sysfs coredump trigger will not be wired
up. Note that qca_suspend(), qca_resume() and hciqca_coredump() currently
use to_serdev_device(dev) before calling serdev_device_get_drvdata(),
whereas dev_get_drvdata(dev) would work for both serdev and auxiliary
devices.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130-pci-m2-bt-rework-v2-0-922fcad88987@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-11-30 12:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 12:19 [PATCH v2 0/5] Rework M.2 Bluetooth instantiation using the auxiliary bus Manivannan Sadhasivam via B4 Relay
2026-11-30 12:19 ` [PATCH v2 1/5] Bluetooth: hci_qca: Add auxiliary driver for PCIe M.2 modules Manivannan Sadhasivam via B4 Relay
2026-11-30 12:38 ` sashiko-bot [this message]
2026-11-30 12:49 ` Loic Poulain
2026-11-30 12:19 ` [PATCH v2 2/5] Bluetooth: btnxpuart: " Manivannan Sadhasivam via B4 Relay
2026-11-30 12:36 ` sashiko-bot
2026-11-30 12:19 ` [PATCH v2 3/5] power: sequencing: pcie-m2: Create auxiliary device for the M.2 BT interface Manivannan Sadhasivam via B4 Relay
2026-11-30 12:36 ` sashiko-bot
2026-11-30 12:19 ` [PATCH v2 4/5] Bluetooth: hci_qca: Drop serdev based M.2 power sequencing code Manivannan Sadhasivam via B4 Relay
2026-11-30 12:19 ` [PATCH v2 5/5] Bluetooth: btnxpuart: " Manivannan Sadhasivam via B4 Relay
2026-11-30 12:38 ` [PATCH v2 0/5] Rework M.2 Bluetooth instantiation using the auxiliary bus 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=sashiko-outbox-241075@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--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