Re: [PATCH V4 2/2] usb/acpi: binding xhci root hub usb port with ACPI

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

 



Ok, this looks sane, and our Intel testers report it doesn't oops like
v2.  The patch description on the first patch is better as well.

Tianyu, I know this introduces a new API to the host controller driver
structure, and we would normally queue these two patches for 3.10.

However, I know a lot of the port power off code went into 3.9.  If we
don't have these patches in 3.9, what will be the impact?  Will we say,
misassign a power resource from a particular port, or mismark a USB port
connection type?  Is there any user-level impact if we don't have these
in 3.9?

If these patches should go into 3.9, should they also be backported to
3.8 and 3.7?  Commit d557542421da643358201664903e67fd01dfca1a
"usb/acpi: Bind ACPI node to USB port, not usb_device." was first
introduced in 3.7, and it looks like the sysfs files to turn on and off
ports were added in 3.7 as well.  Without these two patches, will
that sysfs interface work correctly?

Sarah Sharp

On Tue, Mar 19, 2013 at 04:48:13PM +0800, Lan Tianyu wrote:
> This patch is to bind xhci root hub usb port with its acpi node.
> The port num in the acpi table matches with the sequence in the xhci
> extended capabilities table. So call usb_hcd_find_raw_port_number() to
> transfer hub port num into raw port number which associates with
> the sequence in the xhci extended capabilities table before binding.
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
> ---
> Change since v3:
>        add a temprorary variable to recard raw port num and get ACPI
> handle rahter than overwrite port num with raw port num. This is
> to avoid passing raw port num as port num to usb_acpi_check_port_connect_type().
> 
>  drivers/usb/core/usb-acpi.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index b6f4bad..255c144 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -15,6 +15,7 @@
>  #include <linux/kernel.h>
>  #include <linux/acpi.h>
>  #include <linux/pci.h>
> +#include <linux/usb/hcd.h>
>  #include <acpi/acpi_bus.h>
>  
>  #include "usb.h"
> @@ -188,8 +189,13 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
>  		 * connected to.
>  		 */
>  		if (!udev->parent) {
> -			*handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev),
> +			struct usb_hcd *hcd = bus_to_hcd(udev->bus);
> +			int raw_port_num;
> +
> +			raw_port_num = usb_hcd_find_raw_port_number(hcd,
>  				port_num);
> +			*handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev),
> +				raw_port_num);
>  			if (!*handle)
>  				return -ENODEV;
>  		} else {
> -- 
> 1.7.9.5
> 
--
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