On Fri, 29 Mar 2013, Lan Tianyu wrote: > Ok. I just refresh patch "usb: introduce usb force power off mechanism" > Please have a look. > > From 16f5c7c6dd00830530a9ac758af25b575e0b8731 Mon Sep 17 00:00:00 2001 > From: Lan Tianyu <tianyu.lan@xxxxxxxxx> > Date: Tue, 26 Feb 2013 11:12:09 +0800 > Subject: [PATCH] usb: introduce usb force power off mechanism > > Some devices' firmware will be broken at some points. Power down > and power on device can help device to rework in this case. > > This patch is to add ioctl cmd USBDEVFS_POWER_RESET for usbfs node > to repower usb device. First, call hub_port_logical_disconnect() to > disconnect device. Second, Power down and up usb port. > > This patch is also helpful fo some QAs who want to do hcd's memleak > test(Plug and unplug device thousand times.) > > Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> ... > --- a/drivers/usb/core/usb.h > +++ b/drivers/usb/core/usb.h > @@ -185,6 +185,8 @@ extern void usb_set_hub_port_connect_type(struct usb_device *hdev, int port1, > enum usb_port_connect_type type); > extern void usb_hub_adjust_deviceremovable(struct usb_device *hdev, > struct usb_hub_descriptor *desc); > +extern int usb_hub_port_power_reset(struct usb_device *hdev, > + int port1); This can all go on one line. It looks okay. When you test it, does the attached device get detected and initialized properly? Alan Stern -- 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