search for: pci_dev_put

Displaying 20 results from an estimated 40 matches for "pci_dev_put".

2016 Jul 20
0
[PATCH] GPU-DRM-nouveau: Delete an unnecessary check before the function call "pci_dev_put"
From: Markus Elfring <elfring at users.sourceforge.net> Date: Wed, 20 Jul 2016 19:43:27 +0200 The pci_dev_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring at users.sourceforge.net> --- drivers/gpu/drm/nouveau/nouveau_drm.c | 3...
2013 Jul 24
4
[PATCH] [RFC] drm/nouveau: bring back hdmi audio device after switcheroo power down
...quot;hdmi device not found %d %d %d\n", pdev->bus->number, PCI_SLOT(pdev->devfn), 1); + return; + } + + if ((drm->hdmi_device->class >> 8) != PCI_CLASS_MULTIMEDIA_HD_AUDIO) { + DRM_INFO("possible hdmi device not audio %d\n", drm->hdmi_device->class); + pci_dev_put(drm->hdmi_device); + drm->hdmi_device = NULL; + return; + } +} + static int nouveau_drm_load(struct drm_device *dev, unsigned long flags) { @@ -314,6 +339,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) INIT_LIST_HEAD(&drm->clients); spin_lock_init(&drm-...
2013 Jul 24
0
[PATCH] [RFC] drm/nouveau: bring back hdmi audio device after switcheroo power down
...%d %d\n", pdev->bus->number, PCI_SLOT(pdev->devfn), 1); > + return; > + } > + > + if ((drm->hdmi_device->class >> 8) != PCI_CLASS_MULTIMEDIA_HD_AUDIO) { > + DRM_INFO("possible hdmi device not audio %d\n", drm->hdmi_device->class); > + pci_dev_put(drm->hdmi_device); > + drm->hdmi_device = NULL; > + return; > + } > +} > + > static int > nouveau_drm_load(struct drm_device *dev, unsigned long flags) > { > @@ -314,6 +339,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) > INIT_LIST_HEAD...
2023 Aug 25
1
[PATCH 2/5] ALSA: hda/intel: Use pci_get_base_class() to reduce duplicated code
...dle, atpx_handle; acpi_status status; - while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { - dhandle = ACPI_HANDLE(&pdev->dev); - if (dhandle) { - status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); - if (ACPI_SUCCESS(status)) { - pci_dev_put(pdev); - return true; - } - } - } - while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { + while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) { + if ((pdev->class != PCI_CLASS_DISPLAY_VGA << 8) && + (pdev->class != PCI_CLA...
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...able_virtfn(struct hotplug_slot *slot) +{ + int rc; + u8 busnr, devfn; + struct pci_dev *dev; + struct virtfn_slot *vslot = slot->private; + + get_addr(vslot->dev, vslot->id, &busnr, &devfn); + + mutex_lock(&iov_lock); + dev = pci_get_bus_and_slot(busnr, devfn); + if (dev) { + pci_dev_put(dev); + rc = -EINVAL; + goto out; + } + + rc = notify(vslot->dev, PCI_IOV_VF_ENABLE, + vslot->id, vslot->slot->info->param); + if (rc) + goto out; + + rc = alloc_virtfn(vslot->dev, vslot->id); + if (!rc) + slot->info->power_status = 1; +out: + mutex_unlock(&...
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...able_virtfn(struct hotplug_slot *slot) +{ + int rc; + u8 busnr, devfn; + struct pci_dev *dev; + struct virtfn_slot *vslot = slot->private; + + get_addr(vslot->dev, vslot->id, &busnr, &devfn); + + mutex_lock(&iov_lock); + dev = pci_get_bus_and_slot(busnr, devfn); + if (dev) { + pci_dev_put(dev); + rc = -EINVAL; + goto out; + } + + rc = notify(vslot->dev, PCI_IOV_VF_ENABLE, + vslot->id, vslot->slot->info->param); + if (rc) + goto out; + + rc = alloc_virtfn(vslot->dev, vslot->id); + if (!rc) + slot->info->power_status = 1; +out: + mutex_unlock(&...
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...able_virtfn(struct hotplug_slot *slot) +{ + int rc; + u8 busnr, devfn; + struct pci_dev *dev; + struct virtfn_slot *vslot = slot->private; + + get_addr(vslot->dev, vslot->id, &busnr, &devfn); + + mutex_lock(&iov_lock); + dev = pci_get_bus_and_slot(busnr, devfn); + if (dev) { + pci_dev_put(dev); + rc = -EINVAL; + goto out; + } + + rc = notify(vslot->dev, PCI_IOV_VF_ENABLE, + vslot->id, vslot->slot->info->param); + if (rc) + goto out; + + rc = alloc_virtfn(vslot->dev, vslot->id); + if (!rc) + slot->info->power_status = 1; +out: + mutex_unlock(&...
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 20
2
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...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_STATELESS | DL_FLAG_PM_RUNTIME)) > + pci_err(hda, "cannot add device link to %s\n", pci_name(gpu)); > + > + pm_runtime_allow(&hda->dev); > + pci_...
2018 Feb 18
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...+ 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_STATELESS | DL_FLAG_PM_RUNTIME)) + pci_err(hda, "cannot add device link to %s\n", pci_name(gpu)); + + pm_runtime_allow(&hda->dev); + pci_dev_put(gpu); +} +DECLARE_PCI_FIXUP_CLASS_FIN...
2018 Feb 23
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...; > > + > > + 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 5/5] drm/radeon: Use pci_get_base_class() to reduce duplicated code
...<< 8, pdev)) != NULL) { - dhandle = ACPI_HANDLE(&pdev->dev); - if (!dhandle) - continue; - - status = acpi_get_handle(dhandle, "ATRM", &atrm_handle); - if (ACPI_SUCCESS(status)) { - found = true; - break; - } - } - } - if (!found) return false; pci_dev_put(pdev); -- 2.34.1
2014 Feb 13
1
[PATCH 1/2] drm/nouveau: make hdmi device finding failure prints debug level
...); return; } if ((drm->hdmi_device->class >> 8) != PCI_CLASS_MULTIMEDIA_HD_AUDIO) { - DRM_INFO("possible hdmi device not audio %d\n", drm->hdmi_device->class); + nv_debug(drm, "possible hdmi device not audio %d\n", drm->hdmi_device->class); pci_dev_put(drm->hdmi_device); drm->hdmi_device = NULL; return; @@ -340,7 +339,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) INIT_LIST_HEAD(&drm->clients); spin_lock_init(&drm->tile.lock); - nouveau_get_hdmi_dev(dev); + nouveau_get_hdmi_dev(drm); /* make...
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
2008 Dec 25
0
[PATCH 2/4] dom0 linux: Add "guestdev=" boot parameter.
...it pci_check_guestdev_path_exists( + struct guestdev *gdev, struct pci_bus *bus) +{ + struct guestdev_node *node; + struct pci_dev *dev; + + node = gdev->child; + while (node) { + if (!bus) + return FALSE; + dev = pci_get_slot(bus, PCI_DEVFN(node->dev, node->func)); + if (!dev) { + pci_dev_put(dev); + return FALSE; + } + bus = dev->subordinate; + node = node->child; + pci_dev_put(dev); + } + return TRUE; +} + +/* Check whether the guestdev exists in the PCI device tree */ +static int __init pci_check_guestdev_exists(void) +{ + struct list_head *head; + struct guestdev *gdev;...
2013 Jul 24
2
[acooks@gmail.com: Re: [RFC PATCH v2 1/2] pci: Create PCIe requester ID interface]
...e to search > again for where that requester ID is rooted. > >> > +{ >> > + struct pci_dev *requester = requestee; >> > + >> > + while (requester != bridge) { >> > + requester = pci_get_dma_source(requester); >> > + pci_dev_put(requester); /* XXX skip ref cnt */ >> > + >> > + if (pci_has_visible_pcie_requester_id(requester, bridge)) >> >> If we acquire the "requester" pointer via a ref-counting interface, >> it's illegal to use the pointer after dropping the refe...
2012 Jan 05
22
[PATCH] Support Function Level Reset (FLR) in the xen-pciback module (v1) and some fixes.
The attached patches allow the pciback module to perform a reset whenever a PCI device is: - attached to the pciback module, as so: echo "0000:01.07.0" > /sys/bus/pci/devices/pciback/bind - detached from the pciback module, as so: echo "0000:01.07.0" > /sys/bus/pci/devices/pciback/unbind - and when the guest is done with (internally when the guest is not using
2011 Feb 28
12
[RFC PATCH] set current_state to D0 in register_slot
....c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -212,6 +212,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) pdev = pci_get_slot(pbus, PCI_DEVFN(device, function)); if (pdev) { + pdev->current_state = PCI_D0; slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); pci_dev_put(pdev); } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
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
2012 Jan 25
4
Fwd: BUG in linux+v3.2.1/drivers/xen/xen-pciback/pci_stub.c
First, maintainer''s addresses (Ryan Wilson <hap9@epoch.ncsc.mil>, Chris Bookholt <hap10@epoch.ncsc.mil>) are wrong (users unknown to remote mailsystem), so posting to you: PCI bus format strings are wrong. "%04x:%02x:%02x.%d" should be used instead of "%04x:%02x:%02x.%1x" (in many places of linux+v3.2.1/drivers/xen/xen-pciback/pci_stub.c) --