RE: [PATCH v2 04/14] USB: kill unnecessary C_PORT_CONNECTION and broken C_PORT_ENABLE manipulations

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

 



> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Dan Williams
> Sent: Friday, November 22, 2013 1:08 AM
> 
> C_PORT_CONNECTION changes are now handled and cleared while a port is
> powered off.  It is also specified to be cleared by both usb2 [1] and
> usb3 [2] hubs when the port is in the logical power-off state.
> 
> C_PORT_ENABLE is cleared by usb2 [3] hubs in the logical power-off
> state, and the bit is reserved for usb3 [2] hubs.
> 
> In usb_port_runtime_resume() it does not make sense to attempt to

I guess you meant usb_port_runtime_suspend() here?

> re-disable the port after a resume / debounce failure, we want the port
> to be in enabled state regardless.
> 
> [1]: USB2.0 Specification Section 11.24.2.7.2.1
> [2]: USB3.0 Specification Section 10.16.2.6.2
> [3]: USB2.0 Specification Section 11.24.2.7.2.2
> 
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> ---
>  drivers/usb/core/port.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
> index 48011263ce35..3dbd4d653b15 100644
> --- a/drivers/usb/core/port.c
> +++ b/drivers/usb/core/port.c
> @@ -114,8 +114,6 @@ static int usb_port_runtime_suspend(struct device *dev)
>  	retval = usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
>  	if (retval)
>  		clear_bit(port1, hub->poweroff_bits);
> -	usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION);
> -	usb_clear_port_feature(hdev, port1,	USB_PORT_FEAT_C_ENABLE);

This is not an attempt to re-disable the port, rather it is clearing the
status change bits. So you should reword your commit log to match.

Are you sure it is a good idea to remove the clearing of the change bits
here? Even if the spec says they should be cleared when the port is
powered off, there may be some hubs out there which don't follow the spec
exactly. It seems safer to leave this as-is. Or have you seen it cause a
problem?

>  	usb_autopm_put_interface(intf);
> 
>  	return retval;
> 
> --
> 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
��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux