From: Matthias Kaehlcke <mka@chromium.org>
To: Zijun Hu <zijuhu@codeaurora.org>
Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org,
c-hbandi@codeaurora.org, hemantg@codeaurora.org,
rjliao@codeaurora.org
Subject: Re: [PATCH v1] bluetooth: hci_qca: Fix suspend/resume functionality failure
Date: Thu, 28 May 2020 09:16:27 -0700 [thread overview]
Message-ID: <20200528161627.GK4525@google.com> (raw)
In-Reply-To: <1590662302-10102-1-git-send-email-zijuhu@codeaurora.org>
Hi Zijun,
On Thu, May 28, 2020 at 06:38:22PM +0800, Zijun Hu wrote:
> @dev parameter of qca_suspend()/qca_resume() represents
> serdev_device, but it is mistook for hci_dev and causes
> succedent unexpected memory access.
>
> Fix by taking @dev as serdev_device.
>
> Signed-off-by: Zijun Hu <zijuhu@codeaurora.org>
Please add:
Fixes: 41d5b25fed0 ("Bluetooth: hci_qca: add PM support")
and add stable@kernel.org to cc:
> ---
> drivers/bluetooth/hci_qca.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index e4a6823..c159161 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -1977,8 +1977,10 @@ static void qca_serdev_remove(struct serdev_device *serdev)
>
> static int __maybe_unused qca_suspend(struct device *dev)
> {
> - struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
> - struct hci_uart *hu = hci_get_drvdata(hdev);
> + struct serdev_device *serdev = to_serdev_device(dev);
> + struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
> + struct hci_uart *hu = &qcadev->serdev_hu;
> + struct hci_dev *hdev __maybe_unused = hu->hdev;
hdev is not used, please remove
> struct qca_data *qca = hu->priv;
> unsigned long flags;
> int ret = 0;
> @@ -2057,8 +2059,10 @@ static int __maybe_unused qca_suspend(struct device *dev)
>
> static int __maybe_unused qca_resume(struct device *dev)
> {
> - struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
> - struct hci_uart *hu = hci_get_drvdata(hdev);
> + struct serdev_device *serdev = to_serdev_device(dev);
> + struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
> + struct hci_uart *hu = &qcadev->serdev_hu;
> + struct hci_dev *hdev __maybe_unused = hu->hdev;
hdev is not used, please remove
> struct qca_data *qca = hu->priv;
>
> clear_bit(QCA_SUSPENDING, &qca->flags);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
>
prev parent reply other threads:[~2020-05-28 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 10:38 [PATCH v1] bluetooth: hci_qca: Fix suspend/resume functionality failure Zijun Hu
2020-05-28 16:16 ` 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=20200528161627.GK4525@google.com \
--to=mka@chromium.org \
--cc=bgodavar@codeaurora.org \
--cc=c-hbandi@codeaurora.org \
--cc=hemantg@codeaurora.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=rjliao@codeaurora.org \
--cc=zijuhu@codeaurora.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).