[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d1dbuk73.fsf@linux.intel.com>
Date: Tue, 21 Mar 2017 10:07:28 +0200
From: Felipe Balbi <balbi@...nel.org>
To: Baolin Wang <baolin.wang@...aro.org>,
Mathias Nyman <mathias.nyman@...ux.intel.com>
Cc: Mathias Nyman <mathias.nyman@...el.com>,
Greg KH <gregkh@...uxfoundation.org>,
Mark Brown <broonie@...nel.org>,
USB <linux-usb@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Alan Stern <stern@...land.harvard.edu>
Subject: Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM
Hi,
Baolin Wang <baolin.wang@...aro.org> writes:
>>> I don't yet understand why we can't just keep runtime pm disabled as a
>>> default for xhci platform devices.
>>> It could be enabled by whatever creates the platform device by setting some
>>> device property
>>> (or equivalent), which would be checked in xhci_plat_probe() before enabling
>>> runtime pm. It
>>> could then optionally be set in sysfs via power/control entry.
>>
>> I think runtime pm is not one hardware property, is it suitable if we
>> introduce one device property to enable/disable runtime pm?
>
> As I said, runtime pm is not one hardware property, I think it is not
> suitable if we introduce one device property to enable/disable runtime
> pm.
we already this functionality exposed on sysfs.
> Secondly, we only can resume the xhci platform device by getting the
> xhci usage counter from gadget driver, since the cable plug in/out
> events only can be notified to glue layer of gadget driver(like dwc3
> glue layer). That means if we want to suspend xhci platform device, we
this is a problem with the glue layer, IMO. It should be something like
so:
static irqreturn_t dwc3_foobar_wakeup(int irq, void *_glue)
{
struct dwc3_foobar_glue *glue = _glue;
u32 reg;
reg = real(glue->base, OFFSET);
if (reg & CONNECT)
pm_runtime_resume(&glue->dwc3);
return IRQ_HANDLED;
}
then dwc3's ->runtime_resume() should check if the event is supposed to
be handled by host or peripheral by checking which mode it was before
suspend and making the assumption that we don't change modes while
suspended. Something like:
static int dwc3_runtime_resume(struct device *dev)
{
struct dwc3 *dwc = dev_get_drvdata(dev);
[...]
if (dwc->is_host)
pm_runtime_resume(dwc->xhci.dev);
[...]
return 0;
}
> must put xhci usage counter (so we can not keep their parent-child
> relationship intact). That is why we need
> pm_suspend_ignore_children(dev, true).
you really shouldn't need that and it's still unclear why you think you
do.
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists