On Tue, Sep 15, 2015 at 01:40:30PM +0800, Barry Song wrote:
> 2015-09-14 15:17 GMT+08:00 Peter Chen <[email protected]>:
> > On Tue, Aug 11, 2015 at 09:43:13AM +0000, Barry Song wrote:
> >> From: Rong Wang <[email protected]>
> >>
> >> Chipidea puts ci information to drvdata, but this overwrites the drvdata
> >> placed by EHCI core. EHCI core thinks drvdata is ehci_hcd. We can find this
> >> from codes like ehci-sysfs.c:
> >> static ssize_t show_companion(struct device *dev,
> >>                               struct device_attribute *attr,
> >>                               char *buf)
> >> {
> >>         struct ehci_hcd         *ehci;
> >>
> >>         ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
> >>       ...
> >> }
> >>
> >> So overwritting drvdata from chipidea driver actually breaks a part of
> >> functionalities of EHCI core.
> >>
> >> Since the platform_data would not be accessed after the device is added
> >> to system after the probe process, so it's safe to move to platform_data
> >> here. This fix is not elegant but currently it is the quickest fix.
> >
> > Hi Rong,
> >
> > Since we have no better solution at current stage, I accept this
> > solution, rebase the latest usb-next tree and make more changes please,
> > then send again, thanks.
> 
> peter, i just tried and this patch was applied to the newest usb-next,
> what do you mean for more changes?
> 

More chipidea core code uses dev_get_drvdata after your version.

grep -nr "dev_get_drvdata" drivers/usb/chipidea/*

drivers/usb/chipidea/core.c:1006:       struct ci_hdrc *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/core.c:1038:       struct ci_hdrc *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/core.c:1071:       struct ci_hdrc *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/core.c:1093:       struct ci_hdrc *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/host.c:47: struct ci_hdrc *ci = dev_get_drvdata(dev);
drivers/usb/chipidea/host.c:83: struct ci_hdrc *ci = dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:39:      struct ci_hdrc  *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:54:      struct ci_hdrc *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:83:      struct ci_hdrc  *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:98:      struct ci_hdrc  *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:124:     struct ci_hdrc  *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:139:     struct ci_hdrc  *ci = 
dev_get_drvdata(dev);
drivers/usb/chipidea/otg_fsm.c:161:     struct ci_hdrc  *ci = 
dev_get_drvdata(dev);

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to