Displaying 12 results from an estimated 12 matches for "pci_get_domain_bus_and_slot".
2017 Nov 27
1
[PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().
Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev
Signed-off-by: Sinan Kaya <okaya at codeaurora.org>
---
dr...
2017 Dec 19
1
[PATCH V4 09/26] drm/nouveau: deprecate pci_get_bus_and_slot()
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().
Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev
Signed-off-by: Sinan Kaya <okaya at codeaurora.org>
---
dr...
2017 Nov 22
0
[PATCH V2 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().
Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev
Signed-off-by: Sinan Kaya <okaya at codeaurora.org>
---
dr...
2017 Nov 27
0
[PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
...:57 AM, Sinan Kaya wrote:
> pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
>
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
>
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from
> 1. struct pci_dev
> 2. struct pci_dev through drm_device->pdev
> 3. struct pci_dev through fb->subdev->drm_device->pdev
>
> Signed-off-by: Sinan Kaya...
2017 Nov 22
0
[PATCH 10/30] drm/nouveau: deprecate pci_get_bus_and_slot()
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.
Signed-off-by: Sinan Kaya <okaya at codeaurora.org>
---
drivers/gpu/drm/nouveau/dispnv04/arb.c | 3 ++-
drivers/gpu/drm/nouveau/dispnv04/hw.c...
2018 Feb 23
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...e PM callbacks may sleep by default
(unless pm_runtime_irq_safe() was called).
> > +static void quirk_gpu_hda(struct pci_dev *hda)
> > +{
> > + struct pci_dev *gpu = NULL;
> > +
> > + if (PCI_FUNC(hda->devfn) != 1)
> > + return;
> > +
> > + gpu = pci_get_domain_bus_and_slot(pci_domain_nr(hda->bus),
>
> Unnecessary initialization.
Thanks for spotting this, it's a remnant of an earlier version of the
patch which called pci_dev_put(gpu) in the (PCI_FUNC(hda->devfn) != 1)
case.
Best regards,
Lukas
2023 Aug 25
0
[PATCH 1/5] PCI: Add the pci_get_base_class() helper
...ed list of struct pci_device_id structures
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 71c85380676c..486ad959e1f9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1180,6 +1180,8 @@ struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
unsigned int devfn);
struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
+struct pci_dev *pci_get_base_class(unsigned int class, struct pci_dev *from);
+
int pci_dev_present(const struct pci_device_id *ids);
int pci_bus_read_config_b...
2018 Feb 20
2
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...t on the HDA controller
> + * to prevent it from permanently keeping the GPU awake.
> + */
> +static void quirk_gpu_hda(struct pci_dev *hda)
> +{
> + struct pci_dev *gpu = NULL;
Unnecessary initialization.
> + if (PCI_FUNC(hda->devfn) != 1)
> + return;
> +
> + gpu = pci_get_domain_bus_and_slot(pci_domain_nr(hda->bus),
> + hda->bus->number,
> + PCI_DEVFN(PCI_SLOT(hda->devfn), 0));
> + if (!gpu || (gpu->class >> 16) != PCI_BASE_CLASS_DISPLAY) {
> + pci_dev_put(gpu);
> + return;
> + }
> +
> + if (!device_link_add(&hda->dev, &...
2023 Aug 25
7
[PATCH 0/5] Add the pci_get_base_class() helper and use it
From: Sui Jingfeng <suijingfeng at loongson.cn>
There is no function that can be used to get all PCI(e) devices in a
system by matching against its the PCI base class code only, while keep
the sub-class code and the programming interface ignored. Therefore, add
the pci_get_base_class() function to suit the need.
For example, if an application want to process all PCI(e) display devices
in a
2018 Feb 18
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...PCI device
+ * if it's hotplugged). Runtime PM is allowed by default on the HDA controller
+ * to prevent it from permanently keeping the GPU awake.
+ */
+static void quirk_gpu_hda(struct pci_dev *hda)
+{
+ struct pci_dev *gpu = NULL;
+
+ if (PCI_FUNC(hda->devfn) != 1)
+ return;
+
+ gpu = pci_get_domain_bus_and_slot(pci_domain_nr(hda->bus),
+ hda->bus->number,
+ PCI_DEVFN(PCI_SLOT(hda->devfn), 0));
+ if (!gpu || (gpu->class >> 16) != PCI_BASE_CLASS_DISPLAY) {
+ pci_dev_put(gpu);
+ return;
+ }
+
+ if (!device_link_add(&hda->dev, &gpu->dev,
+ DL_FLAG_STATEL...
2018 Feb 18
12
[PATCH 0/7] Modernize vga_switcheroo by using device link for HDA
Modernize vga_switcheroo by using a "device link" to enforce a runtime PM
dependency from an HDA controller to the GPU it's integrated into.
Remove thereby obsoleted code and fix a bunch of bugs.
Device links were introduced in v4.10.
Users might see a small power saving if the discrete GPU is in use and
its HDA controller is not, because the HDA controller is now allowed
to runtime
2018 Mar 03
12
[PATCH v2 0/7] Modernize vga_switcheroo by using device link for HDA
Modernize vga_switcheroo by using a device link to enforce a runtime PM
dependency from an HDA controller to the GPU it's integrated into, v2.
Changes since v1:
- Replace patch [1/7] to use pci_save_state() / pci_restore_state()
for consistency between runtime PM code path of bound and unbound
devices. (Rafael, Bjorn)
- Patch [5/7]: Drop an unnecessary initialization. (Bjorn)
Rephrase