Re: usbip port number limits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/21/2017 04:24 AM, Juan Zea wrote:
>> ----- Mensaje original -----
>> De: "Yuyang Du" <yuyang.du@xxxxxxxxxxxxxxx>
>> Para: "Shuah Khan" <shuahkh@xxxxxxxxxxxxxxx>
>> CC: "Juan Zea" <juan.zea@xxxxxxxxxx>, shuah@xxxxxxxxxx, "Bjørn Mork" <bjorn@xxxxxxx>, linux-usb@xxxxxxxxxxxxxxx, "Valentina Manea" <valentina.manea.m@xxxxxxxxx>
>> Enviados: Martes, 21 de Noviembre 2017 8:45:33
>> Asunto: Re: usbip port number limits
>>
>> On Wed, Nov 15, 2017 at 07:58:24AM -0700, Shuah Khan wrote:
>>> Hi Juan,
>>>
>>> On 11/15/2017 07:43 AM, Juan Zea wrote:
>>>>
>>>>>> Also, will you be able to revert the usb3 commit 
>>>>>> 1c9de5bf428612458427943b724bea51abde520a 
>>>>>>
>>>>>> and see if any of the problems go away. 
>>>>>>
>>>>>> thanks, 
>>>>>> -- Shuah 
>>>>>>
>>>>
>>>>> I'm on it and will send results later.
>>>>
>>>>> Thanks,
>>>>> Juan
>>>>
>>>> Ok, I'm back. The revert was quite complex, with several conflicts I was not able to resolve. So I started testing full checkouts around that series of changes by Yuyang.
>>>
>>> I was hoping it will be easier. I was apprehensive it could be a com[ex revert. :(
>>>
>>>> That led me to bisecting the problem with the fingerprint reader, and the culprit is here: 
>>>>
>>>> 03cd00d538a6feb0492cd153edf256ef7d7bd95e is the first bad commit
>>>> commit 03cd00d538a6feb0492cd153edf256ef7d7bd95e
>>>> Author: Yuyang Du <yuyang.du@xxxxxxxxx>
>>>> Date:   Thu Jun 8 13:04:09 2017 +0800
>>>>
>>>>     usbip: vhci-hcd: Set the vhci structure up to work
>>>>         
>>>>     This patch enables the new vhci structure. Its lock protects
>>>>     both the USB2 hub and the shared USB3 hub.
>>>>         
>>>>     Signed-off-by: Yuyang Du <yuyang.du@xxxxxxxxx>
>>>>     Acked-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
>>>>     Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>>>>
>>>> :040000 040000 b7b5c6b16db801c74354bb0d0a247855f64b0829 72524e78d281ebc8d36fa32cb93ed0278e99f880 M      drivers
>>>>
>>>> The commit before, fingerprint reader works. Also, multicontroller works (no usb3 ports). 
>>>> In this bad commit, I get the errors I sent in the previous message.
>>>>
>>>
>>> Thanks for reporting and debugging the problem to isolate the commit. I was
>>> suspecting one of these commit based on the messages you are seeing.
>>>
>>> I will see if I can fix this without doing a huge reverts.
>>>
>> Hi,
>>
>> Sorry for the latency. It seems now the bug is:
>>
>> Nov 14 14:35:29 kernel-tester kernel: [  229.636543] kernel BUG at drivers/usb/usbip/vhci_hcd.c:683!
>>
>> which is a hard one (you mentioned the lastest kernel is used).
>>
>> Since you didn't post patch, lets first make sure we are on the same
>> page. Could you please try the following patch and see whether the
>> bug still exists?
>>
>> Also, I'm assuming you are using a non-super-speed device.
>>
>> Thanks,
>> Yuyang
>>
>> -
> 
> 
> Hi,
> 
>   Please excuse me... I have reported two different problems in this post, and I think things are mixing up a bit. My bad. I've found two different problems:
> 
> 1.- When compiling vhci driver with multiple hubs (in latest kernel), usbip tool doesn't seem able to "jump" to the second controller. As far as I understand, it seems to be a problem with high speed devices trying to get connected to super speed ports. I made a patch for avoiding this situation which is almost the same as the one you just sent. Both patches work. I can compile with several hubs of one port, and connect two devices via usbip and the second gets connected to the second controller (skipping the super speed port of first controller).
> 
> 2.- The problem is some of these devices don't work, whatsoever controller or hub compiling configuration I do. A fingerprint reader and also recently discovered flash usb sticks don't work either. You can connect them with usbip tool, and they list with lsusb with no problem at all. But when you try to use them, you get this "kernel BUG at drivers/usb/usbip/vhci_hcd.c:669!" (by the way, the line number has changed in the latest pull from master I've just tested, but it's the same line of code). This second problem is the one I bisected in my last message. And I got to the commit 03cd00d538a6feb0492cd153edf256ef7d7bd95e, in which both devices stop working. 
> 
> The patch you sent fixes 1 but not 2. And yes, I'm using non-super-speed devices for testing. 
> 
> I hope this helped, and sorry for the mess,

Thanks for finding the problem. usb2 devices don't work at all with the
offending commit: 03cd00d538a6feb0492cd153edf256ef7d7bd95e

I have been debugging on 4.12 and this bad commit. Low speed devices can be
attached, but you see the following and then shutdown hangs.

I don't believe this commit 03cd00d538a6feb0492cd153edf256ef7d7bd95e tested
well on usb2 devices. and this commit is suspect. It is unfortunate
that it wasn't caught during the patch testing, because it is so easy to
run into this. I used one usb2 device and tried to attach over localhost
and with this patch happens every single time.

I am looking into reverting this commit as well as the rest of the usb3 work
that is based on this bad commit as this commit introduced serious regression
for usb2 devices.

I have reverted the patches on 4.15 base and testing it this week. I will have
to do the same for 4.13 as well.

usb3 work and this rework patch can be tested well and I can take this
into 4.16 or so once it is is tested on all devices including the finger
print reader - I have a laptop to test this use-case.

My apologies for not catching this earlier.

The bug dmesg as follows:

thanks,
-- Shuah


[ 2223.046019] kernel BUG at drivers/usb/usbip/vhci_hcd.c:704!


[ 2223.046096] task: ffff88033cb24e00 task.stack: ffff880372ce8000
[ 2223.046102] RIP: 0010:vhci_urb_enqueue+0x7be/0xe90
[ 2223.046104] RSP: 0018:ffff880372cef6b0 EFLAGS: 00010206
[ 2223.046107] RAX: 0000000000000024 RBX: 1ffff1006e59dee1 RCX: 1ffffffff0ad901c
[ 2223.046109] RDX: 1ffff10067417bf1 RSI: ffff88033a0bdf00 RDI: ffff88033a0bdf88
[ 2223.046111] RBP: ffff880372cef790 R08: 0000000000000024 R09: 0000000000000002
[ 2223.046113] R10: 0000000000000000 R11: ffff88033a0bdf64 R12: ffff880342ca0000
[ 2223.046115] R13: ffff88033a0bdf00 R14: 0000000000000001 R15: 0000000000000001
[ 2223.046118] FS:  0000000000000000(0000) GS:ffff88038f940000(0000) knlGS:0000000000000000
[ 2223.046120] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2223.046122] CR2: 0000555f6eab4f78 CR3: 0000000003a13004 CR4: 00000000001606e0
[ 2223.046124] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 2223.046126] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 2223.046127] Call Trace:
[ 2223.046133]  ? usb_stor_invoke_transport+0xe2/0x16b0 [usb_storage]
[ 2223.046136]  ? usb_stor_transparent_scsi_command+0xe/0x10 [usb_storage]
[ 2223.046140]  ? usb_stor_control_thread+0x60a/0x1050 [usb_storage]
[ 2223.046144]  ? kthread+0x310/0x3d0
[ 2223.046148]  ? ret_from_fork+0x27/0x40
[ 2223.046153]  ? vhci_urb_dequeue+0x870/0x870
[ 2223.046158]  ? __lock_is_held+0xb6/0x140
[ 2223.046163]  usb_hcd_submit_urb+0x267/0x1d50
[ 2223.046166]  ? find_held_lock+0x35/0x1d0
[ 2223.046172]  ? usb_create_hcd+0x20/0x20
[ 2223.046175]  ? lock_acquire+0x4e0/0x4e0
[ 2223.046179]  ? do_raw_spin_trylock+0x190/0x190
[ 2223.046183]  ? __init_waitqueue_head+0x9c/0x140
[ 2223.046188]  usb_submit_urb+0x712/0x11d0
[ 2223.046194]  usb_sg_wait+0x19c/0x410
[ 2223.046201]  usb_stor_bulk_transfer_sglist.part.1+0xc9/0x1d0 [usb_storage]
[ 2223.046207]  usb_stor_bulk_srb+0x12b/0x2f0 [usb_storage]
[ 2223.046211]  ? usb_stor_control_thread+0xca/0x1050 [usb_storage]
[ 2223.046215]  ? usb_stor_bulk_transfer_sglist.part.1+0x1d0/0x1d0 [usb_storage]
[ 2223.046220]  ? usb_stor_bulk_transfer_buf+0x277/0x3d0 [usb_storage]
[ 2223.046225]  usb_stor_Bulk_transport+0x53e/0x11a0 [usb_storage]
[ 2223.046232]  ? usb_stor_bulk_srb+0x2f0/0x2f0 [usb_storage]
[ 2223.046236]  ? print_irqtrace_events+0x270/0x270
[ 2223.046239]  ? lock_acquire+0x4e0/0x4e0
[ 2223.046243]  ? do_raw_spin_trylock+0x190/0x190
[ 2223.046246]  ? usleep_range+0x130/0x130
[ 2223.046253]  usb_stor_invoke_transport+0xe2/0x16b0 [usb_storage]
[ 2223.046256]  ? find_held_lock+0x35/0x1d0
[ 2223.046271]  ? usb_stor_port_reset+0x1a0/0x1a0 [usb_storage]
[ 2223.046274]  ? lock_acquire+0x4e0/0x4e0
[ 2223.046279]  ? do_raw_spin_trylock+0x190/0x190
[ 2223.046283]  ? mark_held_locks+0xaf/0x100
[ 2223.046286]  ? _raw_spin_unlock_irq+0x2c/0x30
[ 2223.046292]  usb_stor_transparent_scsi_command+0xe/0x10 [usb_storage]
[ 2223.046296]  usb_stor_control_thread+0x60a/0x1050 [usb_storage]
[ 2223.046302]  ? fill_inquiry_response+0x20/0x20 [usb_storage]
[ 2223.046324]  ? kthread_create_on_node+0xc0/0xc0
[ 2223.046327]  ret_from_fork+0x27/0x40
[ 2223.046334] Code: 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e d1 04 00 00 41 8b 85 88 00 00 00 85 c0 0f 84 a7 f9 ff ff <0f> 0b 48 8b bd 58 ff ff ff 48 c7 c6 40 30 52 83 e8 7d 41 bb ff
[ 2223.046388] RIP: vhci_urb_enqueue+0x7be/0xe90 RSP: ffff880372cef6b0
[ 2223.046392] ---[ end trace 832c9a57cf37424c ]---
[ 2243.857105] vhci_hcd: dequeue a urb ffff88033a0bdf00
[ 2489.620288] usbip-host 3-2: recv a header, 0
[ 2489.620296] vhci_hcd: connection closed
[ 2489.620330] vhci_hcd: stop threads
[ 2489.620339] vhci_hcd: release socket
[ 2489.620356] vhci_hcd: disconnect device
[ 2489.620412] usb 5-1: USB disconnect, device number 2
[ 2489.620417] device: 'ep_82': device_unregister
[ 2489.620472] PM: Removing info for No Bus:ep_82
[ 2489.620495] device: 'ep_01': device_unregister
[ 2489.620537] PM: Removing info for No Bus:ep_01
[ 2489.620572] bus: 'usb': remove device 5-1:1.0
[ 2489.746817] usbip-host 3-2: reset high-speed USB device number 6 using xhci_hcd
[ 2489.895270] usbip-host 3-2: device reset
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux