search for: dev_index

Displaying 20 results from an estimated 24 matches for "dev_index".

Did you mean: dac_index
2011 Apr 05
1
[PATCH] virtio: decrement dev_index when device is unregistered
When virtio device is removed, dev_index does not get decremented. The next device hotplug event results in consuming the next pci to the one that is suppose to be available. Signed-off-by: Takuma Umeya <tumeya at redhat.com> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index efb35aa..67fe71d 100644 --- a/driv...
2011 Apr 05
1
[PATCH] virtio: decrement dev_index when device is unregistered
When virtio device is removed, dev_index does not get decremented. The next device hotplug event results in consuming the next pci to the one that is suppose to be available. Signed-off-by: Takuma Umeya <tumeya at redhat.com> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index efb35aa..67fe71d 100644 --- a/driv...
2020 Nov 03
4
[PATCH 0/3] drm/nouveau: fix a use-after-free in postclose()
This series fixes a number of use-after-frees in nouveau's postclose() handler. It was discovered by pointing IGT's core_hotunplug tests at a nouveau device, but the steps to reproduce it are simple: 1. Open the device file 2. Unbind the driver or remove the device 3. Close the file opened in step 1. During the device removal, the nouveau_drm structure is de-allocated, but is
2012 May 03
1
[PATCH 2/2] virtio: Use ida to allocate virtio index
...1..f355807 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -2,9 +2,10 @@ #include <linux/spinlock.h> #include <linux/virtio_config.h> #include <linux/module.h> +#include <linux/idr.h> /* Unique numbering for virtio devices. */ -static unsigned int dev_index; +static DEFINE_IDA(virtio_index_ida); static ssize_t device_show(struct device *_d, struct device_attribute *attr, char *buf) @@ -193,7 +194,11 @@ int register_virtio_device(struct virtio_device *dev) dev->dev.bus = &virtio_bus; /* Assign a unique device index and hence name...
2012 May 03
1
[PATCH 2/2] virtio: Use ida to allocate virtio index
...1..f355807 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -2,9 +2,10 @@ #include <linux/spinlock.h> #include <linux/virtio_config.h> #include <linux/module.h> +#include <linux/idr.h> /* Unique numbering for virtio devices. */ -static unsigned int dev_index; +static DEFINE_IDA(virtio_index_ida); static ssize_t device_show(struct device *_d, struct device_attribute *attr, char *buf) @@ -193,7 +194,11 @@ int register_virtio_device(struct virtio_device *dev) dev->dev.bus = &virtio_bus; /* Assign a unique device index and hence name...
2007 Nov 10
1
[PATCH] virtio_pci updates
...(info->n_pages)); + kfree(info->queue); kfree(info); } @@ -348,10 +358,13 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, if (vp_dev == NULL) return -ENOMEM; - vp_dev->pci_dev = pci_dev; + snprintf(vp_dev->vdev.dev.bus_id, BUS_ID_SIZE, "virtio%d", dev_index); + vp_dev->vdev.index = dev_index; + dev_index++; + vp_dev->vdev.dev.parent = &virtio_pci_root; - vp_dev->vdev.index = dev_index++; vp_dev->vdev.config = &virtio_pci_config_ops; + vp_dev->pci_dev = pci_dev; INIT_LIST_HEAD(&vp_dev->virtqueues); spin_lock_init(&...
2007 Nov 10
1
[PATCH] virtio_pci updates
...(info->n_pages)); + kfree(info->queue); kfree(info); } @@ -348,10 +358,13 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, if (vp_dev == NULL) return -ENOMEM; - vp_dev->pci_dev = pci_dev; + snprintf(vp_dev->vdev.dev.bus_id, BUS_ID_SIZE, "virtio%d", dev_index); + vp_dev->vdev.index = dev_index; + dev_index++; + vp_dev->vdev.dev.parent = &virtio_pci_root; - vp_dev->vdev.index = dev_index++; vp_dev->vdev.config = &virtio_pci_config_ops; + vp_dev->pci_dev = pci_dev; INIT_LIST_HEAD(&vp_dev->virtqueues); spin_lock_init(&...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 05/13] [Mostly resend] virtio additions
...s. I think it + * would make more sense for virtio to not insist on having it's own device. */ +static struct device virtio_pci_root = { + .parent = NULL, + .bus_id = "virtio-pci", +}; + +/* Unique numbering for devices under the kvm root */ +static unsigned int dev_index; + +/* Convert a generic virtio device to our structure */ +static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) +{ + return container_of(vdev, struct virtio_pci_device, vdev); +} + +/* virtio config->feature() implementation */ +static bool vp_feature(struct virtio_devic...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 05/13] [Mostly resend] virtio additions
...s. I think it + * would make more sense for virtio to not insist on having it's own device. */ +static struct device virtio_pci_root = { + .parent = NULL, + .bus_id = "virtio-pci", +}; + +/* Unique numbering for devices under the kvm root */ +static unsigned int dev_index; + +/* Convert a generic virtio device to our structure */ +static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) +{ + return container_of(vdev, struct virtio_pci_device, vdev); +} + +/* virtio config->feature() implementation */ +static bool vp_feature(struct virtio_devic...
2008 Jan 08
1
[PATCH] kvm guest balloon driver
...try */ { 0x1AF4, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dummy entry */ + { 0x1AF4, 0x1003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Balloon */ { 0 }, }; @@ -89,12 +76,6 @@ static struct device virtio_pci_root = { /* Unique numbering for devices under the kvm root */ static unsigned int dev_index; -/* Convert a generic virtio device to our structure */ -static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) -{ - return container_of(vdev, struct virtio_pci_device, vdev); -} - /* virtio config->feature() implementation */ static bool vp_feature(struct virtio_device *...
2008 Jan 08
1
[PATCH] kvm guest balloon driver
...try */ { 0x1AF4, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dummy entry */ + { 0x1AF4, 0x1003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Balloon */ { 0 }, }; @@ -89,12 +76,6 @@ static struct device virtio_pci_root = { /* Unique numbering for devices under the kvm root */ static unsigned int dev_index; -/* Convert a generic virtio device to our structure */ -static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) -{ - return container_of(vdev, struct virtio_pci_device, vdev); -} - /* virtio config->feature() implementation */ static bool vp_feature(struct virtio_device *...
2008 Mar 20
2
[RFC/PATCH 15/15] guest: virtio device support, and kvm hypercalls
...> +#include <asm/kvm_para.h> +#include <asm/setup.h> +#include <asm/s390_ext.h> + +#include "kvm_virtio.h" + +/* + * The pointer to our (page) of device descriptions. + */ +static void *kvm_devices; + +/* + * Unique numbering for kvm devices. + */ +static unsigned int dev_index; + +struct kvm_device { + struct virtio_device vdev; + struct kvm_device_desc *desc; +}; + +#define to_kvmdev(vd) container_of(vd, struct kvm_device, vdev) + +/* + * memory layout: + * - kvm_device_descriptor + * struct kvm_device_desc + * - configuration + * struct kvm_vqconfig + * -...
2008 Mar 20
2
[RFC/PATCH 15/15] guest: virtio device support, and kvm hypercalls
...> +#include <asm/kvm_para.h> +#include <asm/setup.h> +#include <asm/s390_ext.h> + +#include "kvm_virtio.h" + +/* + * The pointer to our (page) of device descriptions. + */ +static void *kvm_devices; + +/* + * Unique numbering for kvm devices. + */ +static unsigned int dev_index; + +struct kvm_device { + struct virtio_device vdev; + struct kvm_device_desc *desc; +}; + +#define to_kvmdev(vd) container_of(vd, struct kvm_device, vdev) + +/* + * memory layout: + * - kvm_device_descriptor + * struct kvm_device_desc + * - configuration + * struct kvm_vqconfig + * -...
2018 Feb 18
0
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...} if (bus->chip_init) { @@ -2197,6 +2201,7 @@ static int azx_probe_continue(struct azx *chip) struct hda_intel *hda = container_of(chip, struct hda_intel, chip); struct hdac_bus *bus = azx_bus(chip); struct pci_dev *pci = chip->pci; + struct hda_codec *codec; int dev = chip->dev_index; int err; @@ -2278,8 +2283,17 @@ static int azx_probe_continue(struct azx *chip) chip->running = 1; azx_add_card_list(chip); + + /* + * The discrete GPU cannot power down unless the HDA controller runtime + * suspends, so activate runtime PM on codecs even if power_save == 0. + */ +...
2018 Feb 20
2
[PATCH 5/7] vga_switcheroo: Use device link for HDA controller
...) { > @@ -2197,6 +2201,7 @@ static int azx_probe_continue(struct azx *chip) > struct hda_intel *hda = container_of(chip, struct hda_intel, chip); > struct hdac_bus *bus = azx_bus(chip); > struct pci_dev *pci = chip->pci; > + struct hda_codec *codec; > int dev = chip->dev_index; > int err; > > @@ -2278,8 +2283,17 @@ static int azx_probe_continue(struct azx *chip) > > chip->running = 1; > azx_add_card_list(chip); > + > + /* > + * The discrete GPU cannot power down unless the HDA controller runtime > + * suspends, so activate run...
2008 Dec 10
6
[PATCH 0/6] Clean up virtio device object handling [was Re: [PATCH] virtio: make PCI devices take a virtio_pci module ref]
(Moved from kvm at vger to virtualization at linux-foundation, changed subject, cleaned up cc list) On Wed, 2008-12-10 at 13:02 +0100, Kay Sievers wrote: > On Wed, Dec 10, 2008 at 10:49, Mark McLoughlin <markmc at redhat.com> wrote: > > On Tue, 2008-12-09 at 19:16 +0100, Kay Sievers wrote: > >> On Tue, Dec 9, 2008 at 17:41, Mark McLoughlin <markmc at redhat.com>
2008 Dec 10
6
[PATCH 0/6] Clean up virtio device object handling [was Re: [PATCH] virtio: make PCI devices take a virtio_pci module ref]
(Moved from kvm at vger to virtualization at linux-foundation, changed subject, cleaned up cc list) On Wed, 2008-12-10 at 13:02 +0100, Kay Sievers wrote: > On Wed, Dec 10, 2008 at 10:49, Mark McLoughlin <markmc at redhat.com> wrote: > > On Tue, 2008-12-09 at 19:16 +0100, Kay Sievers wrote: > >> On Tue, Dec 9, 2008 at 17:41, Mark McLoughlin <markmc at redhat.com>
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
2024 Oct 04
2
[PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
Hello everyone, This set will switch the users of pm_runtime_put_autosuspend() to __pm_runtime_put_autosuspend() while the former will soon be re-purposed to include a call to pm_runtime_mark_last_busy(). The two are almost always used together, apart from bugs which are likely common. Going forward, most new users should be using pm_runtime_put_autosuspend(). Once this conversion is done and
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