regressions.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: regressions@lists.linux.dev, stable <stable@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Marcel Holtmann <marcel@holtmann.org>
Subject: Re: regression: Bluetooth interface broken on systems with Mediatek CPU
Date: Mon, 9 Aug 2021 12:18:11 -0700	[thread overview]
Message-ID: <20210809191811.GA1467958@roeck-us.net> (raw)
In-Reply-To: <CAAd53p7b_uHGqx5FT-s=8+M+PZVREX=3igEsGRgR4JL-TK64QA@mail.gmail.com>

On Mon, Aug 09, 2021 at 12:48:16PM +0800, Kai-Heng Feng wrote:
> Hi Guenter,
> 
> On Mon, Aug 9, 2021 at 12:10 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Mon, Aug 09, 2021 at 10:35:34AM +0800, Kai-Heng Feng wrote:
> > > On Sat, Aug 7, 2021 at 6:22 AM Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> > > > [ Greg asked me to submit a report to regressions@, so here it is. ]
> > > >
> > > > The following error was observed on Chromebooks with MT8183 CPU
> > > > (ASUS Chromebook Detachable CM3, HP Chromebook 11a, and others):
> > > >
> > > > [  224.735198] Bluetooth: qca_setup() hci0: setting up ROME/QCA6390
> > > > [  225.205024] Bluetooth: qca_read_soc_version() hci0: QCA Product ID   :0x00000008
> > > > [  225.205040] Bluetooth: qca_read_soc_version() hci0: QCA SOC Version  :0x00000044
> > > > [  225.205045] Bluetooth: qca_read_soc_version() hci0: QCA ROM Version  :0x00000302
> > > > [  225.205049] Bluetooth: qca_read_soc_version() hci0: QCA Patch Version:0x000003e8
> > > > [  225.205055] Bluetooth: qca_uart_setup() hci0: QCA controller version 0x00440302
> > > > [  225.205061] Bluetooth: qca_download_firmware() hci0: QCA Downloading qca/rampatch_00440302.bin
> > > > [  227.252653] Bluetooth: hci_cmd_timeout() hci0: command 0xfc00 tx timeout
> > > > ...
> > > > [  223.604971] Bluetooth: qca_recv() hci0: Frame reassembly failed (-84)
> > > > [  223.605027] Bluetooth: qca_recv() hci0: Frame reassembly failed (-84)
> > > > (repeated several times)
> > > > ...
> > > >
> > > > The Bluetooth interface on those Chromebooks can not be enabled.
> > > >
> > > > Bisect suggests that upstream commit 0ea9fd001a14 ("Bluetooth: Shutdown
> > > > controller after workqueues are flushed or cancelled") introduced the problem.
> > > > Reverting it fixes the problem.
> > > >
> > > > The problem was also reported at [1] on a Mediatek Pumpkin board.
> > > >
> > > > As of this writing, the problem is still present in the upstream kernel
> > > > as well as in all stable releases which include commit 0ea9fd001a14.
> > >
> > > Thanks. Can you please test the following patch:
> > >
> > I would love to, but I am unable to apply the patch. It failed to apply
> > to mainline, to linux-next, and to all stable releases I tried.
> 
> I think it has something to do with how the code gets pasted to the mail client.
> So can you please give this a try:
> https://paste.ubuntu.com/p/CsRrQWNYKr/
> 
That is different to the patch you just submitted. I assume that patch is
the final version. I assume that is the final version. Since it was already
tested, I'll stop testing this one.

Guenter

> Kai-Heng
> 
> >
> > Guenter
> >
> > > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> > > index 2560ed2f144d4..131e69a9a66a0 100644
> > > --- a/net/bluetooth/hci_core.c
> > > +++ b/net/bluetooth/hci_core.c
> > > @@ -1757,6 +1757,14 @@ int hci_dev_do_close(struct hci_dev *hdev)
> > >                         cancel_delayed_work_sync(&adv_instance->rpa_expired_cb);
> > >         }
> > >
> > > +       if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
> > > +           !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
> > > +           test_bit(HCI_UP, &hdev->flags)) {
> > > +               /* Execute vendor specific shutdown routine */
> > > +               if (hdev->shutdown)
> > > +                       hdev->shutdown(hdev);
> > > +       }
> > > +
> > >         /* Avoid potential lockdep warnings from the *_flush() calls by
> > >          * ensuring the workqueue is empty up front.
> > >          */
> > > @@ -1798,14 +1806,6 @@ int hci_dev_do_close(struct hci_dev *hdev)
> > >                 clear_bit(HCI_INIT, &hdev->flags);
> > >         }
> > >
> > > -       if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
> > > -           !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
> > > -           test_bit(HCI_UP, &hdev->flags)) {
> > > -               /* Execute vendor specific shutdown routine */
> > > -               if (hdev->shutdown)
> > > -                       hdev->shutdown(hdev);
> > > -       }
> > > -
> > >         /* flush cmd  work */
> > >         flush_work(&hdev->cmd_work);
> > >
> > >
> > > >
> > > > Thanks,
> > > > Guenter
> > > >
> > > > ---
> > > > [1] https://lkml.org/lkml/2021/7/28/569

  reply	other threads:[~2021-08-09 19:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 22:21 regression: Bluetooth interface broken on systems with Mediatek CPU Guenter Roeck
2021-08-09  2:35 ` Kai-Heng Feng
2021-08-09  4:10   ` Guenter Roeck
2021-08-09  4:48     ` Kai-Heng Feng
2021-08-09 19:18       ` Guenter Roeck [this message]
2021-08-09 13:26 ` Marcel Holtmann

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=20210809191811.GA1467958@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=marcel@holtmann.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.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).