RE: Regarding hub port debounce

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

 



>> Anyway I was just trying to get some idea about this 100ms debounce
in 
>> hub_activate, to see if we should make change on host side or device 
>> side to resolve our re-enumeration issue. Right now I can resolve it 
>> by having a delay between disconnect and reconnect on the device
side.
>> You mentioned force re-enumeration by changing descriptors, can you 
>> please elaborate on that? When our device disconnect and trying to 
>> re-enumerate, we do have a completely different device descriptor,
but 
>> the problem is the host doesn't even start the enumeration process 
>> because disconnect event gets filtered out. It would be really nice
if 
>> there is any way to force re-enumeration by simply doing something 
>> with descriptors.

>No, the disconnect doesn't get filtered out.  The problem is something
>else: The device starts out suspended, and it remains that way.
>When a program tries to access the device, it will be resumed and then
reenumerated.

Make sense.

>But this isn't what you want; you want it to be resumed and
reenumerated immediately.
>The patch below should fix the issue.

Your patch does fix the issue. But if udev->do_remote_wakeup had been
set, we would not have this issue, right?
What's the purpose of do_remote_wakeup? Would it be better just set this
variable somewhere? I'm afraid completely replacing the if - else
statement would cause some other issue, just guessing, please advise.

Thanks,
Fei

Index: usb-2.6/drivers/usb/core/hub.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/hub.c
+++ usb-2.6/drivers/usb/core/hub.c
@@ -2932,14 +2932,7 @@ static void hub_port_connect_change(stru
 			/* For a suspended device, treat this as a
 			 * remote wakeup event.
 			 */
-			if (udev->do_remote_wakeup)
-				status = remote_wakeup(udev);
-
-			/* Otherwise leave it be; devices can't tell the
-			 * difference between suspended and disabled.
-			 */
-			else
-				status = 0;
+			status = remote_wakeup(udev);
 #endif
 
 		} else {

--
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