Subject: Re: another race in hso

From: Denis Joseph Barrow <[email-masked]>
Date: Fri, 19 Dec 2008 12:06:35 +0100

Yes Oliver,
There are loads of races in the hso driver it's as ugly as sin.
I've been doing nothing but blocking holes not eliminating races which probably
would require a serious redesign & I don't have the clarity of thought like martin schwidefsky
to do it.
There were almost none in my lcs driver though martin didn't believe me & had to rewrite it.
Get Martin Schwidefsky to look over it.
I hope he needs to write a 3g modem driver for linux on the z series anyway
so he may as well get used to the code.

Oliver Neukum wrote:
> Hi,
> 
> there is another race.
> 
> static int hso_get_activity(struct hso_device *hso_dev)
> {
> 	if (hso_dev->usb->state == USB_STATE_SUSPENDED) {
> 		if (!hso_dev->is_active) {
> 			hso_dev->is_active = 1;
> 			schedule_work(&hso_dev->async_get_intf);
> 		}
> 	}
> 
> 	if (hso_dev->usb->state != USB_STATE_CONFIGURED)
> 		return -EAGAIN;
> 
> here's the window.
> 
> 	usb_mark_last_busy(hso_dev->usb);
> 
> 	return 0;
> }
> 
> CPU A							CPU B
> 
> run until the window
> 								autosuspend of device
> submitting URB to suspended device
> 
> You get an unnecessary error.
> 
> 	Regards
> 		Oliver

-- 
best regards,
D.J. Barrow

Linux Kernel Developer
Option NV, Gaston Geenslaan 14, 3001 Leuven, Belgium
 
T: +32 16 311 621
F: +32 16 207 164
Mobile Ireland: +353-86-1715438
Mobile Belgium  +32-496-226190
[email-masked]
[email-masked]
www.option.com
www.travelsmart.ie

Disclaimer:
http://www.option.com/company/disclaimer.shtml
 RPR Leuven 0429.375.448