Displaying 20 results from an estimated 187 matches for "to_pci_dev".
2020 Nov 24
1
[PATCH 09/15] drm/nouveau: Remove references to struct drm_device.pdev
...t; uint8_t sub = bios->data[bios->fp.xlated_entry + script] + (bios->fp.link_c_increment && dcbent->or & DCB_OUTPUT_C ? 1 : 0);
> uint16_t scriptofs = ROM16(bios->data[bios->init_script_tbls_ptr + sub * 2]);
> +#ifdef __powerpc__
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> +#endif
Or
int device = 0;
>
> if (!bios->fp.xlated_entry || !sub || !scriptofs)
> return -EINVAL;
> @@ -123,8 +126,8 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_outp
> #ifdef __powerpc__
> /* Powerbook specific q...
2020 Mar 06
1
[PATCH 00/14] iommu: Move iommu_fwspec out of 'struct device'
...ed.
>
> I tested this patch set on Kunpeng 920 ARM64 server which
> using smmu-v3 with ACPI booting, but triggered a NULL
> pointer dereference and panic at boot:
I think that's because patch 01/14 move the fwspec access too early. In
err = pci_for_each_dma_alias(to_pci_dev(dev),
iort_pci_iommu_init, &info);
if (!err && iort_pci_rc_supports_ats(node))
dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
the iommu_fwspec is only valid if iort_pci_iommu_init() initia...
2012 Mar 29
5
[PATCH 0/5] virtio: S3 support, use PM API macro for init
Hello,
Turns out S3 is not different from S4 for virtio devices: the device
is assumed to be reset, so the host and guest state are to be assumed
to be out of sync upon resume. We handle the S4 case with exactly the
same scenario, so just point the suspend/resume routines to the
freeze/restore ones.
Once that is done, we also use the PM API's macro to initialise the
sleep functions.
A
2012 Mar 29
5
[PATCH 0/5] virtio: S3 support, use PM API macro for init
Hello,
Turns out S3 is not different from S4 for virtio devices: the device
is assumed to be reset, so the host and guest state are to be assumed
to be out of sync upon resume. We handle the S4 case with exactly the
same scenario, so just point the suspend/resume routines to the
freeze/restore ones.
Once that is done, we also use the PM API's macro to initialise the
sleep functions.
A
2019 Jul 23
1
[PATCH] drm/qxl: Use dev_get_drvdata where possible
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96 at gmail.com>
---
drivers/gpu/drm/qxl/qxl_drv.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index...
2020 Dec 01
1
[PATCH v2 04/20] drm/bochs: Remove references to struct drm_device.pdev
...rs/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -110,7 +110,7 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
int bochs_hw_init(struct drm_device *dev)
{
struct bochs_device *bochs = dev->dev_private;
- struct pci_dev *pdev = dev->pdev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
unsigned long addr, size, mem, ioaddr, iosize;
u16 id;
@@ -201,7 +201,7 @@ void bochs_hw_fini(struct drm_device *dev)
release_region(VBE_DISPI_IOPORT_INDEX, 2);
if (bochs->fb_map)
iounmap(bochs->fb_map);
- pci_release_regions(dev->pdev);
+ pci_release_regions(to...
2019 Nov 20
2
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
...8+.
I don't remember if this happens only with nouveau or with the
proprietary driver as well but looking at the nouveau runtime PM suspend
hook (assuming I'm looking at the correct code):
static int
nouveau_pmops_runtime_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
int ret;
if (!nouveau_pmops_runtime()) {
pm_runtime_forbid(dev);
return -EBUSY;
}
nouveau_switcheroo_optimus_dsm();
ret = nouveau_do_suspend(drm_dev, true);...
2019 Jul 23
0
[PATCH] drm/nouveau: Use dev_get_drvdata where possible
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96 at gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouv...
2019 Jul 23
0
[PATCH] drm/bochs: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96 at gmail.com>
---
drivers/gpu/drm/bochs/bochs_drv.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_...
2019 May 07
2
[PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
...; }
> diff --git a/drm/nouveau/nouveau_drm.c b/drm/nouveau/nouveau_drm.c
> index 5020265b..405efda2 100644
> --- a/drm/nouveau/nouveau_drm.c
> +++ b/drm/nouveau/nouveau_drm.c
> @@ -903,6 +903,7 @@ nouveau_pmops_runtime_suspend(struct device *dev)
> {
> struct pci_dev *pdev = to_pci_dev(dev);
> struct drm_device *drm_dev = pci_get_drvdata(pdev);
> + struct nouveau_drm *drm = nouveau_drm(drm_dev);
> int ret;
>
> if (!nouveau_pmops_runtime()) {
> @@ -910,12 +911,15 @@ nouveau_pmops_runtime_suspend(struct device *dev)
> return -EBUSY;
> }
>
&...
2020 Dec 01
1
[PATCH v2 14/20] drm/qxl: Remove references to struct drm_device.pdev
...rm/qxl/qxl_drv.c
index 6e7f16f4cec7..fb5f6a5e81d7 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -163,7 +163,7 @@ DEFINE_DRM_GEM_FOPS(qxl_fops);
static int qxl_drm_freeze(struct drm_device *dev)
{
- struct pci_dev *pdev = dev->pdev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct qxl_device *qdev = to_qxl(dev);
int ret;
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index 16e1e589508e..b6075f452b9e 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -370,13 +370,14 @@ static int qxl...
2020 Dec 01
1
[PATCH v2 14/20] drm/qxl: Remove references to struct drm_device.pdev
...rm/qxl/qxl_drv.c
index 6e7f16f4cec7..fb5f6a5e81d7 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -163,7 +163,7 @@ DEFINE_DRM_GEM_FOPS(qxl_fops);
static int qxl_drm_freeze(struct drm_device *dev)
{
- struct pci_dev *pdev = dev->pdev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct qxl_device *qdev = to_qxl(dev);
int ret;
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index 16e1e589508e..b6075f452b9e 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -370,13 +370,14 @@ static int qxl...
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...nd
"virtio" type then we can use the ops for both the case of VM and
containers.
>>
>>
>>> +
>>> +static int ifcvf_init_msix(struct ifcvf_adapter *adapter)
>>> +{
>>> +??? int vector, i, ret, irq;
>>> +??? struct pci_dev *pdev = to_pci_dev(adapter->dev);
>>> +??? struct ifcvf_hw *vf = &adapter->vf;
>>> +
>>> +??? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
>>> +??????????? IFCVF_MAX_INTR, PCI_IRQ_MSIX);
>>> +??? if (ret < 0) {
>>> +??????? IFC_ERR(adapter->de...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...key to make kernel virtio
driver to work.
And in the new version of virito-mdev, features like _F_LOG_ALL should
be advertised through get_mdev_features.
> +
> +static int ifcvf_init_msix(struct ifcvf_adapter *adapter)
> +{
> + int vector, i, ret, irq;
> + struct pci_dev *pdev = to_pci_dev(adapter->dev);
> + struct ifcvf_hw *vf = &adapter->vf;
> +
> + ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
> + IFCVF_MAX_INTR, PCI_IRQ_MSIX);
> + if (ret < 0) {
> + IFC_ERR(adapter->dev, "Failed to alloc irq vectors.\n");
> + return ret;
>...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...set_config = ifcvf_mdev_set_config,
> + .get_mdev_features = ifcvf_mdev_get_mdev_features,
set_config_cb needs to be implemented since you claim to support VIRTIO_NET_F_STATUS.
> +};
> +
> +static int ifcvf_init_msix(struct ifcvf_adapter *adapter)
> +{
> + struct pci_dev *pdev = to_pci_dev(adapter->dev);
> + struct ifcvf_hw *vf = &adapter->vf;
> + int vector, i, ret, irq;
> +
> + ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
> + IFCVF_MAX_INTR, PCI_IRQ_MSIX);
> + if (ret < 0) {
> + IFC_ERR(adapter->dev, "Failed to alloc irq vector...
2018 Nov 24
1
[PATCH 2/2] drm/nouveau: Grab an rpm reference before/after DP AUX transactions
...drivers/gpu/drm/nouveau/nouveau_drm.c
> index 2b2baf6e0e0d..4323e9e61c2e 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -859,6 +859,7 @@ nouveau_pmops_runtime_suspend(struct device *dev)
> {
> struct pci_dev *pdev = to_pci_dev(dev);
> struct drm_device *drm_dev = pci_get_drvdata(pdev);
> + struct nouveau_drm *drm = nouveau_drm(drm_dev);
> int ret;
>
> if (!nouveau_pmops_runtime()) {
> @@ -866,6 +867,8 @@ nouveau_pmops_runtime_suspend(struct device *dev)
>...
2014 Sep 23
5
[PATCH RFC] virtio_pci: fix virtio spec compliance on restore
...2 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 58f7e45..58cbf6e 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -785,6 +785,7 @@ static int virtio_pci_restore(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_driver *drv;
+ unsigned status = 0;
int ret;
drv = container_of(vp_dev->vdev.dev.driver,
@@ -795,14 +796,41 @@ static int virtio_pci_restore(struct device *dev)
return ret;
pci_set_master(pci_dev);...
2014 Sep 23
5
[PATCH RFC] virtio_pci: fix virtio spec compliance on restore
...2 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 58f7e45..58cbf6e 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -785,6 +785,7 @@ static int virtio_pci_restore(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_driver *drv;
+ unsigned status = 0;
int ret;
drv = container_of(vp_dev->vdev.dev.driver,
@@ -795,14 +796,41 @@ static int virtio_pci_restore(struct device *dev)
return ret;
pci_set_master(pci_dev);...
2020 Apr 14
0
[PATCH v2 19/33] iommu/s390: Convert to probe/release_device() call-backs
...66,14 @@ static void s390_iommu_detach_device(struct iommu_domain *domain,
}
}
-static int s390_iommu_add_device(struct device *dev)
+static struct iommu_device *s390_iommu_probe_device(struct device *dev)
{
- struct iommu_group *group = iommu_group_get_for_dev(dev);
struct zpci_dev *zdev = to_pci_dev(dev)->sysdata;
- if (IS_ERR(group))
- return PTR_ERR(group);
-
- iommu_group_put(group);
- iommu_device_link(&zdev->iommu_dev, dev);
-
- return 0;
+ return &zdev->iommu_dev;
}
-static void s390_iommu_remove_device(struct device *dev)
+static void s390_iommu_release_device(str...
2015 Apr 01
2
[PATCH v2 4/4] Add virtio-vga bits.
...iver, struct virtio_device *vdev)
{
struct drm_device *dev;
@@ -48,8 +68,16 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
dev->virtdev = vdev;
vdev->priv = dev;
- if (strcmp(vdev->dev.parent->bus->name, "pci") == 0)
- dev->pdev = to_pci_dev(vdev->dev.parent);
+ if (strcmp(vdev->dev.parent->bus->name, "pci") == 0) {
+ struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
+ bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
+
+ DRM_INFO("pci: %s detected\n",
+ vga ? "virtio-vga&...