linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve phy-mapphone pm
@ 2018-11-17 13:37 Tony Lindgren
  2018-11-17 13:37 ` [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled Tony Lindgren
  2018-11-17 13:37 ` [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls Tony Lindgren
  0 siblings, 2 replies; 10+ messages in thread
From: Tony Lindgren @ 2018-11-17 13:37 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek, Sebastian Reichel

Hi,

Here are two non-urgent patches to get phy-mapphone runtime PM working
better. Currently it only works when toggled from the userspace via the
sysfs entry for for "auto" and "on".

Regards,

Tony


Tony Lindgren (2):
  phy: core: Add phy_pm_runtime_enabled
  phy: mapphone-mdm6600: Improve phy related runtime PM calls

 drivers/phy/motorola/phy-mapphone-mdm6600.c | 71 +++++++++++++++------
 drivers/phy/phy-core.c                      |  9 +++
 include/linux/phy/phy.h                     |  6 ++
 3 files changed, 66 insertions(+), 20 deletions(-)

-- 
2.19.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2018-11-17 13:37 [PATCH 0/2] Improve phy-mapphone pm Tony Lindgren
@ 2018-11-17 13:37 ` Tony Lindgren
  2018-11-17 15:38   ` Johan Hovold
  2018-11-19 14:46   ` kbuild test robot
  2018-11-17 13:37 ` [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls Tony Lindgren
  1 sibling, 2 replies; 10+ messages in thread
From: Tony Lindgren @ 2018-11-17 13:37 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek, Sebastian Reichel

The phy driver may need to check phy_pm_runtime_enabled() in suspend as
PM runtime for phy may be already disabled when phy power_off() is called.

Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/phy/phy-core.c  | 9 +++++++++
 include/linux/phy/phy.h | 6 ++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -209,6 +209,15 @@ int phy_pm_runtime_put_sync(struct phy *phy)
 }
 EXPORT_SYMBOL_GPL(phy_pm_runtime_put_sync);
 
+bool phy_pm_runtime_enabled(struct phy *phy)
+{
+	if (!phy)
+		return false;
+
+	return pm_runtime_enabled(&phy->dev);
+}
+EXPORT_SYMBOL_GPL(phy_pm_runtime_enabled);
+
 void phy_pm_runtime_allow(struct phy *phy)
 {
 	if (!phy)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -158,6 +158,7 @@ int phy_pm_runtime_get(struct phy *phy);
 int phy_pm_runtime_get_sync(struct phy *phy);
 int phy_pm_runtime_put(struct phy *phy);
 int phy_pm_runtime_put_sync(struct phy *phy);
+bool phy_pm_runtime_enabled(struct phy *phy);
 void phy_pm_runtime_allow(struct phy *phy);
 void phy_pm_runtime_forbid(struct phy *phy);
 int phy_init(struct phy *phy);
@@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy *phy)
 	return -ENOSYS;
 }
 
+static inline bool phy_pm_runtime_enabled(struct phy *phy)
+{
+	return false
+}
+
 static inline void phy_pm_runtime_allow(struct phy *phy)
 {
 	return;
-- 
2.19.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls
  2018-11-17 13:37 [PATCH 0/2] Improve phy-mapphone pm Tony Lindgren
  2018-11-17 13:37 ` [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled Tony Lindgren
@ 2018-11-17 13:37 ` Tony Lindgren
  2018-11-23  7:59   ` Kishon Vijay Abraham I
  1 sibling, 1 reply; 10+ messages in thread
From: Tony Lindgren @ 2018-11-17 13:37 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek, Sebastian Reichel

I noticed that phy_pm_runtime_get_sync() and phy_pm_runtime_put() are not
currently doing anything for phy-mapphone-mdm6600, only the sysfs interface
for works for "auto" and "on".

This is because of the shared GPIO pins between mdm6600 USB port and n_gsm
port. We have not enabled runtime PM for the phy driver until after we've
booted up mdm6600 properly to the USB mode. Otherwise phy_create() would
have called pm_runtime_enable() and pm_runtime_no_callbacks() automatically
on init.

Let's fix this by registering the phy a bit later after we've powered up the
mdm6600 USB port.

And as the PM runtime support is only needed for the n_gsm mode and not for
USB, we can allow the device to idle between phy_mdm6600_power_on() and
phy_mdm6600_power_off(). Note that for suspend, runtime_pm is already
disabled for the phy so we need to check for phy_pm_runtime_enabled().

Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/phy/motorola/phy-mapphone-mdm6600.c | 71 +++++++++++++++------
 1 file changed, 51 insertions(+), 20 deletions(-)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -16,6 +16,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/of_platform.h>
 #include <linux/phy/phy.h>
+#include <linux/pinctrl/consumer.h>
 
 #define PHY_MDM6600_PHY_DELAY_MS	4000	/* PHY enable 2.2s to 3.5s */
 #define PHY_MDM6600_ENABLED_DELAY_MS	8000	/* 8s more total for MDM6600 */
@@ -124,12 +125,22 @@ static int phy_mdm6600_power_on(struct phy *x)
 {
 	struct phy_mdm6600 *ddata = phy_get_drvdata(x);
 	struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
+	int error;
 
 	if (!ddata->enabled)
 		return -ENODEV;
 
+	error = pinctrl_pm_select_default_state(ddata->dev);
+	if (error)
+		dev_warn(ddata->dev, "%s: error with default_state: %i\n",
+			 __func__, error);
+
 	gpiod_set_value_cansleep(enable_gpio, 1);
 
+	/* Allow aggressive PM for USB, it's only needed for n_gsm port */
+	if (phy_pm_runtime_enabled(ddata->generic_phy))
+		phy_pm_runtime_put(ddata->generic_phy);
+
 	return 0;
 }
 
@@ -137,12 +148,26 @@ static int phy_mdm6600_power_off(struct phy *x)
 {
 	struct phy_mdm6600 *ddata = phy_get_drvdata(x);
 	struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
+	int error;
 
 	if (!ddata->enabled)
 		return -ENODEV;
 
+	/* Paired with phy_pm_runtime_put() in phy_mdm6600_power_on() */
+	if (phy_pm_runtime_enabled(ddata->generic_phy)) {
+		error = phy_pm_runtime_get(ddata->generic_phy);
+		if (error < 0 && error != -EINPROGRESS)
+			dev_warn(ddata->dev, "%s: phy_pm_runtime_get: %i\n",
+				 __func__, error);
+	}
+
 	gpiod_set_value_cansleep(enable_gpio, 0);
 
+	error = pinctrl_pm_select_sleep_state(ddata->dev);
+	if (error)
+		dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
+			 __func__, error);
+
 	return 0;
 }
 
@@ -555,28 +580,17 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
 	ddata->dev = &pdev->dev;
 	platform_set_drvdata(pdev, ddata);
 
+	/* Active state selected in phy_mdm6600_power_on() */
+	error = pinctrl_pm_select_sleep_state(ddata->dev);
+	if (error)
+		dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
+			 __func__, error);
+
 	error = phy_mdm6600_init_lines(ddata);
 	if (error)
 		return error;
 
 	phy_mdm6600_init_irq(ddata);
-
-	ddata->generic_phy = devm_phy_create(ddata->dev, NULL, &gpio_usb_ops);
-	if (IS_ERR(ddata->generic_phy)) {
-		error = PTR_ERR(ddata->generic_phy);
-		goto cleanup;
-	}
-
-	phy_set_drvdata(ddata->generic_phy, ddata);
-
-	ddata->phy_provider =
-		devm_of_phy_provider_register(ddata->dev,
-					      of_phy_simple_xlate);
-	if (IS_ERR(ddata->phy_provider)) {
-		error = PTR_ERR(ddata->phy_provider);
-		goto cleanup;
-	}
-
 	schedule_delayed_work(&ddata->bootup_work, 0);
 
 	/*
@@ -600,14 +614,31 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
 	if (error < 0) {
 		dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
 		pm_runtime_put_noidle(ddata->dev);
+		goto cleanup;
 	}
+
+	ddata->generic_phy = devm_phy_create(ddata->dev, NULL, &gpio_usb_ops);
+	if (IS_ERR(ddata->generic_phy)) {
+		error = PTR_ERR(ddata->generic_phy);
+		goto idle;
+	}
+
+	phy_set_drvdata(ddata->generic_phy, ddata);
+
+	ddata->phy_provider =
+		devm_of_phy_provider_register(ddata->dev,
+					      of_phy_simple_xlate);
+	if (IS_ERR(ddata->phy_provider))
+		error = PTR_ERR(ddata->phy_provider);
+
+idle:
 	pm_runtime_mark_last_busy(ddata->dev);
 	pm_runtime_put_autosuspend(ddata->dev);
 
-	return 0;
-
 cleanup:
-	phy_mdm6600_device_power_off(ddata);
+	if (error < 0)
+		phy_mdm6600_device_power_off(ddata);
+
 	return error;
 }
 
-- 
2.19.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2018-11-17 13:37 ` [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled Tony Lindgren
@ 2018-11-17 15:38   ` Johan Hovold
  2018-11-17 15:43     ` Tony Lindgren
  2018-11-19 14:46   ` kbuild test robot
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2018-11-17 15:38 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Kishon Vijay Abraham I, linux-kernel, linux-usb, linux-omap,
	Pavel Machek, Sebastian Reichel

On Sat, Nov 17, 2018 at 05:37:54AM -0800, Tony Lindgren wrote:
> The phy driver may need to check phy_pm_runtime_enabled() in suspend as
> PM runtime for phy may be already disabled when phy power_off() is called.
> 
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Sebastian Reichel <sre@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/phy/phy-core.c  | 9 +++++++++
>  include/linux/phy/phy.h | 6 ++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c

> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -158,6 +158,7 @@ int phy_pm_runtime_get(struct phy *phy);
>  int phy_pm_runtime_get_sync(struct phy *phy);
>  int phy_pm_runtime_put(struct phy *phy);
>  int phy_pm_runtime_put_sync(struct phy *phy);
> +bool phy_pm_runtime_enabled(struct phy *phy);
>  void phy_pm_runtime_allow(struct phy *phy);
>  void phy_pm_runtime_forbid(struct phy *phy);
>  int phy_init(struct phy *phy);
> @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy *phy)
>  	return -ENOSYS;
>  }
>  
> +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> +{
> +	return false

Missing semicolon.

> +}
> +
>  static inline void phy_pm_runtime_allow(struct phy *phy)
>  {
>  	return;

Johan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2018-11-17 15:38   ` Johan Hovold
@ 2018-11-17 15:43     ` Tony Lindgren
  2019-06-02 10:14       ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Tony Lindgren @ 2018-11-17 15:43 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Kishon Vijay Abraham I, linux-kernel, linux-usb, linux-omap,
	Pavel Machek, Sebastian Reichel

* Johan Hovold <johan@kernel.org> [181117 15:38]:
> On Sat, Nov 17, 2018 at 05:37:54AM -0800, Tony Lindgren wrote:
> > The phy driver may need to check phy_pm_runtime_enabled() in suspend as
> > PM runtime for phy may be already disabled when phy power_off() is called.
> > 
> > Cc: Pavel Machek <pavel@ucw.cz>
> > Cc: Sebastian Reichel <sre@kernel.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  drivers/phy/phy-core.c  | 9 +++++++++
> >  include/linux/phy/phy.h | 6 ++++++
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> > --- a/drivers/phy/phy-core.c
> > +++ b/drivers/phy/phy-core.c
> 
> > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> > --- a/include/linux/phy/phy.h
> > +++ b/include/linux/phy/phy.h
> > @@ -158,6 +158,7 @@ int phy_pm_runtime_get(struct phy *phy);
> >  int phy_pm_runtime_get_sync(struct phy *phy);
> >  int phy_pm_runtime_put(struct phy *phy);
> >  int phy_pm_runtime_put_sync(struct phy *phy);
> > +bool phy_pm_runtime_enabled(struct phy *phy);
> >  void phy_pm_runtime_allow(struct phy *phy);
> >  void phy_pm_runtime_forbid(struct phy *phy);
> >  int phy_init(struct phy *phy);
> > @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy *phy)
> >  	return -ENOSYS;
> >  }
> >  
> > +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> > +{
> > +	return false
> 
> Missing semicolon.

Oops thanks for catching that. I guess I did not try building
without CONFIG_GENERIC_PHY. Will fix and repost.

Regards,

Tony

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2018-11-17 13:37 ` [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled Tony Lindgren
  2018-11-17 15:38   ` Johan Hovold
@ 2018-11-19 14:46   ` kbuild test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2018-11-19 14:46 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: kbuild-all, Kishon Vijay Abraham I, linux-kernel, linux-usb,
	linux-omap, Pavel Machek, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]

Hi Tony,

I love your patch! Yet something to improve:

[auto build test ERROR on phy/next]
[also build test ERROR on v4.20-rc3 next-20181119]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Tony-Lindgren/Improve-phy-mapphone-pm/20181119-222603
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git next
config: riscv-tinyconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=riscv 

All errors (new ones prefixed by >>):

   In file included from include/linux/usb/otg.h:13,
                    from include/linux/usb/of.h:12,
                    from drivers/usb/phy/of.c:9:
   include/linux/phy/phy.h: In function 'phy_pm_runtime_enabled':
>> include/linux/phy/phy.h:246:14: error: expected ';' before '}' token
     return false
                 ^
                 ;
    }
    ~             

vim +246 include/linux/phy/phy.h

   243	
   244	static inline bool phy_pm_runtime_enabled(struct phy *phy)
   245	{
 > 246		return false
   247	}
   248	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 4415 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls
  2018-11-17 13:37 ` [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls Tony Lindgren
@ 2018-11-23  7:59   ` Kishon Vijay Abraham I
  2018-11-23 16:58     ` Tony Lindgren
  0 siblings, 1 reply; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2018-11-23  7:59 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek, Sebastian Reichel

Hi Tony,

On 17/11/18 7:07 PM, Tony Lindgren wrote:
> I noticed that phy_pm_runtime_get_sync() and phy_pm_runtime_put() are not
> currently doing anything for phy-mapphone-mdm6600, only the sysfs interface
> for works for "auto" and "on".
> 
> This is because of the shared GPIO pins between mdm6600 USB port and n_gsm
> port. We have not enabled runtime PM for the phy driver until after we've
> booted up mdm6600 properly to the USB mode. Otherwise phy_create() would
> have called pm_runtime_enable() and pm_runtime_no_callbacks() automatically
> on init.
> 
> Let's fix this by registering the phy a bit later after we've powered up the
> mdm6600 USB port.
> 
> And as the PM runtime support is only needed for the n_gsm mode and not for
> USB, we can allow the device to idle between phy_mdm6600_power_on() and
> phy_mdm6600_power_off(). Note that for suspend, runtime_pm is already
> disabled for the phy so we need to check for phy_pm_runtime_enabled().
> 
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Sebastian Reichel <sre@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/phy/motorola/phy-mapphone-mdm6600.c | 71 +++++++++++++++------
>  1 file changed, 51 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
> +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> @@ -16,6 +16,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/of_platform.h>
>  #include <linux/phy/phy.h>
> +#include <linux/pinctrl/consumer.h>
>  
>  #define PHY_MDM6600_PHY_DELAY_MS	4000	/* PHY enable 2.2s to 3.5s */
>  #define PHY_MDM6600_ENABLED_DELAY_MS	8000	/* 8s more total for MDM6600 */
> @@ -124,12 +125,22 @@ static int phy_mdm6600_power_on(struct phy *x)
>  {
>  	struct phy_mdm6600 *ddata = phy_get_drvdata(x);
>  	struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
> +	int error;
>  
>  	if (!ddata->enabled)
>  		return -ENODEV;
>  
> +	error = pinctrl_pm_select_default_state(ddata->dev);
> +	if (error)
> +		dev_warn(ddata->dev, "%s: error with default_state: %i\n",
> +			 __func__, error);
> +
>  	gpiod_set_value_cansleep(enable_gpio, 1);
>  
> +	/* Allow aggressive PM for USB, it's only needed for n_gsm port */
> +	if (phy_pm_runtime_enabled(ddata->generic_phy))
> +		phy_pm_runtime_put(ddata->generic_phy);

phy_*() API's are generally added to be used by the consumer driver. I guess in
this case we can directly use pm_runtime_enabled(x).

Thanks
Kishon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls
  2018-11-23  7:59   ` Kishon Vijay Abraham I
@ 2018-11-23 16:58     ` Tony Lindgren
  0 siblings, 0 replies; 10+ messages in thread
From: Tony Lindgren @ 2018-11-23 16:58 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek, Sebastian Reichel

* Kishon Vijay Abraham I <kishon@ti.com> [181123 07:59]:
> On 17/11/18 7:07 PM, Tony Lindgren wrote:
> > +	/* Allow aggressive PM for USB, it's only needed for n_gsm port */
> > +	if (phy_pm_runtime_enabled(ddata->generic_phy))
> > +		phy_pm_runtime_put(ddata->generic_phy);
> 
> phy_*() API's are generally added to be used by the consumer driver. I guess in
> this case we can directly use pm_runtime_enabled(x).

OK sure that works for me too.

Regards,

Tony

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2018-11-17 15:43     ` Tony Lindgren
@ 2019-06-02 10:14       ` Pavel Machek
  2019-06-02 10:25         ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2019-06-02 10:14 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Johan Hovold, Kishon Vijay Abraham I, linux-kernel, linux-usb,
	linux-omap, Sebastian Reichel

Hi!

> > > The phy driver may need to check phy_pm_runtime_enabled() in suspend as
> > > PM runtime for phy may be already disabled when phy power_off() is called.
> > > 
> > > Cc: Pavel Machek <pavel@ucw.cz>
> > > Cc: Sebastian Reichel <sre@kernel.org>
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > ---
> > >  drivers/phy/phy-core.c  | 9 +++++++++
> > >  include/linux/phy/phy.h | 6 ++++++
> > >  2 files changed, 15 insertions(+)
> > > 
> > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> > > --- a/drivers/phy/phy-core.c
> > > +++ b/drivers/phy/phy-core.c
> > 
> > > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> > > --- a/include/linux/phy/phy.h
> > > +++ b/include/linux/phy/phy.h
> > > @@ -158,6 +158,7 @@ int phy_pm_runtime_get(struct phy *phy);
> > >  int phy_pm_runtime_get_sync(struct phy *phy);
> > >  int phy_pm_runtime_put(struct phy *phy);
> > >  int phy_pm_runtime_put_sync(struct phy *phy);
> > > +bool phy_pm_runtime_enabled(struct phy *phy);
> > >  void phy_pm_runtime_allow(struct phy *phy);
> > >  void phy_pm_runtime_forbid(struct phy *phy);
> > >  int phy_init(struct phy *phy);
> > > @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy *phy)
> > >  	return -ENOSYS;
> > >  }
> > >  
> > > +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> > > +{
> > > +	return false
> > 
> > Missing semicolon.
> 
> Oops thanks for catching that. I guess I did not try building
> without CONFIG_GENERIC_PHY. Will fix and repost.

Did this series get lost/forgotten somewhere? Is it still needed? Any
way I can help?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled
  2019-06-02 10:14       ` Pavel Machek
@ 2019-06-02 10:25         ` Pavel Machek
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2019-06-02 10:25 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Johan Hovold, Kishon Vijay Abraham I, linux-kernel, linux-usb,
	linux-omap, Sebastian Reichel

Hi!

> > > > @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy *phy)
> > > >  	return -ENOSYS;
> > > >  }
> > > >  
> > > > +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> > > > +{
> > > > +	return false
> > > 
> > > Missing semicolon.
> > 
> > Oops thanks for catching that. I guess I did not try building
> > without CONFIG_GENERIC_PHY. Will fix and repost.
> 
> Did this series get lost/forgotten somewhere? Is it still needed? Any
> way I can help?

Aha, it seems v2 of the series was applied, which touches different
files and that's why I did not detect it. Sorry for the noise.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-06-02 10:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-17 13:37 [PATCH 0/2] Improve phy-mapphone pm Tony Lindgren
2018-11-17 13:37 ` [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled Tony Lindgren
2018-11-17 15:38   ` Johan Hovold
2018-11-17 15:43     ` Tony Lindgren
2019-06-02 10:14       ` Pavel Machek
2019-06-02 10:25         ` Pavel Machek
2018-11-19 14:46   ` kbuild test robot
2018-11-17 13:37 ` [PATCH 2/2] phy: mapphone-mdm6600: Improve phy related runtime PM calls Tony Lindgren
2018-11-23  7:59   ` Kishon Vijay Abraham I
2018-11-23 16:58     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).