public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btusb: new device id needing BTUSB_WRONG_SCO_MTU quirk
@ 2009-03-02 12:51 Bjørn Mork, Bjørn Mork
  2009-03-02 15:39 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Bjørn Mork, Bjørn Mork @ 2009-03-02 12:51 UTC (permalink / raw)
  To: linux-bluetooth

My Lenovo Thinkpad X301 locks up consistently when I mount an obexfs
file system over btusb and forget to unmount it before switching off the
other end.  There are no messages printed on the console.  The box
doesn't have a serial port so I haven't checked with a serial console.

Looking through btusb.c I noticed the quirks for other Thinkpad models
with a Broadcom chip.  It just doesn't match the presumably newer chip
in the X301:

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0a5c ProdID=2145 Rev= 3.99
S:  Manufacturer=Lenovo Computer Corp
S:  Product=ThinkPad Bluetooth with Enhanced Data Rate II
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  32 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  32 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)


This made me try "modprobe btusb force_scofix=1" which seems to fix the
problem.  No lock ups observed with this module parameter.  hciconfig
reports before and after:

nemi:/tmp# hciconfig 
hci0:   Type: USB
        BD Address: 00:23:4D:F0:D9:1A ACL MTU: 1021:8 SCO MTU: 64:1
        UP RUNNING PSCAN 
        RX bytes:999 acl:0 sco:0 events:31 errors:0
        TX bytes:851 acl:0 sco:0 commands:31 errors:0

nemi:/tmp# modprobe -r btusb
nemi:/tmp# modprobe btusb force_scofix=1
nemi:/tmp# hciconfig 
hci0:   Type: USB
        BD Address: 00:23:4D:F0:D9:1A ACL MTU: 1021:8 SCO MTU: 64:8
        UP RUNNING PSCAN 
        RX bytes:999 acl:0 sco:0 events:31 errors:0
        TX bytes:851 acl:0 sco:0 commands:31 errors:0


If any of this makes any sense, then I suggest applying the attached
patch to btusb.c.

Signed-off-by: Bjørn Mork <bjorn@mork.no>

---
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b5fbda6..4355133 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -99,6 +99,7 @@ static struct usb_device_id blacklist_table[] = {
 	/* IBM/Lenovo ThinkPad with Broadcom chip */
 	{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_WRONG_SCO_MTU },
 	{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x2145), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 	/* HP laptop with Broadcom chip */
 	{ USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_WRONG_SCO_MTU },

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btusb: new device id needing BTUSB_WRONG_SCO_MTU quirk
  2009-03-02 12:51 [PATCH] btusb: new device id needing BTUSB_WRONG_SCO_MTU quirk Bjørn Mork, Bjørn Mork
@ 2009-03-02 15:39 ` Marcel Holtmann
  2009-03-03 15:23   ` Bjørn Mork
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2009-03-02 15:39 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: linux-bluetooth

Hi Bjorn,

> My Lenovo Thinkpad X301 locks up consistently when I mount an obexfs
> file system over btusb and forget to unmount it before switching off the
> other end.  There are no messages printed on the console.  The box
> doesn't have a serial port so I haven't checked with a serial console.
> 
> Looking through btusb.c I noticed the quirks for other Thinkpad models
> with a Broadcom chip.  It just doesn't match the presumably newer chip
> in the X301:
> 
> T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=0a5c ProdID=2145 Rev= 3.99
> S:  Manufacturer=Lenovo Computer Corp
> S:  Product=ThinkPad Bluetooth with Enhanced Data Rate II
> C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  32 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  32 Ivl=1ms
> I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms
> I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms
> I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
> E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
> E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
> I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
> 
> 
> This made me try "modprobe btusb force_scofix=1" which seems to fix the
> problem.  No lock ups observed with this module parameter.  hciconfig
> reports before and after:
> 
> nemi:/tmp# hciconfig 
> hci0:   Type: USB
>         BD Address: 00:23:4D:F0:D9:1A ACL MTU: 1021:8 SCO MTU: 64:1
>         UP RUNNING PSCAN 
>         RX bytes:999 acl:0 sco:0 events:31 errors:0
>         TX bytes:851 acl:0 sco:0 commands:31 errors:0
> 
> nemi:/tmp# modprobe -r btusb
> nemi:/tmp# modprobe btusb force_scofix=1
> nemi:/tmp# hciconfig 
> hci0:   Type: USB
>         BD Address: 00:23:4D:F0:D9:1A ACL MTU: 1021:8 SCO MTU: 64:8
>         UP RUNNING PSCAN 
>         RX bytes:999 acl:0 sco:0 events:31 errors:0
>         TX bytes:851 acl:0 sco:0 commands:31 errors:0
> 
> 
> If any of this makes any sense, then I suggest applying the attached
> patch to btusb.c.

it does not make any sense. Can you just try to run the latest
bluetooth-testing.git tree kernel and see if that might have fixed this
issue.

Regards

Marcel



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btusb: new device id needing BTUSB_WRONG_SCO_MTU quirk
  2009-03-02 15:39 ` Marcel Holtmann
@ 2009-03-03 15:23   ` Bjørn Mork
  0 siblings, 0 replies; 3+ messages in thread
From: Bjørn Mork @ 2009-03-03 15:23 UTC (permalink / raw)
  To: linux-bluetooth

Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org> writes:

> it does not make any sense. 

I see.  And my testing todays confirms that.  Sorry for the first
misplaced shot, and thanks for reviewing.

> Can you just try to run the latest
> bluetooth-testing.git tree kernel and see if that might have fixed this
> issue.

I tried it, and the problem was gone.

Only thing is:  I cannot reproduce the problem at all anymore.  Weird.
Yesterday it was easily reproducible using the procedure mentioned.  

Which means that there must be a mitigating factor I haven't found.
Could the presence of other BT devices make a difference?  The initial
testing was done at work where there are a large number of active BT
devices nearby, while today's testing has been done at home where there
aren't so many.  That's the only difference I can come up with.

Well, I'm satisfied as long as the problem is gone.  Will do more proper
testing and report back if it reappears.

Thanks


Bjørn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-03 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02 12:51 [PATCH] btusb: new device id needing BTUSB_WRONG_SCO_MTU quirk Bjørn Mork, Bjørn Mork
2009-03-02 15:39 ` Marcel Holtmann
2009-03-03 15:23   ` Bjørn Mork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox