Re: [RFC][PATCH] USB: hcd-pci: apply driver probe deferral mechanism to uhci/ohci companion

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

 



On Fri, 14 Oct 2011 tom.leiming@xxxxxxxxx wrote:

> From: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> 
> This patch tries to apply the new driver probe deferral mechanism to
> uhci/ohci companion driver so that ehci driver can be probed before
> uhci/ohci companion driver.
> 
> Cc: Grant Likely <grant.likely@xxxxxxxxxxxx>
> Cc: Manjunath GKondaiah <manjunath.gkondaiah@xxxxxxxxxx>
> Cc: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Dilan Lee <dilee@xxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hcd-pci.c |   26 ++++++++++++++++++++++++++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
> index ce22f4a..f64575e 100644
> --- a/drivers/usb/core/hcd-pci.c
> +++ b/drivers/usb/core/hcd-pci.c

> @@ -183,6 +204,11 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	if (!driver)
>  		return -EINVAL;
>  
> +	if (has_ehci_companion(dev, &ehci_comp)) {
> +		if (!dev_get_drvdata(&ehci_comp->dev))
> +			return -EPROBE_DEFER;
> +	}
> +

This is wrong.  It will prevent UHCI or OHCI controllers from being 
used in situations where there is no EHCI driver available.

The deferral mechanism is meant for situations where one device can't
be used unless another device is working.  But UHCI and OHCI
controllers work just fine when the companion EHCI controller is down.

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


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

  Powered by Linux