From: Matthias Kaehlcke <mka@chromium.org>
To: Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
Balakrishna Godavarthi <bgodavar@codeaurora.org>,
Hemantg <hemantg@codeaurora.org>
Subject: Re: [PATCH] Bluetooth: hci_qca: Add helper function to get the chip family
Date: Fri, 8 Mar 2019 14:03:43 -0800 [thread overview]
Message-ID: <20190308220343.GC69116@google.com> (raw)
In-Reply-To: <20190308185130.207527-1-mka@chromium.org>
On Fri, Mar 08, 2019 at 10:51:30AM -0800, Matthias Kaehlcke wrote:
> Many functions obtain a 'struct qca_serdev' only to read the btsoc_type
> field. Add a helper function that encapsulates this.
>
> This also fixes crashes observed on platforms with ROME controllers
> that are instantiated through ldisc and not as serdev clients. The
> crashes are caused by NULL pointer dereferentiations, which stem from
> the driver's assumption that a QCA HCI device is always associated with
> a serdev device.
>
> Fixes: fa9ad876b8e0 ("Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990")
> Reported-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> drivers/bluetooth/hci_qca.c | 45 +++++++++++++++++++++----------------
> 1 file changed, 26 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index 237aea34b69f..241e099473f8 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -174,6 +174,21 @@ static int qca_power_setup(struct hci_uart *hu, bool on);
> static void qca_power_shutdown(struct hci_uart *hu);
> static int qca_power_off(struct hci_dev *hdev);
>
> +static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu)
> +{
> + enum qca_btsoc_type soc_type;
> +
> + if (hu->serdev) {
> + struct qca_serdev *qsd = serdev_device_get_drvdata(hu->serdev);
> +
> + soc_type = qsd->btsoc_type;
> + } else {
> + soc_type = QCA_AR3002;
Actually this is not correct, I think it should be QCA_ROME.
From commit 6e03126adda3 ("Bluetooth: btqca: Add AR3002 rampatch
support") I deduce the QCA_AR3002 is part of the ROME family. If
that's correct we should probably remove 'QCA_AR3002' (in another
independent patch).
I'll wait with respinning for if there are further comments.
Thanks
Matthias
prev parent reply other threads:[~2019-03-08 22:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 18:51 [PATCH] Bluetooth: hci_qca: Add helper function to get the chip family Matthias Kaehlcke
2019-03-08 22:03 ` Matthias Kaehlcke [this message]
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=20190308220343.GC69116@google.com \
--to=mka@chromium.org \
--cc=bgodavar@codeaurora.org \
--cc=hemantg@codeaurora.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
/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;
as well as URLs for NNTP newsgroup(s).