mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chris Lu (陸稚泓)" <Chris.Lu@mediatek.com>
To: "luiz.dentz@gmail.com" <luiz.dentz@gmail.com>
Cc: "Aaron Hou (侯俊仰)" <Aaron.Hou@mediatek.com>,
	"marcel@holtmann.org" <marcel@holtmann.org>,
	"Steve Lee (李視誠)" <steve.lee@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"johan.hedberg@gmail.com" <johan.hedberg@gmail.com>,
	"Sean Wang" <Sean.Wang@mediatek.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v1] Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices.
Date: Tue, 7 Jan 2025 02:47:07 +0000	[thread overview]
Message-ID: <d286e31689c8a38b5ee864ee84e4c18eeb36238b.camel@mediatek.com> (raw)
In-Reply-To: <CABBYNZJOEi_=vLiivGFt7tKiq8TMn9YG=FkC20y-6M75Bi8vYg@mail.gmail.com>

Hi Luiz,

Thanks for your reply.

On Mon, 2025-01-06 at 15:44 -0500, Luiz Augusto von Dentz wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Hi Chris,
> 
> On Mon, Dec 23, 2024 at 3:58 AM Chris Lu <chris.lu@mediatek.com>
> wrote:
> > 
> > Use usb_autopm_get_interface() and usb_autopm_put_interface()
> > in btmtk_usb_shutdown(), it could send func ctrl after enabling
> > autosuspend.
> > 
> > Bluetooth: btusb_mtk_hci_wmt_sync() hci0: Execution of wmt command
> >            timed out
> > Bluetooth: btusb_mtk_shutdown() hci0: Failed to send wmt func ctrl
> >            (-110)
> > 
> > Signed-off-by: Chris Lu <chris.lu@mediatek.com>
> 
> Missing Fixes tag, Ive been adding it myself for some time now but
> you
> better create the practice to include it so I don't have to go find
> what commit introduced btmtk_usb_shutdown to then do git log -1
> --pretty=fixes and git commit --amend.
> 
This change was submitted by another MediaTek member around two years
ago (but it was ignored and wasn't merged at that time). We recently
found it was missed when reviewing our btusb changes and trying to
submit it again.

Anyway, I'll do another submit to add fixes tag. Thank you for the
reminder.
> > ---
> >  drivers/bluetooth/btmtk.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> > index 7fd9d5ddce02..224eafc27dbe 100644
> > --- a/drivers/bluetooth/btmtk.c
> > +++ b/drivers/bluetooth/btmtk.c
> > @@ -1472,10 +1472,15 @@ EXPORT_SYMBOL_GPL(btmtk_usb_setup);
> > 
> >  int btmtk_usb_shutdown(struct hci_dev *hdev)
> >  {
> > +       struct btmtk_data *data = hci_get_priv(hdev);
> >         struct btmtk_hci_wmt_params wmt_params;
> >         u8 param = 0;
> >         int err;
> > 
> > +       err = usb_autopm_get_interface(data->intf);
> > +       if (err < 0)
> > +               return err;
> > +
> >         /* Disable the device */
> >         wmt_params.op = BTMTK_WMT_FUNC_CTRL;
> >         wmt_params.flag = 0;
> > @@ -1486,9 +1491,11 @@ int btmtk_usb_shutdown(struct hci_dev *hdev)
> >         err = btmtk_usb_hci_wmt_sync(hdev, &wmt_params);
> >         if (err < 0) {
> >                 bt_dev_err(hdev, "Failed to send wmt func ctrl
> > (%d)", err);
> > +               usb_autopm_put_interface(data->intf);
> >                 return err;
> >         }
> > 
> > +       usb_autopm_put_interface(data->intf);
> >         return 0;
> >  }
> >  EXPORT_SYMBOL_GPL(btmtk_usb_shutdown);
> > --
> > 2.45.2
> > 
> 
> 
> --
> Luiz Augusto von Dentz

Thanks,
Chris Lu

      reply	other threads:[~2025-01-07  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-23  8:58 Chris Lu
2025-01-06 20:44 ` Luiz Augusto von Dentz
2025-01-07  2:47   ` Chris Lu (陸稚泓) [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=d286e31689c8a38b5ee864ee84e4c18eeb36238b.camel@mediatek.com \
    --to=chris.lu@mediatek.com \
    --cc=Aaron.Hou@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=steve.lee@mediatek.com \
    /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

all inboxes | Powered by JetHome®