lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 4 Oct 2022 17:49:34 +0800
From:   Archie Pusaka <apusaka@...gle.com>
To:     Paul Menzel <pmenzel@...gen.mpg.de>
Cc:     linux-bluetooth@...r.kernel.org,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        Marcel Holtmann <marcel@...tmann.org>,
        chromeos-bluetooth-upstreaming@...omium.org,
        Archie Pusaka <apusaka@...omium.org>,
        Abhishek Pandit-Subedi <abhishekpandit@...gle.com>,
        Ying Hsu <yinghsu@...omium.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Bluetooth: btusb: Introduce generic USB reset

Hi Paul,

On Tue, 4 Oct 2022 at 17:18, Paul Menzel <pmenzel@...gen.mpg.de> wrote:
>
> Dear Archie,
>
>
> Thank you for the patch.
>
> Am 04.10.22 um 10:32 schrieb Archie Pusaka:
> > From: Archie Pusaka <apusaka@...omium.org>
> >
> > On cmd_timeout and there is no reset_gpio, reset the USB port as a
>
> Maybe:
>
> s/there is no/with no/g
>
> > last resort.
>
> Can you please document your test setup, and also mention that you
> change the behavior of:
>
> 1.  btusb_intel_cmd_timeout
> 2.  btusb_rtl_cmd_timeout
>
> […]
>
>
> Kind regards,
>
> Paul

Thanks for the input!
All done, uploaded v2. PTAL, thanks!

>
>
> > Signed-off-by: Archie Pusaka <apusaka@...omium.org>
> > Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@...gle.com>
> > Reviewed-by: Ying Hsu <yinghsu@...omium.org>
> >
> > ---
> >
> >   drivers/bluetooth/btusb.c | 26 ++++++++++++++++----------
> >   1 file changed, 16 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> > index 271963805a38..11040124ef79 100644
> > --- a/drivers/bluetooth/btusb.c
> > +++ b/drivers/bluetooth/btusb.c
> > @@ -696,6 +696,19 @@ struct btusb_data {
> >       unsigned cmd_timeout_cnt;
> >   };
> >
> > +static void generic_usb_reset(struct hci_dev *hdev, struct btusb_data *data)
> > +{
> > +     int err;
> > +
> > +     bt_dev_err(hdev, "Resetting usb device.");
> > +     /* This is not an unbalanced PM reference since the device will reset */
> > +     err = usb_autopm_get_interface(data->intf);
> > +     if (!err)
> > +             usb_queue_reset_device(data->intf);
> > +     else
> > +             bt_dev_err(hdev, "Failed usb_autopm_get_interface: %d", err);
> > +}
> > +
> >   static void btusb_intel_cmd_timeout(struct hci_dev *hdev)
> >   {
> >       struct btusb_data *data = hci_get_drvdata(hdev);
> > @@ -705,7 +718,7 @@ static void btusb_intel_cmd_timeout(struct hci_dev *hdev)
> >               return;
> >
> >       if (!reset_gpio) {
> > -             bt_dev_err(hdev, "No way to reset. Ignoring and continuing");
> > +             generic_usb_reset(hdev, data);
> >               return;
> >       }
> >
> > @@ -736,7 +749,7 @@ static void btusb_rtl_cmd_timeout(struct hci_dev *hdev)
> >               return;
> >
> >       if (!reset_gpio) {
> > -             bt_dev_err(hdev, "No gpio to reset Realtek device, ignoring");
> > +             generic_usb_reset(hdev, data);
> >               return;
> >       }
> >
> > @@ -761,7 +774,6 @@ static void btusb_qca_cmd_timeout(struct hci_dev *hdev)
> >   {
> >       struct btusb_data *data = hci_get_drvdata(hdev);
> >       struct gpio_desc *reset_gpio = data->reset_gpio;
> > -     int err;
> >
> >       if (++data->cmd_timeout_cnt < 5)
> >               return;
> > @@ -787,13 +799,7 @@ static void btusb_qca_cmd_timeout(struct hci_dev *hdev)
> >               return;
> >       }
> >
> > -     bt_dev_err(hdev, "Multiple cmd timeouts seen. Resetting usb device.");
> > -     /* This is not an unbalanced PM reference since the device will reset */
> > -     err = usb_autopm_get_interface(data->intf);
> > -     if (!err)
> > -             usb_queue_reset_device(data->intf);
> > -     else
> > -             bt_dev_err(hdev, "Failed usb_autopm_get_interface with %d", err);
> > +     generic_usb_reset(hdev, data);
> >   }
> >
> >   static inline void btusb_free_frags(struct btusb_data *data)

Cheers,
Archie

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ