Skip to contentSkip to conversation

USB: usbtmc: Fix RCU stall warning

PATCH Guido Kiener 2 participants 2 messages Jul 21, 2021 USB

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines

-----Original Message-----
From: Alan Stern <[email protected]>
Sent: Wednesday, July 21, 2021 4:22 PM
To: dave penkler <[email protected]>
Cc: Greg KH <[email protected]>; [email protected]; Dmitry Vyukov <[email protected]>; [email protected]; Kiener Guido 14DS1 <[email protected]>; USB <[email protected]>
Subject: *EXT* Re: [PATCH] USB: usbtmc: Fix RCU stall warning

On Wed, Jul 21, 2021 at 11:44:23AM +0200, dave penkler wrote:

Quoted 8 lines
Quoted 5 lines

Sorry, the issue this patch is trying to fix occurs because the current usbtmc driver resubmits the URB when it gets an EPROTO return. The dummy usb host controller driver used in the syzbot tests keeps returning the resubmitted URB with EPROTO causing a loop that starves RCU. With an actual HCI driver it either recovers or returns an EPIPE.

Are you sure about that? Have you ever observed a usbtmc device recovering and continuing to operate after an EPROTO error?

I can't speak for Dave and his investigations. However as you remember I did tests with EPROTO errors, see thread: https://marc.info/?l=linux-usb&m=162163776930423&w=2
In the thread you can see the recovering.
Since no user blamed the usbtmc driver for system locks up to now, it's worth to think about whether the problem is caused by the dummy_hcd driver.
I still have no time for further investigations and would agree to use the simple patch to get rid of the topic for the usbtmc driver. Then the syzbot will maybe find another usb driver.

-Guido

Quoted 7 lines

An EPIPE error also seems rather unlikely -- particularly if the device is not plugged into a high-speed hub.

Alan Stern

Quoted 2 lines

In either case no loop occurs. So for my part as a user and maintainer this patch is not ok.

#1 lore raw
Quoted 16 lines · Guido Kiener
Quoted 16 lines

-----Original Message-----
From: Alan Stern <[email protected]>
Sent: Wednesday, July 21, 2021 4:22 PM
To: dave penkler <[email protected]>
Cc: Greg KH <[email protected]>; [email protected]; Dmitry Vyukov <[email protected]>; [email protected]; Kiener Guido 14DS1 <[email protected]>; USB <[email protected]>
Subject: *EXT* Re: [PATCH] USB: usbtmc: Fix RCU stall warning

Quoted 5 lines · dave penkler

Sorry, the issue this patch is trying to fix occurs because the current usbtmc driver resubmits the URB when it gets an EPROTO return. The dummy usb host controller driver used in the syzbot tests keeps returning the resubmitted URB with EPROTO causing a loop that starves RCU. With an actual HCI driver it either recovers or returns an EPIPE.

Quoted 6 lines
Quoted 2 lines

Are you sure about that? Have you ever observed a usbtmc device recovering and continuing to operate after an EPROTO error?

I can't speak for Dave and his investigations. However as you remember I did tests with EPROTO errors, see thread: https://marc.info/?l=linux-usb&m=162163776930423&w=2
In the thread you can see the recovering.

Ah yes, now I remember.

That message doesn't show the _device_ recovering and continuing to operate, though. It shows the _system_ recovering and realizing that the device has been disconnected.

What I was asking about was whether you knew of a case where there was an EPROTO error but afterward the usbtmc device continued to work -- no disconnection. Assuming such cases are vanishingly rare, there's no harm in having the driver give up whenever it encounters EPROTO.

Quoted 2 lines

Since no user blamed the usbtmc driver for system locks up to now, it's worth to think about whether the problem is caused by the dummy_hcd driver.

Both drivers contributed to the lockup. The question is: Which driver was doing the wrong thing? (Or which was _more_ wrong?) I believe the usbtmc driver was.

Quoted 2 lines

I still have no time for further investigations and would agree to use the simple patch to get rid of the topic for the usbtmc driver. Then the syzbot will maybe find another usb driver.

Agreed. So Greg should go ahead and apply the $SUBJECT patch.

Alan Stern