linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
@ 2014-12-04  1:22 Rafael J. Wysocki
  2014-12-09  6:19 ` Aaron Lu
  2014-12-09 21:47 ` [Update][PATCH] " Rafael J. Wysocki
  0 siblings, 2 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-12-04  1:22 UTC (permalink / raw)
  To: linux-scsi
  Cc: Alan Stern, Aaron Lu, Linux Kernel Mailing List, Linux PM list,
	James E.J. Bottomley, Vinayak Holikatti

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
drivers/scsi/ and in include/scsi/scsi_device.h.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
PM_SLEEP is selected) which is only in linux-next at the moment (via the
linux-pm tree).

Please let me know if it is OK to take this one into linux-pm.

---
 drivers/scsi/scsi_pm.c           |    4 ++--
 drivers/scsi/scsi_priv.h         |    5 ++---
 drivers/scsi/ufs/ufshcd-pci.c    |   11 ++++-------
 drivers/scsi/ufs/ufshcd-pltfrm.c |   11 ++++-------
 include/scsi/scsi_device.h       |    4 ++--
 5 files changed, 14 insertions(+), 21 deletions(-)

Index: linux-pm/include/scsi/scsi_device.h
===================================================================
--- linux-pm.orig/include/scsi/scsi_device.h
+++ linux-pm/include/scsi/scsi_device.h
@@ -440,13 +440,13 @@ static inline int scsi_execute_req(struc
 extern void sdev_disable_disk_events(struct scsi_device *sdev);
 extern void sdev_enable_disk_events(struct scsi_device *sdev);
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 extern int scsi_autopm_get_device(struct scsi_device *);
 extern void scsi_autopm_put_device(struct scsi_device *);
 #else
 static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; }
 static inline void scsi_autopm_put_device(struct scsi_device *d) {}
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
 {
Index: linux-pm/drivers/scsi/scsi_priv.h
===================================================================
--- linux-pm.orig/drivers/scsi/scsi_priv.h
+++ linux-pm/drivers/scsi/scsi_priv.h
@@ -157,8 +157,7 @@ static inline void scsi_netlink_exit(voi
 /* scsi_pm.c */
 #ifdef CONFIG_PM
 extern const struct dev_pm_ops scsi_bus_pm_ops;
-#endif
-#ifdef CONFIG_PM_RUNTIME
+
 extern void scsi_autopm_get_target(struct scsi_target *);
 extern void scsi_autopm_put_target(struct scsi_target *);
 extern int scsi_autopm_get_host(struct Scsi_Host *);
@@ -168,7 +167,7 @@ static inline void scsi_autopm_get_targe
 static inline void scsi_autopm_put_target(struct scsi_target *t) {}
 static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
 static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 extern struct async_domain scsi_sd_pm_domain;
 extern struct async_domain scsi_sd_probe_domain;
Index: linux-pm/drivers/scsi/scsi_pm.c
===================================================================
--- linux-pm.orig/drivers/scsi/scsi_pm.c
+++ linux-pm/drivers/scsi/scsi_pm.c
@@ -213,7 +213,7 @@ static int scsi_bus_restore(struct devic
 
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 
 static int sdev_runtime_suspend(struct device *dev)
 {
@@ -338,7 +338,7 @@ void scsi_autopm_put_host(struct Scsi_Ho
 #define scsi_runtime_resume	NULL
 #define scsi_runtime_idle	NULL
 
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 const struct dev_pm_ops scsi_bus_pm_ops = {
 	.prepare =		scsi_bus_prepare,
Index: linux-pm/drivers/scsi/ufs/ufshcd-pci.c
===================================================================
--- linux-pm.orig/drivers/scsi/ufs/ufshcd-pci.c
+++ linux-pm/drivers/scsi/ufs/ufshcd-pci.c
@@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct devi
 {
 	return ufshcd_system_resume(dev_get_drvdata(dev));
 }
-#else
-#define ufshcd_pci_suspend	NULL
-#define ufshcd_pci_resume	NULL
-#endif /* CONFIG_PM */
 
-#ifdef CONFIG_PM_RUNTIME
 static int ufshcd_pci_runtime_suspend(struct device *dev)
 {
 	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struc
 {
 	return ufshcd_runtime_idle(dev_get_drvdata(dev));
 }
-#else /* !CONFIG_PM_RUNTIME */
+#else /* !CONFIG_PM */
+#define ufshcd_pci_suspend	NULL
+#define ufshcd_pci_resume	NULL
 #define ufshcd_pci_runtime_suspend	NULL
 #define ufshcd_pci_runtime_resume	NULL
 #define ufshcd_pci_runtime_idle	NULL
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 /**
  * ufshcd_pci_shutdown - main function to put the controller in reset state
Index: linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
===================================================================
--- linux-pm.orig/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -266,12 +266,7 @@ static int ufshcd_pltfrm_resume(struct d
 {
 	return ufshcd_system_resume(dev_get_drvdata(dev));
 }
-#else
-#define ufshcd_pltfrm_suspend	NULL
-#define ufshcd_pltfrm_resume	NULL
-#endif
 
-#ifdef CONFIG_PM_RUNTIME
 static int ufshcd_pltfrm_runtime_suspend(struct device *dev)
 {
 	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -284,11 +279,13 @@ static int ufshcd_pltfrm_runtime_idle(st
 {
 	return ufshcd_runtime_idle(dev_get_drvdata(dev));
 }
-#else /* !CONFIG_PM_RUNTIME */
+#else /* !CONFIG_PM */
+#define ufshcd_pltfrm_suspend	NULL
+#define ufshcd_pltfrm_resume	NULL
 #define ufshcd_pltfrm_runtime_suspend	NULL
 #define ufshcd_pltfrm_runtime_resume	NULL
 #define ufshcd_pltfrm_runtime_idle	NULL
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 static void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
 {


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

* Re: [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  2014-12-04  1:22 [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM Rafael J. Wysocki
@ 2014-12-09  6:19 ` Aaron Lu
  2014-12-09 21:26   ` Rafael J. Wysocki
  2014-12-09 21:47 ` [Update][PATCH] " Rafael J. Wysocki
  1 sibling, 1 reply; 6+ messages in thread
From: Aaron Lu @ 2014-12-09  6:19 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-scsi
  Cc: Alan Stern, Linux Kernel Mailing List, Linux PM list,
	James E.J. Bottomley, Vinayak Holikatti

On 12/04/2014 09:22 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
> depending on CONFIG_PM_RUNTIME may now be changed to depend on
> CONFIG_PM.
> 
> Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
> drivers/scsi/ and in include/scsi/scsi_device.h.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> PM_SLEEP is selected) which is only in linux-next at the moment (via the
> linux-pm tree).
> 
> Please let me know if it is OK to take this one into linux-pm.
> 
> ---
>  drivers/scsi/scsi_pm.c           |    4 ++--
>  drivers/scsi/scsi_priv.h         |    5 ++---
>  drivers/scsi/ufs/ufshcd-pci.c    |   11 ++++-------
>  drivers/scsi/ufs/ufshcd-pltfrm.c |   11 ++++-------
>  include/scsi/scsi_device.h       |    4 ++--
>  5 files changed, 14 insertions(+), 21 deletions(-)
> 
> Index: linux-pm/drivers/scsi/scsi_pm.c
> ===================================================================
> --- linux-pm.orig/drivers/scsi/scsi_pm.c
> +++ linux-pm/drivers/scsi/scsi_pm.c
> @@ -213,7 +213,7 @@ static int scsi_bus_restore(struct devic
>  
>  #endif /* CONFIG_PM_SLEEP */
>  
> -#ifdef CONFIG_PM_RUNTIME
> +#ifdef CONFIG_PM
>  
>  static int sdev_runtime_suspend(struct device *dev)
>  {
> @@ -338,7 +338,7 @@ void scsi_autopm_put_host(struct Scsi_Ho
>  #define scsi_runtime_resume	NULL
>  #define scsi_runtime_idle	NULL
>  
> -#endif /* CONFIG_PM_RUNTIME */
> +#endif /* CONFIG_PM */
>  
>  const struct dev_pm_ops scsi_bus_pm_ops = {
>  	.prepare =		scsi_bus_prepare,

Just one nitpeak: since scsi_pm.o is only compiled when CONFIG_PM is
set, I think we can skip the #ifdef CONFIG_PM ... #endif macro in this
file now. I mean something like this:

diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
index 7454498..9e43ae1 100644
--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev)
 
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM_RUNTIME
-
 static int sdev_runtime_suspend(struct device *dev)
 {
 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
@@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
 	pm_runtime_put_sync(&shost->shost_gendev);
 }
 
-#else
-
-#define scsi_runtime_suspend	NULL
-#define scsi_runtime_resume	NULL
-#define scsi_runtime_idle	NULL
-
-#endif /* CONFIG_PM_RUNTIME */
-
 const struct dev_pm_ops scsi_bus_pm_ops = {
 	.prepare =		scsi_bus_prepare,
 	.suspend =		scsi_bus_suspend,

Thanks,
Aaron

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

* Re: [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  2014-12-09  6:19 ` Aaron Lu
@ 2014-12-09 21:26   ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-12-09 21:26 UTC (permalink / raw)
  To: Aaron Lu
  Cc: linux-scsi, Alan Stern, Linux Kernel Mailing List, Linux PM list,
	James E.J. Bottomley, Vinayak Holikatti

On Tuesday, December 09, 2014 02:19:57 PM Aaron Lu wrote:
> On 12/04/2014 09:22 AM, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> > selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
> > depending on CONFIG_PM_RUNTIME may now be changed to depend on
> > CONFIG_PM.
> > 
> > Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
> > drivers/scsi/ and in include/scsi/scsi_device.h.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> > 
> > Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> > PM_SLEEP is selected) which is only in linux-next at the moment (via the
> > linux-pm tree).
> > 
> > Please let me know if it is OK to take this one into linux-pm.
> > 
> > ---
> >  drivers/scsi/scsi_pm.c           |    4 ++--
> >  drivers/scsi/scsi_priv.h         |    5 ++---
> >  drivers/scsi/ufs/ufshcd-pci.c    |   11 ++++-------
> >  drivers/scsi/ufs/ufshcd-pltfrm.c |   11 ++++-------
> >  include/scsi/scsi_device.h       |    4 ++--
> >  5 files changed, 14 insertions(+), 21 deletions(-)
> > 
> > Index: linux-pm/drivers/scsi/scsi_pm.c
> > ===================================================================
> > --- linux-pm.orig/drivers/scsi/scsi_pm.c
> > +++ linux-pm/drivers/scsi/scsi_pm.c
> > @@ -213,7 +213,7 @@ static int scsi_bus_restore(struct devic
> >  
> >  #endif /* CONFIG_PM_SLEEP */
> >  
> > -#ifdef CONFIG_PM_RUNTIME
> > +#ifdef CONFIG_PM
> >  
> >  static int sdev_runtime_suspend(struct device *dev)
> >  {
> > @@ -338,7 +338,7 @@ void scsi_autopm_put_host(struct Scsi_Ho
> >  #define scsi_runtime_resume	NULL
> >  #define scsi_runtime_idle	NULL
> >  
> > -#endif /* CONFIG_PM_RUNTIME */
> > +#endif /* CONFIG_PM */
> >  
> >  const struct dev_pm_ops scsi_bus_pm_ops = {
> >  	.prepare =		scsi_bus_prepare,
> 
> Just one nitpeak: since scsi_pm.o is only compiled when CONFIG_PM is
> set, I think we can skip the #ifdef CONFIG_PM ... #endif macro in this
> file now. I mean something like this:

Ah, right, I overlooked that, thanks!

I've folded the below into the SCSI patch.

> diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
> index 7454498..9e43ae1 100644
> --- a/drivers/scsi/scsi_pm.c
> +++ b/drivers/scsi/scsi_pm.c
> @@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev)
>  
>  #endif /* CONFIG_PM_SLEEP */
>  
> -#ifdef CONFIG_PM_RUNTIME
> -
>  static int sdev_runtime_suspend(struct device *dev)
>  {
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> @@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
>  	pm_runtime_put_sync(&shost->shost_gendev);
>  }
>  
> -#else
> -
> -#define scsi_runtime_suspend	NULL
> -#define scsi_runtime_resume	NULL
> -#define scsi_runtime_idle	NULL
> -
> -#endif /* CONFIG_PM_RUNTIME */
> -
>  const struct dev_pm_ops scsi_bus_pm_ops = {
>  	.prepare =		scsi_bus_prepare,
>  	.suspend =		scsi_bus_suspend,
> 
> Thanks,
> Aaron
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* [Update][PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  2014-12-04  1:22 [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM Rafael J. Wysocki
  2014-12-09  6:19 ` Aaron Lu
@ 2014-12-09 21:47 ` Rafael J. Wysocki
  2014-12-10  1:43   ` Aaron Lu
  2014-12-15  8:22   ` Christoph Hellwig
  1 sibling, 2 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-12-09 21:47 UTC (permalink / raw)
  To: linux-scsi
  Cc: Alan Stern, Aaron Lu, Linux Kernel Mailing List, Linux PM list,
	James E.J. Bottomley, Vinayak Holikatti

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
drivers/scsi/ and in include/scsi/scsi_device.h.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
PM_SLEEP is selected) which is only in linux-next at the moment (via the
linux-pm tree).

Please let me know if it is OK to take this one into linux-pm.

---
 drivers/scsi/scsi_pm.c           |   10 ----------
 drivers/scsi/scsi_priv.h         |    5 ++---
 drivers/scsi/ufs/ufshcd-pci.c    |   11 ++++-------
 drivers/scsi/ufs/ufshcd-pltfrm.c |   11 ++++-------
 include/scsi/scsi_device.h       |    4 ++--
 5 files changed, 12 insertions(+), 29 deletions(-)

Index: linux-pm/include/scsi/scsi_device.h
===================================================================
--- linux-pm.orig/include/scsi/scsi_device.h
+++ linux-pm/include/scsi/scsi_device.h
@@ -440,13 +440,13 @@ static inline int scsi_execute_req(struc
 extern void sdev_disable_disk_events(struct scsi_device *sdev);
 extern void sdev_enable_disk_events(struct scsi_device *sdev);
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 extern int scsi_autopm_get_device(struct scsi_device *);
 extern void scsi_autopm_put_device(struct scsi_device *);
 #else
 static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; }
 static inline void scsi_autopm_put_device(struct scsi_device *d) {}
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
 {
Index: linux-pm/drivers/scsi/scsi_priv.h
===================================================================
--- linux-pm.orig/drivers/scsi/scsi_priv.h
+++ linux-pm/drivers/scsi/scsi_priv.h
@@ -157,8 +157,7 @@ static inline void scsi_netlink_exit(voi
 /* scsi_pm.c */
 #ifdef CONFIG_PM
 extern const struct dev_pm_ops scsi_bus_pm_ops;
-#endif
-#ifdef CONFIG_PM_RUNTIME
+
 extern void scsi_autopm_get_target(struct scsi_target *);
 extern void scsi_autopm_put_target(struct scsi_target *);
 extern int scsi_autopm_get_host(struct Scsi_Host *);
@@ -168,7 +167,7 @@ static inline void scsi_autopm_get_targe
 static inline void scsi_autopm_put_target(struct scsi_target *t) {}
 static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
 static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 extern struct async_domain scsi_sd_pm_domain;
 extern struct async_domain scsi_sd_probe_domain;
Index: linux-pm/drivers/scsi/scsi_pm.c
===================================================================
--- linux-pm.orig/drivers/scsi/scsi_pm.c
+++ linux-pm/drivers/scsi/scsi_pm.c
@@ -213,8 +213,6 @@ static int scsi_bus_restore(struct devic
 
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM_RUNTIME
-
 static int sdev_runtime_suspend(struct device *dev)
 {
 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
@@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Ho
 	pm_runtime_put_sync(&shost->shost_gendev);
 }
 
-#else
-
-#define scsi_runtime_suspend	NULL
-#define scsi_runtime_resume	NULL
-#define scsi_runtime_idle	NULL
-
-#endif /* CONFIG_PM_RUNTIME */
-
 const struct dev_pm_ops scsi_bus_pm_ops = {
 	.prepare =		scsi_bus_prepare,
 	.suspend =		scsi_bus_suspend,
Index: linux-pm/drivers/scsi/ufs/ufshcd-pci.c
===================================================================
--- linux-pm.orig/drivers/scsi/ufs/ufshcd-pci.c
+++ linux-pm/drivers/scsi/ufs/ufshcd-pci.c
@@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct devi
 {
 	return ufshcd_system_resume(dev_get_drvdata(dev));
 }
-#else
-#define ufshcd_pci_suspend	NULL
-#define ufshcd_pci_resume	NULL
-#endif /* CONFIG_PM */
 
-#ifdef CONFIG_PM_RUNTIME
 static int ufshcd_pci_runtime_suspend(struct device *dev)
 {
 	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struc
 {
 	return ufshcd_runtime_idle(dev_get_drvdata(dev));
 }
-#else /* !CONFIG_PM_RUNTIME */
+#else /* !CONFIG_PM */
+#define ufshcd_pci_suspend	NULL
+#define ufshcd_pci_resume	NULL
 #define ufshcd_pci_runtime_suspend	NULL
 #define ufshcd_pci_runtime_resume	NULL
 #define ufshcd_pci_runtime_idle	NULL
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 /**
  * ufshcd_pci_shutdown - main function to put the controller in reset state
Index: linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
===================================================================
--- linux-pm.orig/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -266,12 +266,7 @@ static int ufshcd_pltfrm_resume(struct d
 {
 	return ufshcd_system_resume(dev_get_drvdata(dev));
 }
-#else
-#define ufshcd_pltfrm_suspend	NULL
-#define ufshcd_pltfrm_resume	NULL
-#endif
 
-#ifdef CONFIG_PM_RUNTIME
 static int ufshcd_pltfrm_runtime_suspend(struct device *dev)
 {
 	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -284,11 +279,13 @@ static int ufshcd_pltfrm_runtime_idle(st
 {
 	return ufshcd_runtime_idle(dev_get_drvdata(dev));
 }
-#else /* !CONFIG_PM_RUNTIME */
+#else /* !CONFIG_PM */
+#define ufshcd_pltfrm_suspend	NULL
+#define ufshcd_pltfrm_resume	NULL
 #define ufshcd_pltfrm_runtime_suspend	NULL
 #define ufshcd_pltfrm_runtime_resume	NULL
 #define ufshcd_pltfrm_runtime_idle	NULL
-#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 static void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
 {

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

* Re: [Update][PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  2014-12-09 21:47 ` [Update][PATCH] " Rafael J. Wysocki
@ 2014-12-10  1:43   ` Aaron Lu
  2014-12-15  8:22   ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: Aaron Lu @ 2014-12-10  1:43 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-scsi
  Cc: Alan Stern, Linux Kernel Mailing List, Linux PM list,
	James E.J. Bottomley, Vinayak Holikatti

On 12/10/2014 05:47 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Subject: SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
> 
> After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
> depending on CONFIG_PM_RUNTIME may now be changed to depend on
> CONFIG_PM.
> 
> Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
> drivers/scsi/ and in include/scsi/scsi_device.h.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Aaron Lu <aaron.lu@intel.com>

Thanks,
Aaron

> ---
> 
> Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> PM_SLEEP is selected) which is only in linux-next at the moment (via the
> linux-pm tree).
> 
> Please let me know if it is OK to take this one into linux-pm.
> 
> ---
>  drivers/scsi/scsi_pm.c           |   10 ----------
>  drivers/scsi/scsi_priv.h         |    5 ++---
>  drivers/scsi/ufs/ufshcd-pci.c    |   11 ++++-------
>  drivers/scsi/ufs/ufshcd-pltfrm.c |   11 ++++-------
>  include/scsi/scsi_device.h       |    4 ++--
>  5 files changed, 12 insertions(+), 29 deletions(-)
> 
> Index: linux-pm/include/scsi/scsi_device.h
> ===================================================================
> --- linux-pm.orig/include/scsi/scsi_device.h
> +++ linux-pm/include/scsi/scsi_device.h
> @@ -440,13 +440,13 @@ static inline int scsi_execute_req(struc
>  extern void sdev_disable_disk_events(struct scsi_device *sdev);
>  extern void sdev_enable_disk_events(struct scsi_device *sdev);
>  
> -#ifdef CONFIG_PM_RUNTIME
> +#ifdef CONFIG_PM
>  extern int scsi_autopm_get_device(struct scsi_device *);
>  extern void scsi_autopm_put_device(struct scsi_device *);
>  #else
>  static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; }
>  static inline void scsi_autopm_put_device(struct scsi_device *d) {}
> -#endif /* CONFIG_PM_RUNTIME */
> +#endif /* CONFIG_PM */
>  
>  static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
>  {
> Index: linux-pm/drivers/scsi/scsi_priv.h
> ===================================================================
> --- linux-pm.orig/drivers/scsi/scsi_priv.h
> +++ linux-pm/drivers/scsi/scsi_priv.h
> @@ -157,8 +157,7 @@ static inline void scsi_netlink_exit(voi
>  /* scsi_pm.c */
>  #ifdef CONFIG_PM
>  extern const struct dev_pm_ops scsi_bus_pm_ops;
> -#endif
> -#ifdef CONFIG_PM_RUNTIME
> +
>  extern void scsi_autopm_get_target(struct scsi_target *);
>  extern void scsi_autopm_put_target(struct scsi_target *);
>  extern int scsi_autopm_get_host(struct Scsi_Host *);
> @@ -168,7 +167,7 @@ static inline void scsi_autopm_get_targe
>  static inline void scsi_autopm_put_target(struct scsi_target *t) {}
>  static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
>  static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
> -#endif /* CONFIG_PM_RUNTIME */
> +#endif /* CONFIG_PM */
>  
>  extern struct async_domain scsi_sd_pm_domain;
>  extern struct async_domain scsi_sd_probe_domain;
> Index: linux-pm/drivers/scsi/scsi_pm.c
> ===================================================================
> --- linux-pm.orig/drivers/scsi/scsi_pm.c
> +++ linux-pm/drivers/scsi/scsi_pm.c
> @@ -213,8 +213,6 @@ static int scsi_bus_restore(struct devic
>  
>  #endif /* CONFIG_PM_SLEEP */
>  
> -#ifdef CONFIG_PM_RUNTIME
> -
>  static int sdev_runtime_suspend(struct device *dev)
>  {
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> @@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Ho
>  	pm_runtime_put_sync(&shost->shost_gendev);
>  }
>  
> -#else
> -
> -#define scsi_runtime_suspend	NULL
> -#define scsi_runtime_resume	NULL
> -#define scsi_runtime_idle	NULL
> -
> -#endif /* CONFIG_PM_RUNTIME */
> -
>  const struct dev_pm_ops scsi_bus_pm_ops = {
>  	.prepare =		scsi_bus_prepare,
>  	.suspend =		scsi_bus_suspend,
> Index: linux-pm/drivers/scsi/ufs/ufshcd-pci.c
> ===================================================================
> --- linux-pm.orig/drivers/scsi/ufs/ufshcd-pci.c
> +++ linux-pm/drivers/scsi/ufs/ufshcd-pci.c
> @@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct devi
>  {
>  	return ufshcd_system_resume(dev_get_drvdata(dev));
>  }
> -#else
> -#define ufshcd_pci_suspend	NULL
> -#define ufshcd_pci_resume	NULL
> -#endif /* CONFIG_PM */
>  
> -#ifdef CONFIG_PM_RUNTIME
>  static int ufshcd_pci_runtime_suspend(struct device *dev)
>  {
>  	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
> @@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struc
>  {
>  	return ufshcd_runtime_idle(dev_get_drvdata(dev));
>  }
> -#else /* !CONFIG_PM_RUNTIME */
> +#else /* !CONFIG_PM */
> +#define ufshcd_pci_suspend	NULL
> +#define ufshcd_pci_resume	NULL
>  #define ufshcd_pci_runtime_suspend	NULL
>  #define ufshcd_pci_runtime_resume	NULL
>  #define ufshcd_pci_runtime_idle	NULL
> -#endif /* CONFIG_PM_RUNTIME */
> +#endif /* CONFIG_PM */
>  
>  /**
>   * ufshcd_pci_shutdown - main function to put the controller in reset state
> Index: linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
> ===================================================================
> --- linux-pm.orig/drivers/scsi/ufs/ufshcd-pltfrm.c
> +++ linux-pm/drivers/scsi/ufs/ufshcd-pltfrm.c
> @@ -266,12 +266,7 @@ static int ufshcd_pltfrm_resume(struct d
>  {
>  	return ufshcd_system_resume(dev_get_drvdata(dev));
>  }
> -#else
> -#define ufshcd_pltfrm_suspend	NULL
> -#define ufshcd_pltfrm_resume	NULL
> -#endif
>  
> -#ifdef CONFIG_PM_RUNTIME
>  static int ufshcd_pltfrm_runtime_suspend(struct device *dev)
>  {
>  	return ufshcd_runtime_suspend(dev_get_drvdata(dev));
> @@ -284,11 +279,13 @@ static int ufshcd_pltfrm_runtime_idle(st
>  {
>  	return ufshcd_runtime_idle(dev_get_drvdata(dev));
>  }
> -#else /* !CONFIG_PM_RUNTIME */
> +#else /* !CONFIG_PM */
> +#define ufshcd_pltfrm_suspend	NULL
> +#define ufshcd_pltfrm_resume	NULL
>  #define ufshcd_pltfrm_runtime_suspend	NULL
>  #define ufshcd_pltfrm_runtime_resume	NULL
>  #define ufshcd_pltfrm_runtime_idle	NULL
> -#endif /* CONFIG_PM_RUNTIME */
> +#endif /* CONFIG_PM */
>  
>  static void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
>  {
> 


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

* Re: [Update][PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  2014-12-09 21:47 ` [Update][PATCH] " Rafael J. Wysocki
  2014-12-10  1:43   ` Aaron Lu
@ 2014-12-15  8:22   ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2014-12-15  8:22 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-scsi, Alan Stern, Aaron Lu, Linux Kernel Mailing List,
	Linux PM list, James E.J. Bottomley, Vinayak Holikatti

On Tue, Dec 09, 2014 at 10:47:47PM +0100, Rafael J. Wysocki wrote:
> Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> PM_SLEEP is selected) which is only in linux-next at the moment (via the
> linux-pm tree).
> 
> Please let me know if it is OK to take this one into linux-pm.

Feel free to add it to the linux-pm tree.

Acked-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2014-12-15  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04  1:22 [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM Rafael J. Wysocki
2014-12-09  6:19 ` Aaron Lu
2014-12-09 21:26   ` Rafael J. Wysocki
2014-12-09 21:47 ` [Update][PATCH] " Rafael J. Wysocki
2014-12-10  1:43   ` Aaron Lu
2014-12-15  8:22   ` Christoph Hellwig

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).