]> Git Repo - linux.git/commitdiff
Merge branch 'pci/pwrctl'
authorBjorn Helgaas <[email protected]>
Mon, 25 Nov 2024 19:40:54 +0000 (13:40 -0600)
committerBjorn Helgaas <[email protected]>
Mon, 25 Nov 2024 19:40:54 +0000 (13:40 -0600)
- Use of_platform_device_create() instead of of_platform_populate() to
  create pwrctl platform devices so we can control it based on the child
  nodes (Manivannan Sadhasivam)

- Create pwrctrl platform devices only if there's a relevant power supply
  property (Manivannan Sadhasivam)

- Add device link from the pwrctl supplier to the PCI dev to ensure pwrctl
  drivers are probed before the PCI dev driver; this avoids a race where
  pwrctl could change device power state while the PCI driver was active
  (Manivannan Sadhasivam)

- Find pwrctl device for removal with of_find_device_by_node() instead of
  searching all children of the parent (Manivannan Sadhasivam)

- Rename 'pwrctl' to 'pwrctrl' to use the same 'ctrl' suffix as 'bwctrl'
  and other PCI files to reduce confusion (Bjorn Helgaas)

* pci/pwrctl:
  PCI/pwrctrl: Rename pwrctrl functions and structures
  PCI/pwrctrl: Rename pwrctl files to pwrctrl
  PCI/pwrctl: Remove pwrctl device without iterating over all children of pwrctl parent
  PCI/pwrctl: Ensure that pwrctl drivers are probed before PCI client drivers
  PCI/pwrctl: Create pwrctl device only if at least one power supply is present
  PCI/pwrctl: Use of_platform_device_create() to create pwrctl devices

# Conflicts:
# drivers/pci/bus.c
# drivers/pci/remove.c

1  2 
MAINTAINERS
drivers/pci/bus.c
drivers/pci/pci.h
drivers/pci/remove.c

diff --cc MAINTAINERS
Simple merge
index d015d5821cefce9bc8eac6fb7a7cafecdbc6ef29,0d27809746df05908af11669d058d0c25ce8a2b2..98910bc0fcc4e5f6b9cf233ced5316754e66555f
@@@ -358,15 -407,7 +417,7 @@@ void pci_bus_add_device(struct pci_dev 
        if (retval < 0 && retval != -EPROBE_DEFER)
                pci_warn(dev, "device attach failed (%d)\n", retval);
  
 -      pci_dev_assign_added(dev, true);
 +      pci_dev_assign_added(dev);
-       if (dev_of_node(&dev->dev) && pci_is_bridge(dev)) {
-               retval = of_platform_populate(dev_of_node(&dev->dev), NULL, NULL,
-                                             &dev->dev);
-               if (retval)
-                       pci_err(dev, "failed to populate child OF nodes (%d)\n",
-                               retval);
-       }
  }
  EXPORT_SYMBOL_GPL(pci_bus_add_device);
  
Simple merge
index 1f35945459fd70d6f76e3cef2b725a1c3897364f,27ef371a8443ea50b4a7ab710ecdfa0673b8d750..963b8d2855c1abd7b89a691d0af36f4e5375e7ff
@@@ -33,15 -33,15 +33,14 @@@ static void pci_stop_dev(struct pci_de
  {
        pci_pme_active(dev, false);
  
 -      if (pci_dev_is_added(dev)) {
 -              pci_pwrctrl_unregister(&dev->dev);
 -              device_release_driver(&dev->dev);
 -              pci_proc_detach_device(dev);
 -              pci_remove_sysfs_dev_files(dev);
 -              of_pci_remove_node(dev);
 +      if (!pci_dev_test_and_clear_added(dev))
 +              return;
  
-       device_for_each_child(dev->dev.parent, dev_of_node(&dev->dev),
-                             pci_pwrctl_unregister);
 -              pci_dev_assign_added(dev, false);
 -      }
++      pci_pwrctrl_unregister(&dev->dev);
 +      device_release_driver(&dev->dev);
 +      pci_proc_detach_device(dev);
 +      pci_remove_sysfs_dev_files(dev);
 +      of_pci_remove_node(dev);
  }
  
  static void pci_destroy_dev(struct pci_dev *dev)
This page took 0.079018 seconds and 4 git commands to generate.