search for: pci_restore_state

Displaying 20 results from an estimated 71 matches for "pci_restore_state".

2013 Aug 29
6
[PATCH 2/3 v3] Refactor MSI restore call-chain to drop unnecessary argument
...nd is 1 after msix_capability_init. Based on above, it''s Xen''s duty to restore entry->msi_attrib.masked to device, but with current code, entry->masked is used and MSI-x interrupt is masked. Before patch, restore call graph under initial domain: pci_reset_function-> pci_restore_state-> __pci_restore_msix_state-> arch_restore_msi_irqs-> xen_initdom_restore_msi_irqs-> PHYSDEVOP_restore_msi hypercall (first mask restore) msix_mask_irq(entry, entry->masked) (second mask restore) So msix_mask_irq...
2017 Nov 21
2
[PATCH v2] drm: don't continue with anything after the GPU couldn't be woken up
...truct pci_dev *pdev) +{ + struct nouveau_drm *drm = nouveau_drm(pci_get_drvdata(pdev)); + int ret; + + pci_set_power_state(pdev, PCI_D0); + /* abort if anything went wrong */ + if (pdev->current_state != PCI_D0) { + NV_ERROR(drm, "couldn't wake up GPU!\n"); + return -EBUSY; + } + pci_restore_state(pdev); + ret = pci_enable_device(pdev); + if (ret) + return ret; + + pci_set_master(pdev); + return 0; +} + int nouveau_pmops_resume(struct device *dev) { @@ -803,12 +824,9 @@ nouveau_pmops_resume(struct device *dev) drm_dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF) retur...
2012 Oct 18
1
PCI device not properly reset after VFIO
Hi Alex, I've been playing around with VFIO and megasas (of course). What I did now was switching between VFIO and 'normal' operation, ie emulated access. megasas is happily running under VFIO, but when I do an emergency stop like killing the Qemu session the PCI device is not properly reset. IE when I load 'megaraid_sas' after unbinding the vfio_pci module the driver
2012 Oct 18
1
PCI device not properly reset after VFIO
Hi Alex, I've been playing around with VFIO and megasas (of course). What I did now was switching between VFIO and 'normal' operation, ie emulated access. megasas is happily running under VFIO, but when I do an emergency stop like killing the Qemu session the PCI device is not properly reset. IE when I load 'megaraid_sas' after unbinding the vfio_pci module the driver
2019 May 07
2
[PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
...t; @@ -933,7 +938,9 @@ nouveau_pmops_runtime_resume(struct device *dev) > return -EBUSY; > } > > - pci_set_power_state(pdev, PCI_D0); > + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > + if (drm->runpm_dsm) > + pci_set_power_state(pdev, PCI_D0); > pci_restore_state(pdev); > ret = pci_enable_device(pdev); > if (ret) > diff --git a/drm/nouveau/nouveau_drv.h b/drm/nouveau/nouveau_drv.h > index da847244..941600e9 100644 > --- a/drm/nouveau/nouveau_drv.h > +++ b/drm/nouveau/nouveau_drv.h > @@ -214,6 +214,8 @@ struct nouveau_drm { > st...
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
2018 Feb 20
2
[PATCH 1/7] PCI: Restore BARs on runtime resume despite being unbound
...he HDA controller's BARs will be > uninitialized when a driver later probes it. > > Fix by restoring the BARs on runtime resume if the device is not bound. > This is sufficient to fix the above-mentioned use cases. Other use > cases might require a full-blown pci_save_state() / pci_restore_state() > or execution of fixups. We can add that once use cases materialize, > let's not inflate the code unnecessarily. Why would we not do a full-blown restore? With this patch, I think some configuration done during enumeration, e.g., ASPM and MPS, will be lost. "lspci -vv" of...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...irtio/virtio_pci.c @@ -698,8 +698,42 @@ static int virtio_pci_suspend(struct pci_dev *pci_dev, pm_message_t state) static int virtio_pci_resume(struct pci_dev *pci_dev) { + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_pci_vq_info *info; + unsigned long flags; + pci_restore_state(pci_dev); pci_set_power_state(pci_dev, PCI_D0); + + iowrite32(vp_dev->vdev.features[0], vp_dev->ioaddr+VIRTIO_PCI_GUEST_FEATURES); + if (vp_dev->msix_used_vectors) + iowrite16(vp_dev->msix_used_vectors, + vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR); + + spin_lock_irqsave(&v...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...irtio/virtio_pci.c @@ -698,8 +698,42 @@ static int virtio_pci_suspend(struct pci_dev *pci_dev, pm_message_t state) static int virtio_pci_resume(struct pci_dev *pci_dev) { + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_pci_vq_info *info; + unsigned long flags; + pci_restore_state(pci_dev); pci_set_power_state(pci_dev, PCI_D0); + + iowrite32(vp_dev->vdev.features[0], vp_dev->ioaddr+VIRTIO_PCI_GUEST_FEATURES); + if (vp_dev->msix_used_vectors) + iowrite16(vp_dev->msix_used_vectors, + vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR); + + spin_lock_irqsave(&v...
2018 Jun 06
2
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...apability? Currently I'm not familiar with the PM part. But I still think the sriov capability should be handled by PCI core. I'm trying to understand all the relevant code.. For your question, based on what I found from the code currently, I guess the sriov capability will be restored by pci_restore_state() which will be called by the ops in pci_dev_pm_ops. The sriov_restore_state() will be called eventually. Best regards, Tiwei Bie > > > > > I also wonder about kexec - virtio.c currently does: > > > > > > /* We always start by resetting the device, in...
2018 Nov 24
1
[PATCH 2/2] drm/nouveau: Grab an rpm reference before/after DP AUX transactions
...drm(drm_dev)->client.device; > int ret; > > @@ -889,11 +895,13 @@ nouveau_pmops_runtime_resume(struct device *dev) > return -EBUSY; > } > > + drm->rpm_task = current; > + > pci_set_power_state(pdev, PCI_D0); > pci_restore_state(pdev); > ret = pci_enable_device(pdev); > if (ret) > - return ret; > + goto out; > pci_set_master(pdev); > > ret = nouveau_do_resume(drm_dev, true); > @@ -905,6 +913,8 @@ nouveau_pmops_runtime_resume(struct device *...
2018 Jun 06
2
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...> > OK but the point is restore looks just like power up for device. > > > I'm trying to understand > > all the relevant code.. > > For your question, based on what I found from > > the code currently, I guess the sriov capability > > will be restored by pci_restore_state() which > > will be called by the ops in pci_dev_pm_ops. > > The sriov_restore_state() will be called > > eventually. > > > > Best regards, > > Tiwei Bie > > Right but my point is during resume SRIOV gets enabled first before > driver ok. > > Ma...
2017 Nov 16
0
[RFC] drm: don't continue with anything after the GPU couldn't be woken up
...uveau_pmops_runtime()) { @@ -880,6 +881,11 @@ nouveau_pmops_runtime_resume(struct device *dev) } pci_set_power_state(pdev, PCI_D0); + /* abort if anything went wrong */ + if (pdev->current_state != PCI_D0) { + NV_ERROR(drm, "couldn't wake up GPU!\n"); + return -EBUSY; + } pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) -- 2.14.3
2017 Nov 21
0
[PATCH v2] drm: don't continue with anything after the GPU couldn't be woken up
...+ if (pdev->current_state != PCI_D0) { > + NV_ERROR(drm, "couldn't wake up GPU!\n"); > + return -EBUSY; > + } Looks to me like the more idiomatic way to do this is: ret = pci_set_power_state(pdev, PCI_D0); if (ret < 0 && ret != -EIO) return ret; > + pci_restore_state(pdev); > + ret = pci_enable_device(pdev); > + if (ret) > + return ret; > + > + pci_set_master(pdev); Looking closer it also seems like pci_enable_device() will already set the power state to D0 (via do_pci_enable_device()). Is the sequence above really necessary because the hardwar...
2018 Jul 16
0
[PATCH 1/5] drm/nouveau: Prevent RPM callback recursion in suspend/resume paths
...CI_D3cold); drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; + + dev->power.disable_depth--; return ret; } @@ -859,11 +863,13 @@ nouveau_pmops_runtime_resume(struct device *dev) return -EBUSY; } + dev->power.disable_depth++; + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) - return ret; + goto out; pci_set_master(pdev); ret = nouveau_do_resume(drm_dev, true); @@ -875,6 +881,8 @@ nouveau_pmops_runtime_resume(struct device *dev) /* Monitors may have been connected / disconnected during suspend */ schedule_w...
2019 May 04
0
[PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
...t ret; if (!nouveau_pmops_runtime()) { @@ -933,7 +938,9 @@ nouveau_pmops_runtime_resume(struct device *dev) return -EBUSY; } - pci_set_power_state(pdev, PCI_D0); + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; + if (drm->runpm_dsm) + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) diff --git a/drm/nouveau/nouveau_drv.h b/drm/nouveau/nouveau_drv.h index da847244..941600e9 100644 --- a/drm/nouveau/nouveau_drv.h +++ b/drm/nouveau/nouveau_drv.h @@ -214,6 +214,8 @@ struct nouveau_drm { struct nouveau_svm *svm; struct nouvea...
2019 May 07
0
[PATCH v2 1/4] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
...t ret; if (!nouveau_pmops_runtime()) { @@ -933,7 +939,9 @@ nouveau_pmops_runtime_resume(struct device *dev) return -EBUSY; } - pci_set_power_state(pdev, PCI_D0); + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; + if (drm->runpm_dsm) + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) diff --git a/drm/nouveau/nouveau_drv.h b/drm/nouveau/nouveau_drv.h index da847244..941600e9 100644 --- a/drm/nouveau/nouveau_drv.h +++ b/drm/nouveau/nouveau_drv.h @@ -214,6 +214,8 @@ struct nouveau_drm { struct nouveau_svm *svm; struct nouvea...
2018 Mar 03
0
[PATCH v2 1/7] PCI: Restore config space on runtime resume despite being unbound
...Bjorn Helgaas <bhelgaas at google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com> [lukas: add commit message, bikeshed code comments for clarity] Signed-off-by: Lukas Wunner <lukas at wunner.de> --- Changes since v1: - Replace patch to use pci_save_state() / pci_restore_state() for consistency between runtime PM code path of bound and unbound devices. (Rafael, Bjorn) drivers/pci/pci-driver.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 3bed6beda051..6a67cdbd0e6a 100...
2018 Feb 18
0
[PATCH 1/7] PCI: Restore BARs on runtime resume despite being unbound
...time suspend to D3cold, the HDA controller's BARs will be uninitialized when a driver later probes it. Fix by restoring the BARs on runtime resume if the device is not bound. This is sufficient to fix the above-mentioned use cases. Other use cases might require a full-blown pci_save_state() / pci_restore_state() or execution of fixups. We can add that once use cases materialize, let's not inflate the code unnecessarily. Cc: Bjorn Helgaas <bhelgaas at google.com> Cc: Rafael J. Wysocki <rafael.j.wysocki at intel.com> Signed-off-by: Lukas Wunner <lukas at wunner.de> --- drivers/pci/...
2019 Jun 14
0
[PATCH] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
...SWITCH_POWER_DYNAMIC_OFF; return ret; } @@ -941,7 +946,9 @@ nouveau_pmops_runtime_resume(struct device *dev) return -EBUSY; } - pci_set_power_state(pdev, PCI_D0); + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; + if (drm->runpm_dsm) + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) diff --git a/drm/nouveau/nouveau_drv.h b/drm/nouveau/nouveau_drv.h index e6665354..1e437612 100644 --- a/drm/nouveau/nouveau_drv.h +++ b/drm/nouveau/nouveau_drv.h @@ -216,6 +216,8 @@ struct nouveau_drm { struct nouveau_svm *svm; struct nouvea...