Re: Bug in xhci-pci / xhci-plat ?

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

 



> Hi,
>
> I see a weird null pointer of xhci in the following lines and I'm not sure
> if its a bug or I'm missing here something:
>
> The following lines appear in xhci_plat_probe and xhci_pci_probe:
> hcd = dev_get_drvdata(&dev->dev);
> xhci = hcd_to_xhci(hcd);   ------------> xhci returns as NULL !!!
> xhci->shared_hcd = usb_create_shared_hcd(driver, &dev->dev,
>  			pci_name(dev), hcd);
>
> I checked and saw that the hcd_priv_size is set to be sizeof(struct
> xhci_hcd *) and not sizeof(struct xhci_hcd).
> So who allocates the struct xhci_hcd ?

OK, sorry, I think I understand now:
When the xhci_plat_probe is calling to the "usb_add_hcd" on the primary
hcd, then it calls to hcd->driver->reset which is pointer to
xhci_plat_setup and this one calls to xhci_gen_setup which allocates the
struct xhci_hcd...

BUT, what if I don't want to call "usb_add_hcd" in the probe? For example
to support OTG code in order to add the hcd only when the OTG driver
decides to ...

Is it possible to remove the allocation from xhci_gen_setup and instead to
change hcd_priv_size to be sizeof(struct xhci_hcd) ?

Thanks,
Ido
-- 
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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