All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Oliver Neukum <oneukum@suse.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v4] USB: core: skip unconfiguration if device doesn't support it
Date: Thu, 5 May 2022 18:48:43 +0200	[thread overview]
Message-ID: <CABk-BGsvm_FQ0-sTJg_DVTVKd4oHAKYt6SCZby=XmdgmEdcOjQ@mail.gmail.com> (raw)
In-Reply-To: <875ymkknqy.fsf@miraculix.mork.no>

Hello,

Just repeating the same sequence here without the patch:

$ hciconfig
hci0:    Type: Primary  Bus: USB
    BD Address: 00:1A:7D:DA:71:13  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING
    RX bytes:696 acl:0 sco:0 events:49 errors:0
    TX bytes:3168 acl:0 sco:0 commands:49 errors:0
$
< scanning is working from Bluetooth Settings from GNOME >
$ echo 0 >/sys/bus/usb/devices/1-3/bConfigurationValue
$ hciconfig
$
< bluetooth device is not found in Bluetooth Settings from GNOME >
$ echo 1 >/sys/bus/usb/devices/1-3/bConfigurationValue
< it takes a while>
bash: echo: write error: Connection timed out
$ hciconfig
$
< bluetooth device is not found in Bluetooth Settings from GNOME >

Definitely, Bjorn, your device is working better than mine.

And the same sequence with the patch, to show that it is working:

$ cat /proc/cmdline
BOOT_IMAGE=... usbcore.quirks=0a12:0001:p
$ cat /sys/module/usbcore/parameters/quirks
0a12:0001:p
$ hciconfig
hci0:    Type: Primary  Bus: USB
    BD Address: 00:1A:7D:DA:71:13  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING
    RX bytes:806 acl:0 sco:0 events:66 errors:0
    TX bytes:5168 acl:0 sco:0 commands:65 errors:0
$
< scanning is working from Bluetooth Settings from GNOME >
$ echo 0 >/sys/bus/usb/devices/1-3/bConfigurationValue
$ hciconfig
$
< bluetooth device is not found in Bluetooth Settings from GNOME >
$ echo 1 >/sys/bus/usb/devices/1-3/bConfigurationValue
$ hciconfig
hci0:    Type: Primary  Bus: USB
    BD Address: 00:1A:7D:DA:71:13  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING
    RX bytes:696 acl:0 sco:0 events:49 errors:0
    TX bytes:3168 acl:0 sco:0 commands:49 errors:0
$
< scanning is working from Bluetooth Settings from GNOME >

In both cases, I also see similar log errors: Bluetooth: hci0: urb
00000000exxxxxxx failed to resubmit (2)

Best regards
José Ignacio




On Thu, May 5, 2022 at 5:23 PM Bjørn Mork <bjorn@mork.no> wrote:
>
> Alan Stern <stern@rowland.harvard.edu> writes:
>
> > Please pardon me for butting in, but I don't see how this tests the
> > condition that Jose is worried about.
> ..
> > And presumably the device is working again.  However, none of this shows
> > what happens when the device is unconfigured.  To test that, you would
> > have to do:
> >
> >       echo 0 >/sys/bus/usb/devices/1-8/bConfigurationValue
> >       echo 1 >/sys/bus/usb/devices/1-8/bConfigurationValue
> >
> > and then see if the device continues to work.
>
> Ah, sorry. Scanned briefly, saw "bind", and assumed too much.  Making an
> ass out of... you know.
>
> Actually I didn't understand the part about unconfiguration since I
> can't see how that would happen during normal usage?  Anyway,
> unconfiguring also works for me:
>
> canardo:/tmp# hciconfig hci0
> hci0:   Type: Primary  Bus: USB
>         BD Address: 00:1A:7D:DA:71:15  ACL MTU: 310:10  SCO MTU: 64:8
>         UP RUNNING
>         RX bytes:660 acl:0 sco:0 events:43 errors:0
>         TX bytes:2178 acl:0 sco:0 commands:43 errors:0
>
> canardo:/tmp# echo 0 >/sys/bus/usb/devices/1-8/bConfigurationValue
> canardo:/tmp# hciconfig hci0
> Can't get device info: No such device
> canardo:/tmp# echo 1 >/sys/bus/usb/devices/1-8/bConfigurationValue
>
>
> Not entirely sure how to validate that "everything" works at this point?
> I can use the rfcomm session the adapter usually handles and also run
> lescan after this.  So I guess both BLE and BDR works.
>
> And the counters count something:
>
> canardo:/tmp# hciconfig hci0
> hci0:   Type: Primary  Bus: USB
>         BD Address: 00:1A:7D:DA:71:15  ACL MTU: 310:10  SCO MTU: 64:8
>         UP RUNNING
>         RX bytes:3883 acl:40 sco:0 events:81 errors:0
>         TX bytes:2518 acl:19 sco:0 commands:50 errors:0
>
>
> I can see an error like this logged every time I unconfigure the device:
>
> Bluetooth: hci0: urb 00000000e66a2492 failed to resubmit (2)
>
> There is nothing else logged in kernel log
>
>
> Bjørn
>


  reply	other threads:[~2022-05-05 16:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  8:36 [PATCH v4] USB: core: skip unconfiguration if device doesn't support it Jose Ignacio Tornos Martinez
2022-05-04 12:23 ` Marcel Holtmann
2022-05-04 12:32   ` Jose Ignacio Tornos Martinez
2022-05-05 10:19   ` Oliver Neukum
2022-05-05 11:15     ` Jose Ignacio Tornos Martinez
2022-05-05 12:06       ` Oliver Neukum
2022-05-05 12:35         ` Jose Ignacio Tornos Martinez
2022-05-05 11:29     ` Bjørn Mork
2022-05-05 14:14       ` Alan Stern
2022-05-05 15:22         ` Bjørn Mork
2022-05-05 16:48           ` Jose Ignacio Tornos Martinez [this message]
2022-05-05 17:04           ` Alan Stern

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='CABk-BGsvm_FQ0-sTJg_DVTVKd4oHAKYt6SCZby=XmdgmEdcOjQ@mail.gmail.com' \
    --to=jtornosm@redhat.com \
    --cc=bjorn@mork.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.