PCI: Generalize multi-function power dependency device links
authorAbhishek Sahu <abhsahu@nvidia.com>
Thu, 6 Jun 2019 09:22:24 +0000 (14:52 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 13 Jun 2019 20:52:37 +0000 (15:52 -0500)
commita17beb1a0882a544523dcb5d0da4801272dfd43a
tree8f528d6278a085ba44c6b1c772794d60f883b2aa
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9
PCI: Generalize multi-function power dependency device links

Although not allowed by the PCI specs, some multi-function devices have
power dependencies between the functions.  For example, function 1 may not
work unless function 0 is in the D0 power state.

The existing quirk_gpu_hda() adds a device link to express this dependency
for GPU and HDA devices, but it really is not specific to those device
types.

Generalize it and rename it to pci_create_device_link() so we can create
dependencies between any "consumer" and "producer" functions of a
multi-function device, where the consumer is only functional if the
producer is in D0.  This reorganization should not affect any
functionality.

Link: https://lore.kernel.org/lkml/20190606092225.17960-2-abhsahu@nvidia.com
Signed-off-by: Abhishek Sahu <abhsahu@nvidia.com>
[bhelgaas: commit log, reword diagnostic]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/quirks.c