Re: [PATCH] usb: chipidea: reuse the platform_data to store the ci info

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

 



On Tue, Sep 15, 2015 at 01:40:30PM +0800, Barry Song wrote:
> 2015-09-14 15:17 GMT+08:00 Peter Chen <peter.chen@xxxxxxxxxxxxx>:
> > On Tue, Aug 11, 2015 at 09:43:13AM +0000, Barry Song wrote:
> >> From: Rong Wang <Rong.Wang@xxxxxxx>
> >>
> >> 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 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