Displaying 20 results from an estimated 153 matches for "ioresource_mem".
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...r);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* If common is th...
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...r);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* If common is th...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...r);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* If common is th...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...r);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* If common is th...
2019 Dec 23
7
[PATCH 1/6] iommu/omap: convert to devm_platform_ioremap_resource
...struct device_node *of = pdev->dev.of_node;
struct orphan_dev *orphan_dev, *tmp;
@@ -1218,8 +1217,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
spin_lock_init(&obj->iommu_lock);
spin_lock_init(&obj->page_table_lock);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- obj->regbase = devm_ioremap_resource(obj->dev, res);
+ obj->regbase = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(obj->regbase))
return PTR_ERR(obj->regbase);
--
2.17.1
2019 Dec 23
7
[PATCH 1/6] iommu/omap: convert to devm_platform_ioremap_resource
...struct device_node *of = pdev->dev.of_node;
struct orphan_dev *orphan_dev, *tmp;
@@ -1218,8 +1217,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
spin_lock_init(&obj->iommu_lock);
spin_lock_init(&obj->page_table_lock);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- obj->regbase = devm_ioremap_resource(obj->dev, res);
+ obj->regbase = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(obj->regbase))
return PTR_ERR(obj->regbase);
--
2.17.1
2008 Oct 08
8
[PATCH] dom0 linux: Reassign memory resources to device for pci passthrough.
...v(dev)) {
+ printk(KERN_INFO
+ "PCI: Disable device and release resources"
+ " [%s].\n", pci_name(dev));
+ pci_disable_device(dev);
+
+ for (i=0; i < PCI_NUM_RESOURCES; i++) {
+ r = &dev->resource[i];
+ if ((r == NULL) ||
+ !(r->flags & IORESOURCE_MEM))
+ continue;
+
+ r->end = r->end - r->start;
+ r->start = 0;
+
+ if (i < PCI_BRIDGE_RESOURCES) {
+ pci_update_resource(dev, r, i);
+ } else if (i == 8 || i == 9) {
+ /* need to update(clear) the Base/Limit
+ * register also, because PCI bridge is
+...
2013 Sep 26
0
Resource map sanity check fails after GRUB "keeps" the gfx mode
...ion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 22513e9..b7bb615 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -79,7 +79,7 @@ __init int create_simplefb(const struct screen_info *si,
/* setup IORESOURCE_MEM as framebuffer memory */
memset(&res, 0, sizeof(res));
- res.flags = IORESOURCE_MEM;
+ res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
res.name = simplefb_resname;
res.start = si->lfb_base;
res.end = si->lfb_base + len - 1;
--
Regards,
Pavel Roskin
2020 Jul 01
3
[PATCH 2/2] virtio-mmio: Reject invalid IRQ 0 command line argument
...+ * sscanf() must process at least 2 chunks; also there
* must be no extra characters after the last chunk, so
* str[consumed] must be '\0'
*/
- if (processed < 2 || str[consumed])
+ if (processed < 2 || str[consumed] || irq == 0)
return -EINVAL;
resources[0].flags = IORESOURCE_MEM;
--
2.25.1
2020 Jul 01
3
[PATCH 2/2] virtio-mmio: Reject invalid IRQ 0 command line argument
...+ * sscanf() must process at least 2 chunks; also there
* must be no extra characters after the last chunk, so
* str[consumed] must be '\0'
*/
- if (processed < 2 || str[consumed])
+ if (processed < 2 || str[consumed] || irq == 0)
return -EINVAL;
resources[0].flags = IORESOURCE_MEM;
--
2.25.1
2014 Jun 24
0
[PATCH 1/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()
...s machine supports legacy memory map. */
>
> + if (!vga_default_device()) {
> + resource_size_t start, end;
> + int i;
> +
> + /* Does firmware framebuffer belong to us? */
> + for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
> + if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
> + continue;
> +
> + start = pci_resource_start(pdev, i);
> + end = pci_resource_end(pdev, i);
> +
> + if (!start || !end)
> + continue;
> +
> + if (screen_info.lfb_base >= start &&
> + (screen_info.lfb_base + screen_info.lfb_size) <...
2019 Dec 22
1
[PATCH] virtio-mmio: convert to devm_platform_ioremap_resource
...drivers/virtio/virtio_mmio.c
@@ -531,18 +531,9 @@ static void virtio_mmio_release_dev(struct device *_d)
static int virtio_mmio_probe(struct platform_device *pdev)
{
struct virtio_mmio_device *vm_dev;
- struct resource *mem;
unsigned long magic;
int rc;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!mem)
- return -EINVAL;
-
- if (!devm_request_mem_region(&pdev->dev, mem->start,
- resource_size(mem), pdev->name))
- return -EBUSY;
-
vm_dev = devm_kzalloc(&pdev->dev, sizeof(*vm_dev), GFP_KERNEL);
if (!vm_dev)
return -ENOMEM;
@@ -554,9 +545,9 @@ static in...
2020 Aug 03
1
[PATCH] virtio_pci_modern: Fix the comment of virtio_pci_find_capability()
...x db93cedd262f..9bdc6f68221f 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -481,6 +481,7 @@ static const struct virtio_config_ops virtio_pci_config_ops = {
* @dev: the pci device
* @cfg_type: the VIRTIO_PCI_CAP_* value we seek
* @ioresource_types: IORESOURCE_MEM and/or IORESOURCE_IO.
+ * @bars: the bitmask of BARs
*
* Returns offset of the capability, or 0.
*/
--
2.26.1
2014 Dec 11
1
[PATCH RFC 3/5] pci: add pci_iomap_range
On Thursday 11 December 2014 21:37:34 Michael S. Tsirkin wrote:
> if (flags & IORESOURCE_MEM) {
> - if (flags & IORESOURCE_CACHEABLE)
> + if (!force_nocache && (flags & IORESOURCE_CACHEABLE))
> return ioremap(start, len);
> return ioremap_nocache(start, len);
> }
>
ioremap is the...
2014 Dec 11
1
[PATCH RFC 3/5] pci: add pci_iomap_range
On Thursday 11 December 2014 21:37:34 Michael S. Tsirkin wrote:
> if (flags & IORESOURCE_MEM) {
> - if (flags & IORESOURCE_CACHEABLE)
> + if (!force_nocache && (flags & IORESOURCE_CACHEABLE))
> return ioremap(start, len);
> return ioremap_nocache(start, len);
> }
>
ioremap is the...
2014 Feb 10
0
[PATCH] drm/nouveau: support for platform devices
...+nv_device_resource_start(struct nouveau_device *device, unsigned int bar)
> +{
> + if (nv_device_is_pci(device)) {
> + return pci_resource_start(device->pdev, bar);
> + } else {
> + struct resource *res;
> + res = platform_get_resource(device->platformdev,
> + IORESOURCE_MEM, bar);
> + if (!res)
> + return 0;
> + return res->start;
> + }
> +}
> +
> +resource_size_t
> +nv_device_resource_len(struct nouveau_device *device, unsigned int bar)
> +{
> + if (nv_device_is_pci(device)) {
> + return pci_resource_len(device->pdev, bar);...
2013 Sep 26
2
Resource map sanity check fails after GRUB "keeps" the gfx mode
Hello!
I'm getting this backtrace every time I boot:
resource map sanity check conflict: 0xf0000000 0xf1ffffff 0xf1000000
0xf112bfff BOOTFB ------------[ cut here ]------------
WARNING: CPU: 6 PID: 1
at /home/proskin/src/linux/arch/x86/mm/ioremap.c:171
__ioremap_caller+0x372/0x380() Info: mapping multiple BARs. Your kernel
is fine. Modules linked in: CPU: 6 PID: 1 Comm: swapper/0 Not tainted
2014 Dec 30
0
[PATCH RFC v2 5/7] virtio_pci: modern driver
...ures,
+ .finalize_features = vp_finalize_features,
+ .bus_name = vp_bus_name,
+ .set_vq_affinity = vp_set_vq_affinity,
+};
+
+/**
+ * virtio_pci_find_capability - walk capabilities to find device info.
+ * @dev: the pci device
+ * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
+ * @ioresource_types: IORESOURCE_MEM and/or IORESOURCE_IO.
+ *
+ * Returns offset of the capability, or 0.
+ */
+static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type,
+ u32 ioresource_types)
+{
+ int pos;
+
+ for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+ pos > 0;
+ pos = pci_fin...
2014 Dec 30
0
[PATCH RFC v2 5/7] virtio_pci: modern driver
...ures,
+ .finalize_features = vp_finalize_features,
+ .bus_name = vp_bus_name,
+ .set_vq_affinity = vp_set_vq_affinity,
+};
+
+/**
+ * virtio_pci_find_capability - walk capabilities to find device info.
+ * @dev: the pci device
+ * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
+ * @ioresource_types: IORESOURCE_MEM and/or IORESOURCE_IO.
+ *
+ * Returns offset of the capability, or 0.
+ */
+static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type,
+ u32 ioresource_types)
+{
+ int pos;
+
+ for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+ pos > 0;
+ pos = pci_fin...
2014 Dec 11
6
[PATCH RFC 0/5] virtio_pci: modern driver
Based on Rusty's patches.
Coding style and funny jokes are his.
Bugs and a star wars reference (should be easy to spot) are mine.
Untested, but useful as basis for beginning the qemu work.
TODO:
= simplify probing: use a common probe function, probe with modern driver
first, if that fails - probe with legacy driver.
BUGS: ATM legacy driver can win and drive a transitional device