Displaying 20 results from an estimated 161 matches for "pci_read_config_dword".
2017 Nov 27
1
[PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
...rm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
(dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
+ int domain = pci_domain_nr(dev->pdev->bus);
- pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+ pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+ 0x7c, &type);
sim_data.memory_type = (type >> 12) & 1;
sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/...
2017 Dec 19
1
[PATCH V4 09/26] drm/nouveau: deprecate pci_get_bus_and_slot()
...rm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
(dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
+ int domain = pci_domain_nr(dev->pdev->bus);
- pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+ pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+ 0x7c, &type);
sim_data.memory_type = (type >> 12) & 1;
sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/...
2017 Nov 22
0
[PATCH 10/30] drm/nouveau: deprecate pci_get_bus_and_slot()
...ivers/gpu/drm/nouveau/dispnv04/arb.c
index 90075b6..729d7d0 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -214,7 +214,8 @@ struct nv_sim_state {
(dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
- pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+ pci_read_config_dword(pci_get_domain_bus_and_slot(0, 0, 1),
+ 0x7c, &type);
sim_data.memory_type = (type >> 12) & 1;
sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouve...
2017 Nov 22
0
[PATCH V2 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
...rm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
(dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
+ u32 domain = pci_domain_nr(dev->pdev->bus);
- pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+ pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+ 0x7c, &type);
sim_data.memory_type = (type >> 12) & 1;
sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/...
2017 Nov 27
0
[PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
...213,8 +213,10 @@ struct nv_sim_state {
> if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
> (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
> uint32_t type;
> + int domain = pci_domain_nr(dev->pdev->bus);
>
> - pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
> + pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
> + 0x7c, &type);
>
> sim_data.memory_type = (type >> 12) & 1;
> sim_data.memory_width = 64;
> diff --git a/drivers/gpu/drm/nouveau/di...
2015 Jun 18
1
[PATCH] virtio-pci: alloc only resources actually used.
...st_capability(struct pci_dev *dev, int off,
> > + const char *name)
> > +{
> > + u8 bar;
> > + u32 offset, length;
> > +
> > + pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
> > + bar),
> > + &bar);
> > + pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
> > + &offset);
> > + pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
> > + &length);
> > +
> > + return request_mem_region(pci_resource_start(dev, bar) + offset,
>...
2015 Jun 18
1
[PATCH] virtio-pci: alloc only resources actually used.
...st_capability(struct pci_dev *dev, int off,
> > + const char *name)
> > +{
> > + u8 bar;
> > + u32 offset, length;
> > +
> > + pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
> > + bar),
> > + &bar);
> > + pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
> > + &offset);
> > + pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
> > + &length);
> > +
> > + return request_mem_region(pci_resource_start(dev, bar) + offset,
>...
2020 Aug 19
0
[PATCH v3 04/18] virtio: Implement get_shm_region for PCI transport
...g_byte(dev, pos + offsetof(struct virtio_pci_cap,
+ id), &id);
+ if (id != required_id)
+ continue;
+
+ /* Type, and ID match, looks good */
+ pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
+ bar), bar);
+
+ /* Read the lower 32bit of length and offset */
+ pci_read_config_dword(dev, pos + offsetof(struct virtio_pci_cap,
+ offset), &tmp32);
+ res_offset = tmp32;
+ pci_read_config_dword(dev, pos + offsetof(struct virtio_pci_cap,
+ length), &tmp32);
+ res_length = tmp32;
+
+ /* and now the top half */
+ pci_read_config_dword(dev,
+ pos +...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
..._twopart(u64 val,
vp_iowrite32(val >> 32, hi);
}
+static struct resource *request_capability(struct pci_dev *dev, int off,
+ const char *name)
+{
+ u8 bar;
+ u32 offset, length;
+
+ pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
+ bar),
+ &bar);
+ pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
+ &offset);
+ pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
+ &length);
+
+ return request_mem_region(pci_resource_start(dev, bar) + offset,
+ length, name);
+}
+
static void __iomem *map_ca...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
..._twopart(u64 val,
vp_iowrite32(val >> 32, hi);
}
+static struct resource *request_capability(struct pci_dev *dev, int off,
+ const char *name)
+{
+ u8 bar;
+ u32 offset, length;
+
+ pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
+ bar),
+ &bar);
+ pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
+ &offset);
+ pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
+ &length);
+
+ return request_mem_region(pci_resource_start(dev, bar) + offset,
+ length, name);
+}
+
static void __iomem *map_ca...
2008 Aug 12
0
SR-IOV: patches are available for Linux kernel [1/4]
...PCI_ROM_RESOURCE) {
- if (!(res->flags & IORESOURCE_ROM_ENABLE))
- return;
- new |= PCI_ROM_ADDRESS_ENABLE;
- reg = dev->rom_base_reg;
- } else {
- /* Hmm, non-standard resource. */
-
- return; /* kill uninitialised var warning */
- }
-
- pci_write_config_dword(dev, reg, new);
- pci_read_config_dword(dev, reg, &check);
+ pci_write_config_dword(dev, pos, new);
+ pci_read_config_dword(dev, pos, &check);
if ((new ^ check) & mask) {
- dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n",
- resno, new, check);
+ dev_err(&dev->dev, "BAR at %d...
2008 Aug 12
0
SR-IOV: patches are available for Linux kernel [1/4]
...PCI_ROM_RESOURCE) {
- if (!(res->flags & IORESOURCE_ROM_ENABLE))
- return;
- new |= PCI_ROM_ADDRESS_ENABLE;
- reg = dev->rom_base_reg;
- } else {
- /* Hmm, non-standard resource. */
-
- return; /* kill uninitialised var warning */
- }
-
- pci_write_config_dword(dev, reg, new);
- pci_read_config_dword(dev, reg, &check);
+ pci_write_config_dword(dev, pos, new);
+ pci_read_config_dword(dev, pos, &check);
if ((new ^ check) & mask) {
- dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n",
- resno, new, check);
+ dev_err(&dev->dev, "BAR at %d...
2008 Aug 12
0
SR-IOV: patches are available for Linux kernel [1/4]
...PCI_ROM_RESOURCE) {
- if (!(res->flags & IORESOURCE_ROM_ENABLE))
- return;
- new |= PCI_ROM_ADDRESS_ENABLE;
- reg = dev->rom_base_reg;
- } else {
- /* Hmm, non-standard resource. */
-
- return; /* kill uninitialised var warning */
- }
-
- pci_write_config_dword(dev, reg, new);
- pci_read_config_dword(dev, reg, &check);
+ pci_write_config_dword(dev, pos, new);
+ pci_read_config_dword(dev, pos, &check);
if ((new ^ check) & mask) {
- dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n",
- resno, new, check);
+ dev_err(&dev->dev, "BAR at %d...
2018 Sep 12
3
[PATCH v2] PCI: Reprogram bridge prefetch registers on resume
...i.c
+++ b/drivers/pci/pci.c
@@ -1289,13 +1289,15 @@ int pci_save_state(struct pci_dev *dev)
EXPORT_SYMBOL(pci_save_state);
static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
- u32 saved_val, int retry)
+ u32 saved_val, int retry, bool force)
{
u32 val;
- pci_read_config_dword(pdev, offset, &val);
- if (val == saved_val)
- return;
+ if (!force) {
+ pci_read_config_dword(pdev, offset, &val);
+ if (val == saved_val)
+ return;
+ }
for (;;) {
pci_dbg(pdev, "restoring config space at offset %#x (was %#x, writing %#x)\n",
@@ -1313,25 +1315,34 @@ s...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...dev_warn(&dev->dev,
> + "Virtio device lacks common or pci cfg.\n");
Whitespace
> + return -ENODEV;
> + }
> +
> + pci_read_config_byte(dev, common + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + pci_read_config_dword(dev, common + offsetof(struct virtio_pci_cap,
> + offset),
> + &offset);
> +
> + /* Program cfg capability for dword access into common cfg. */
> + pci_write_config_byte(dev, cfg + offsetof(struct virtio_pci_cfg_cap,
> + cap.bar),
> + bar);
&g...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...dev_warn(&dev->dev,
> + "Virtio device lacks common or pci cfg.\n");
Whitespace
> + return -ENODEV;
> + }
> +
> + pci_read_config_byte(dev, common + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + pci_read_config_dword(dev, common + offsetof(struct virtio_pci_cap,
> + offset),
> + &offset);
> +
> + /* Program cfg capability for dword access into common cfg. */
> + pci_write_config_byte(dev, cfg + offsetof(struct virtio_pci_cfg_cap,
> + cap.bar),
> + bar);
&g...
2017 Jan 20
0
[PATCH] nv1a,nv1f/disp: fix memory clock rate retrieval
...(+), 1 deletion(-)
diff --git a/drm/nouveau/dispnv04/hw.c b/drm/nouveau/dispnv04/hw.c
index 48ad4be..b985990 100644
--- a/drm/nouveau/dispnv04/hw.c
+++ b/drm/nouveau/dispnv04/hw.c
@@ -222,6 +222,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
uint32_t mpllP;
pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
+ mpllP = (mpllP >> 8) & 0xf;
if (!mpllP)
mpllP = 4;
@@ -232,7 +233,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
uint32_t clock;
pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &...
2009 Aug 10
1
[RFC] drm/nouveau: optimize code emission of inline functions
[This email is either empty or too large to be displayed at this time]
2015 Jan 20
0
[PATCH 01/05] fixup! virtio_pci: modern driver
...dev, int off,
u32 start, u32 size,
size_t *len)
{
- u8 type_and_bar, bar;
+ u8 bar;
u32 offset, length;
void __iomem *p;
pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
- type_and_bar),
- &type_and_bar);
+ bar),
+ &bar);
pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
&offset);
pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
@@ -76,9 +76,6 @@ static void __iomem *map_capability(struct pci_dev *dev, int off,
if (len)
*len = length;
- bar = (type_and_bar >> VI...
2015 Jan 20
0
[PATCH 01/05] fixup! virtio_pci: modern driver
...dev, int off,
u32 start, u32 size,
size_t *len)
{
- u8 type_and_bar, bar;
+ u8 bar;
u32 offset, length;
void __iomem *p;
pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap,
- type_and_bar),
- &type_and_bar);
+ bar),
+ &bar);
pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, offset),
&offset);
pci_read_config_dword(dev, off + offsetof(struct virtio_pci_cap, length),
@@ -76,9 +76,6 @@ static void __iomem *map_capability(struct pci_dev *dev, int off,
if (len)
*len = length;
- bar = (type_and_bar >> VI...