All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ABRAHAM, KISHON VIJAY" <kishon@ti.com>
To: balbi@ti.com
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com,
	rob@landley.net, linux@arm.linux.org.uk,
	gregkh@linuxfoundation.org, b-cousson@ti.com, rnayak@ti.com,
	tony@atomide.com, devicetree-discuss@lists.ozlabs.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v6 01/11] drivers: usb: otg: add a new driver for omap usb2 phy
Date: Mon, 6 Aug 2012 15:14:42 +0530	[thread overview]
Message-ID: <CAAe_U6LhfrRk7PP-Td7BTXPngo7+chvTp4LwwKR_GbsjE4jNJQ@mail.gmail.com> (raw)
In-Reply-To: <20120806084928.GD17551@arwen.pp.htv.fi>

Hi Felipe,

On Mon, Aug 6, 2012 at 2:19 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Fri, Aug 03, 2012 at 08:01:44PM +0530, ABRAHAM, KISHON VIJAY wrote:
>> >> +     return 0;
>> >> +}
>> >> +
>> >> +#ifdef CONFIG_PM_RUNTIME
>> >> +
>> >> +static int omap_usb2_runtime_suspend(struct device *dev)
>> >> +{
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     clk_disable(phy->wkupclk);
>> >
>> > weird. I would expect the wakeup clock to be enabled on suspend and
>> > disabled on resume. Isn't this causing any unbalanced disable warnings ?
>>
>> Even I was expecting the wakeup clock to be enabled on suspend but if
>> we have this enabled coreaon domain is never
>> gated and core does not hit low power state. btw Why do think this is
>> unbalanced?
>
> because you never do a clk_enable() on probe(), so on your first
> suspend, you will disable the clock without having enabled it before,
> no? Unless pm_runtime forces a runtime_resume() when you call
> pm_runtime_enable()...
>
>> >> +static int omap_usb2_runtime_resume(struct device *dev)
>> >> +{
>> >> +     u32 ret = 0;
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     ret = clk_enable(phy->wkupclk);
>> >> +     if (ret < 0)
>> >> +             dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
>> >> +
>> >> +     return ret;
>> >> +}
>> >> +
>> >> +static const struct dev_pm_ops omap_usb2_pm_ops = {
>> >> +     SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend, omap_usb2_runtime_resume,
>> >> +             NULL)
>> >
>> > only runtime ? What about static suspend ? We need this to work also
>> > after a traditional echo mem > /sys/power/state ;-)
>>
>> The static suspend case is handled by users of this phy using
>> set_suspend hooks.
>
> I'm not sure if that's too wise, what if your user enabled USB, but
> for whatever reason loaded only the phy driver and not musb or dwc3. It
> will fail, right ?

The enabling and disabling of phy is solely governed by usb controller
driver (musb/dwc3). So if you dont have musb/dwc3 loaded, the phy will
be for sure disabled.

Thanks
Kishon

WARNING: multiple messages have this Message-ID (diff)
From: "ABRAHAM, KISHON VIJAY" <kishon-l0cyMroinI0@public.gmane.org>
To: balbi-l0cyMroinI0@public.gmane.org
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v6 01/11] drivers: usb: otg: add a new driver for omap usb2 phy
Date: Mon, 6 Aug 2012 15:14:42 +0530	[thread overview]
Message-ID: <CAAe_U6LhfrRk7PP-Td7BTXPngo7+chvTp4LwwKR_GbsjE4jNJQ@mail.gmail.com> (raw)
In-Reply-To: <20120806084928.GD17551-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>

Hi Felipe,

On Mon, Aug 6, 2012 at 2:19 PM, Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> wrote:
> Hi,
>
> On Fri, Aug 03, 2012 at 08:01:44PM +0530, ABRAHAM, KISHON VIJAY wrote:
>> >> +     return 0;
>> >> +}
>> >> +
>> >> +#ifdef CONFIG_PM_RUNTIME
>> >> +
>> >> +static int omap_usb2_runtime_suspend(struct device *dev)
>> >> +{
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     clk_disable(phy->wkupclk);
>> >
>> > weird. I would expect the wakeup clock to be enabled on suspend and
>> > disabled on resume. Isn't this causing any unbalanced disable warnings ?
>>
>> Even I was expecting the wakeup clock to be enabled on suspend but if
>> we have this enabled coreaon domain is never
>> gated and core does not hit low power state. btw Why do think this is
>> unbalanced?
>
> because you never do a clk_enable() on probe(), so on your first
> suspend, you will disable the clock without having enabled it before,
> no? Unless pm_runtime forces a runtime_resume() when you call
> pm_runtime_enable()...
>
>> >> +static int omap_usb2_runtime_resume(struct device *dev)
>> >> +{
>> >> +     u32 ret = 0;
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     ret = clk_enable(phy->wkupclk);
>> >> +     if (ret < 0)
>> >> +             dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
>> >> +
>> >> +     return ret;
>> >> +}
>> >> +
>> >> +static const struct dev_pm_ops omap_usb2_pm_ops = {
>> >> +     SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend, omap_usb2_runtime_resume,
>> >> +             NULL)
>> >
>> > only runtime ? What about static suspend ? We need this to work also
>> > after a traditional echo mem > /sys/power/state ;-)
>>
>> The static suspend case is handled by users of this phy using
>> set_suspend hooks.
>
> I'm not sure if that's too wise, what if your user enabled USB, but
> for whatever reason loaded only the phy driver and not musb or dwc3. It
> will fail, right ?

The enabling and disabling of phy is solely governed by usb controller
driver (musb/dwc3). So if you dont have musb/dwc3 loaded, the phy will
be for sure disabled.

Thanks
Kishon

WARNING: multiple messages have this Message-ID (diff)
From: kishon@ti.com (ABRAHAM, KISHON VIJAY)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 01/11] drivers: usb: otg: add a new driver for omap usb2 phy
Date: Mon, 6 Aug 2012 15:14:42 +0530	[thread overview]
Message-ID: <CAAe_U6LhfrRk7PP-Td7BTXPngo7+chvTp4LwwKR_GbsjE4jNJQ@mail.gmail.com> (raw)
In-Reply-To: <20120806084928.GD17551@arwen.pp.htv.fi>

Hi Felipe,

On Mon, Aug 6, 2012 at 2:19 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Fri, Aug 03, 2012 at 08:01:44PM +0530, ABRAHAM, KISHON VIJAY wrote:
>> >> +     return 0;
>> >> +}
>> >> +
>> >> +#ifdef CONFIG_PM_RUNTIME
>> >> +
>> >> +static int omap_usb2_runtime_suspend(struct device *dev)
>> >> +{
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     clk_disable(phy->wkupclk);
>> >
>> > weird. I would expect the wakeup clock to be enabled on suspend and
>> > disabled on resume. Isn't this causing any unbalanced disable warnings ?
>>
>> Even I was expecting the wakeup clock to be enabled on suspend but if
>> we have this enabled coreaon domain is never
>> gated and core does not hit low power state. btw Why do think this is
>> unbalanced?
>
> because you never do a clk_enable() on probe(), so on your first
> suspend, you will disable the clock without having enabled it before,
> no? Unless pm_runtime forces a runtime_resume() when you call
> pm_runtime_enable()...
>
>> >> +static int omap_usb2_runtime_resume(struct device *dev)
>> >> +{
>> >> +     u32 ret = 0;
>> >> +     struct platform_device  *pdev = to_platform_device(dev);
>> >> +     struct omap_usb *phy = platform_get_drvdata(pdev);
>> >> +
>> >> +     ret = clk_enable(phy->wkupclk);
>> >> +     if (ret < 0)
>> >> +             dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
>> >> +
>> >> +     return ret;
>> >> +}
>> >> +
>> >> +static const struct dev_pm_ops omap_usb2_pm_ops = {
>> >> +     SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend, omap_usb2_runtime_resume,
>> >> +             NULL)
>> >
>> > only runtime ? What about static suspend ? We need this to work also
>> > after a traditional echo mem > /sys/power/state ;-)
>>
>> The static suspend case is handled by users of this phy using
>> set_suspend hooks.
>
> I'm not sure if that's too wise, what if your user enabled USB, but
> for whatever reason loaded only the phy driver and not musb or dwc3. It
> will fail, right ?

The enabling and disabling of phy is solely governed by usb controller
driver (musb/dwc3). So if you dont have musb/dwc3 loaded, the phy will
be for sure disabled.

Thanks
Kishon

  reply	other threads:[~2012-08-06  9:44 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30  9:09 [PATCH v6 00/11] omap: musb: Add device tree support Kishon Vijay Abraham I
2012-07-30  9:09 ` Kishon Vijay Abraham I
2012-07-30  9:09 ` Kishon Vijay Abraham I
2012-07-30  9:09 ` [PATCH v6 01/11] drivers: usb: otg: add a new driver for omap usb2 phy Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:37   ` Shubhrajyoti
2012-07-30  9:37     ` Shubhrajyoti
2012-07-30  9:46     ` ABRAHAM, KISHON VIJAY
2012-07-30  9:46       ` ABRAHAM, KISHON VIJAY
2012-07-30 10:04       ` Shubhrajyoti
2012-07-30 10:04         ` Shubhrajyoti
2012-08-03 13:27   ` Felipe Balbi
2012-08-03 13:27     ` Felipe Balbi
2012-08-03 14:31     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:31       ` ABRAHAM, KISHON VIJAY
2012-08-06  8:49       ` Felipe Balbi
2012-08-06  8:49         ` Felipe Balbi
2012-08-06  8:49         ` Felipe Balbi
2012-08-06  9:44         ` ABRAHAM, KISHON VIJAY [this message]
2012-08-06  9:44           ` ABRAHAM, KISHON VIJAY
2012-08-06  9:44           ` ABRAHAM, KISHON VIJAY
2012-08-06  9:44           ` Felipe Balbi
2012-08-06  9:44             ` Felipe Balbi
2012-08-06  9:44             ` Felipe Balbi
2012-07-30  9:09 ` [PATCH v6 02/11] arm/dts: omap: Add omap-usb2 dt data Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:27   ` Felipe Balbi
2012-08-03 13:27     ` Felipe Balbi
2012-07-30  9:09 ` [PATCH v6 03/11] drivers: usb: otg: make twl6030_usb as a comparator driver to omap_usb2 Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:28   ` Felipe Balbi
2012-08-03 13:28     ` Felipe Balbi
2012-08-03 14:33     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:33       ` ABRAHAM, KISHON VIJAY
2012-07-30  9:09 ` [PATCH v6 04/11] arm: omap: hwmod: add a new addr space in otg for writing to control module Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:29   ` Felipe Balbi
2012-08-03 13:29     ` Felipe Balbi
2012-08-03 14:37     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:37       ` ABRAHAM, KISHON VIJAY
2012-07-30  9:09 ` [PATCH v6 05/11] drivers: usb: twl6030: Add dt support for twl6030 usb Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:31   ` Felipe Balbi
2012-08-03 13:31     ` Felipe Balbi
2012-08-03 14:39     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:39       ` ABRAHAM, KISHON VIJAY
2012-07-30  9:09 ` [PATCH v6 06/11] arm/dts: Add twl6030-usb data Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:31   ` Felipe Balbi
2012-08-03 13:31     ` Felipe Balbi
2012-08-03 13:31     ` Felipe Balbi
2012-07-30  9:09 ` [PATCH v6 07/11] drivers: usb: twl4030: Add device tree support for twl4030 usb Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:32   ` Felipe Balbi
2012-08-03 13:32     ` Felipe Balbi
2012-08-03 13:32     ` Felipe Balbi
2012-08-03 14:40     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:40       ` ABRAHAM, KISHON VIJAY
2012-07-30  9:09 ` [PATCH v6 08/11] arm/dts: Add twl4030-usb data Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:32   ` Felipe Balbi
2012-08-03 13:32     ` Felipe Balbi
2012-07-30  9:09 ` [PATCH v6 09/11] drivers: usb: musb: Add device tree support for omap musb glue Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:34   ` Felipe Balbi
2012-08-03 13:34     ` Felipe Balbi
2012-08-03 13:34     ` Felipe Balbi
2012-08-03 14:42     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:42       ` ABRAHAM, KISHON VIJAY
2012-07-30  9:09 ` [PATCH v6 10/11] arm/dts: omap: Add usb_otg and glue data Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-07-30  9:09   ` Kishon Vijay Abraham I
2012-08-03 13:35   ` Felipe Balbi
2012-08-03 13:35     ` Felipe Balbi
2012-07-30  9:10 ` [PATCH v6 11/11] arm: omap: phy: remove unused functions from omap-phy-internal.c Kishon Vijay Abraham I
2012-07-30  9:10   ` Kishon Vijay Abraham I
2012-07-30  9:10   ` Kishon Vijay Abraham I
2012-08-03 13:36   ` Felipe Balbi
2012-08-03 13:36     ` Felipe Balbi
2012-08-03 14:41     ` ABRAHAM, KISHON VIJAY
2012-08-03 14:41       ` ABRAHAM, KISHON VIJAY
2012-08-06  8:52 ` [PATCH v6 00/11] omap: musb: Add device tree support Felipe Balbi
2012-08-06  8:52   ` Felipe Balbi
2012-08-06  9:25   ` ABRAHAM, KISHON VIJAY
2012-08-06  9:25     ` ABRAHAM, KISHON VIJAY
2012-08-06  9:25     ` ABRAHAM, KISHON VIJAY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAe_U6LhfrRk7PP-Td7BTXPngo7+chvTp4LwwKR_GbsjE4jNJQ@mail.gmail.com \
    --to=kishon@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rnayak@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.