mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	PCI/PM: Allow runtime PM with no PM callbacks at all
Commitc5eb119007("PCI / PM: Allow runtime PM without callback functions") eliminated the need for PM callbacks in pci_pm_runtime_suspend() and pci_pm_runtime_resume(), but didn't do the same for pci_pm_runtime_idle(). Therefore, runtime suspend worked as long as the driver implemented at least one PM callback. But if the driver doesn't implement any PM callbacks at all (driver->pm is NULL), pci_pm_runtime_idle() returned -ENOSYS, which prevented runtime suspend. Modify pci_pm_runtime_idle() to allow PCI device power state transitions without runtime PM callbacks and complete the original intention of commitc5eb119007("PCI / PM: Allow runtime PM without callback functions"). Link: https://lore.kernel.org/r/20240227062648.16579-1-raag.jadav@intel.com Signed-off-by: Raag Jadav <raag.jadav@intel.com> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org>
This commit is contained in:
		
							parent
							
								
									cb98555fcd
								
							
						
					
					
						commit
						fa885b06ec
					
				
					 1 changed files with 1 additions and 4 deletions
				
			
		| 
						 | 
					@ -1382,10 +1382,7 @@ static int pci_pm_runtime_idle(struct device *dev)
 | 
				
			||||||
	if (!pci_dev->driver)
 | 
						if (!pci_dev->driver)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!pm)
 | 
						if (pm && pm->runtime_idle)
 | 
				
			||||||
		return -ENOSYS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (pm->runtime_idle)
 | 
					 | 
				
			||||||
		return pm->runtime_idle(dev);
 | 
							return pm->runtime_idle(dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue