Re: [PATCH] usbhid: fix suspend crash by moving initializations earlier

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

 



On Fri, 7 May 2010, Pete Zaitcev wrote:

> > +++ usb-2.6/drivers/hid/usbhid/hid-core.c
> > @@ -998,13 +998,6 @@ static int usbhid_start(struct hid_devic
> >  		}
> >  	}
> >  
> > -	init_waitqueue_head(&usbhid->wait);
> > -	INIT_WORK(&usbhid->reset_work, hid_reset);
> > -	INIT_WORK(&usbhid->restart_work, __usbhid_restart_queues);
> > -	setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
> > -
> > -	spin_lock_init(&usbhid->lock);
> > -
> >  	usbhid->urbctrl = usb_alloc_urb(0, GFP_KERNEL);
> >  	if (!usbhid->urbctrl) {
> >  		ret = -ENOMEM;
> > @@ -1180,6 +1173,12 @@ static int usbhid_probe(struct usb_inter
> >  	usbhid->intf = intf;
> >  	usbhid->ifnum = interface->desc.bInterfaceNumber;
> >  
> > +	init_waitqueue_head(&usbhid->wait);
> > +	INIT_WORK(&usbhid->reset_work, hid_reset);
> > +	INIT_WORK(&usbhid->restart_work, __usbhid_restart_queues);
> > +	setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
> > +	spin_lock_init(&usbhid->lock);
> > +
> >  	ret = hid_add_device(hid);
> >  	if (ret) {
> >  		if (ret != -ENODEV)
> 
> At freaking last, ACK. I knew right away that this commit did not
> go far enough 57ab12e418ec4fe24c11788bb1bbdabb29d05679.
> 
> I kept doing this for Stratus but then it's always "not reproducible"
> on normal computers. I had users hitting this on Fedora but it requires
> some crappy hardware, so it never went anywhere.

Yeah. I am planning to redirect both patches to stable@ once Linus pulls 
it.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
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