All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] PCI: Drop pcibios_pm_ops from the PCI subsystem
@ 2020-07-30 19:44 Vaibhav Gupta
  2020-08-17 20:01 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Vaibhav Gupta @ 2020-07-30 19:44 UTC (permalink / raw)
  To: Bjorn Helgaas, Bjorn Helgaas; +Cc: Vaibhav Gupta, linux-pci, linux-kernel

The "struct dev_pm_ops pcibios_pm_ops", declared in include/linux/pci.h and
defined in drivers/pci/pci-driver.c, provided arch-specific hooks when a
PCI device was doing a hibernate transisiton.

Although it lost its last usage after
394216275c7d ("s390: remove broken hibernate / power management support")
patch.

After that, instances of it are found only in drivers/pci/pci-driver.c and
include/linux/pci.h, which are now unnecessary. Thus it is safe and
reasonable to remove even that.

Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
---
 drivers/pci/pci-driver.c | 24 ------------------------
 include/linux/pci.h      |  4 ----
 2 files changed, 28 deletions(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index da6510af1221..0bebbdf85be8 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -966,12 +966,6 @@ static int pci_pm_resume(struct device *dev)
 
 #ifdef CONFIG_HIBERNATE_CALLBACKS
 
-/*
- * pcibios_pm_ops - provide arch-specific hooks when a PCI device is doing
- * a hibernate transition
- */
-struct dev_pm_ops __weak pcibios_pm_ops;
-
 static int pci_pm_freeze(struct device *dev)
 {
 	struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -1030,9 +1024,6 @@ static int pci_pm_freeze_noirq(struct device *dev)
 
 	pci_pm_set_unknown_state(pci_dev);
 
-	if (pcibios_pm_ops.freeze_noirq)
-		return pcibios_pm_ops.freeze_noirq(dev);
-
 	return 0;
 }
 
@@ -1042,12 +1033,6 @@ static int pci_pm_thaw_noirq(struct device *dev)
 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 	int error;
 
-	if (pcibios_pm_ops.thaw_noirq) {
-		error = pcibios_pm_ops.thaw_noirq(dev);
-		if (error)
-			return error;
-	}
-
 	/*
 	 * The pm->thaw_noirq() callback assumes the device has been
 	 * returned to D0 and its config state has been restored.
@@ -1171,9 +1156,6 @@ static int pci_pm_poweroff_noirq(struct device *dev)
 
 	pci_fixup_device(pci_fixup_suspend_late, pci_dev);
 
-	if (pcibios_pm_ops.poweroff_noirq)
-		return pcibios_pm_ops.poweroff_noirq(dev);
-
 	return 0;
 }
 
@@ -1183,12 +1165,6 @@ static int pci_pm_restore_noirq(struct device *dev)
 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 	int error;
 
-	if (pcibios_pm_ops.restore_noirq) {
-		error = pcibios_pm_ops.restore_noirq(dev);
-		if (error)
-			return error;
-	}
-
 	pci_pm_default_resume_early(pci_dev);
 	pci_fixup_device(pci_fixup_resume_early, pci_dev);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 34c1c4f45288..c4900975041c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2034,10 +2034,6 @@ int pcibios_alloc_irq(struct pci_dev *dev);
 void pcibios_free_irq(struct pci_dev *dev);
 resource_size_t pcibios_default_alignment(void);
 
-#ifdef CONFIG_HIBERNATE_CALLBACKS
-extern struct dev_pm_ops pcibios_pm_ops;
-#endif
-
 #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)
 void __init pci_mmcfg_early_init(void);
 void __init pci_mmcfg_late_init(void);
-- 
2.27.0


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

* Re: [PATCH v1] PCI: Drop pcibios_pm_ops from the PCI subsystem
  2020-07-30 19:44 [PATCH v1] PCI: Drop pcibios_pm_ops from the PCI subsystem Vaibhav Gupta
@ 2020-08-17 20:01 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2020-08-17 20:01 UTC (permalink / raw)
  To: Vaibhav Gupta; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

On Fri, Jul 31, 2020 at 01:14:16AM +0530, Vaibhav Gupta wrote:
> The "struct dev_pm_ops pcibios_pm_ops", declared in include/linux/pci.h and
> defined in drivers/pci/pci-driver.c, provided arch-specific hooks when a
> PCI device was doing a hibernate transisiton.
> 
> Although it lost its last usage after
> 394216275c7d ("s390: remove broken hibernate / power management support")
> patch.
> 
> After that, instances of it are found only in drivers/pci/pci-driver.c and
> include/linux/pci.h, which are now unnecessary. Thus it is safe and
> reasonable to remove even that.
> 
> Reported-by: Bjorn Helgaas <helgaas@kernel.org>
> Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>

Applied to pci/pm for v5.10, thanks!

> ---
>  drivers/pci/pci-driver.c | 24 ------------------------
>  include/linux/pci.h      |  4 ----
>  2 files changed, 28 deletions(-)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index da6510af1221..0bebbdf85be8 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -966,12 +966,6 @@ static int pci_pm_resume(struct device *dev)
>  
>  #ifdef CONFIG_HIBERNATE_CALLBACKS
>  
> -/*
> - * pcibios_pm_ops - provide arch-specific hooks when a PCI device is doing
> - * a hibernate transition
> - */
> -struct dev_pm_ops __weak pcibios_pm_ops;
> -
>  static int pci_pm_freeze(struct device *dev)
>  {
>  	struct pci_dev *pci_dev = to_pci_dev(dev);
> @@ -1030,9 +1024,6 @@ static int pci_pm_freeze_noirq(struct device *dev)
>  
>  	pci_pm_set_unknown_state(pci_dev);
>  
> -	if (pcibios_pm_ops.freeze_noirq)
> -		return pcibios_pm_ops.freeze_noirq(dev);
> -
>  	return 0;
>  }
>  
> @@ -1042,12 +1033,6 @@ static int pci_pm_thaw_noirq(struct device *dev)
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>  	int error;
>  
> -	if (pcibios_pm_ops.thaw_noirq) {
> -		error = pcibios_pm_ops.thaw_noirq(dev);
> -		if (error)
> -			return error;
> -	}
> -
>  	/*
>  	 * The pm->thaw_noirq() callback assumes the device has been
>  	 * returned to D0 and its config state has been restored.
> @@ -1171,9 +1156,6 @@ static int pci_pm_poweroff_noirq(struct device *dev)
>  
>  	pci_fixup_device(pci_fixup_suspend_late, pci_dev);
>  
> -	if (pcibios_pm_ops.poweroff_noirq)
> -		return pcibios_pm_ops.poweroff_noirq(dev);
> -
>  	return 0;
>  }
>  
> @@ -1183,12 +1165,6 @@ static int pci_pm_restore_noirq(struct device *dev)
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>  	int error;
>  
> -	if (pcibios_pm_ops.restore_noirq) {
> -		error = pcibios_pm_ops.restore_noirq(dev);
> -		if (error)
> -			return error;
> -	}
> -
>  	pci_pm_default_resume_early(pci_dev);
>  	pci_fixup_device(pci_fixup_resume_early, pci_dev);
>  
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 34c1c4f45288..c4900975041c 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -2034,10 +2034,6 @@ int pcibios_alloc_irq(struct pci_dev *dev);
>  void pcibios_free_irq(struct pci_dev *dev);
>  resource_size_t pcibios_default_alignment(void);
>  
> -#ifdef CONFIG_HIBERNATE_CALLBACKS
> -extern struct dev_pm_ops pcibios_pm_ops;
> -#endif
> -
>  #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)
>  void __init pci_mmcfg_early_init(void);
>  void __init pci_mmcfg_late_init(void);
> -- 
> 2.27.0
> 

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

end of thread, other threads:[~2020-08-17 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 19:44 [PATCH v1] PCI: Drop pcibios_pm_ops from the PCI subsystem Vaibhav Gupta
2020-08-17 20:01 ` Bjorn Helgaas

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.