search for: request_mem_region

Displaying 19 results from an estimated 19 matches for "request_mem_region".

2015 Jun 18
1
[PATCH v2] virtio-pci: alloc only resources actually used.
...erent things to check. request_capability verifies the capability itself only, map_capability has a bunch of additional range checks because it supports partial maps. > I don't see reasons to request regions that we aren't going to > claim ... I had it that way first, simply calling request_mem_region from map_capability. But then you get tons of notify entries in /proc/iomem, and keeping track of the requested regions (for cleanup in virtio_pci_modern_remove) also is more complicated than with a simple set of 4 fixed regions. > > + return request_mem_region(pci_resource_start(dev, bar)...
2015 Jun 18
1
[PATCH v2] virtio-pci: alloc only resources actually used.
...erent things to check. request_capability verifies the capability itself only, map_capability has a bunch of additional range checks because it supports partial maps. > I don't see reasons to request regions that we aren't going to > claim ... I had it that way first, simply calling request_mem_region from map_capability. But then you get tons of notify entries in /proc/iomem, and keeping track of the requested regions (for cleanup in virtio_pci_modern_remove) also is more complicated than with a simple set of 4 fixed regions. > > + return request_mem_region(pci_resource_start(dev, bar)...
2015 Jun 18
1
[PATCH] virtio-pci: alloc only resources actually used.
...> > + &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); > > +} > > + > > For device config, this might request too much. The spec says: > The drivers SHOULD only map part of configuration structure large enough > for device operation. We don't map it h...
2015 Jun 18
1
[PATCH] virtio-pci: alloc only resources actually used.
...> > + &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); > > +} > > + > > For device config, this might request too much. The spec says: > The drivers SHOULD only map part of configuration structure large enough > for device operation. We don't map it h...
2015 Jun 18
2
[PATCH v2] virtio-pci: alloc only resources actually used.
...dev_err(&dev->dev, + "virtio_pci: virtio capability %u@%u " + "out of range on bar %i length %lu\n", + length, offset, bar, + (unsigned long)pci_resource_len(dev, bar)); + return NULL; + } + + if (limit && length > limit) + length = limit; + + return request_mem_region(pci_resource_start(dev, bar) + offset, + length, name); +} + static void __iomem *map_capability(struct pci_dev *dev, int off, size_t minlen, u32 align, @@ -131,10 +162,12 @@ static void __iomem *map_capability(struct pci_dev *dev, int off, } p = pci_iomap_range(dev, b...
2015 Jun 18
2
[PATCH v2] virtio-pci: alloc only resources actually used.
...dev_err(&dev->dev, + "virtio_pci: virtio capability %u@%u " + "out of range on bar %i length %lu\n", + length, offset, bar, + (unsigned long)pci_resource_len(dev, bar)); + return NULL; + } + + if (limit && length > limit) + length = limit; + + return request_mem_region(pci_resource_start(dev, bar) + offset, + length, name); +} + static void __iomem *map_capability(struct pci_dev *dev, int off, size_t minlen, u32 align, @@ -131,10 +162,12 @@ static void __iomem *map_capability(struct pci_dev *dev, int off, } p = pci_iomap_range(dev, b...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
..._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_capability(struct pci_dev *dev, int off, size_t minlen, u32 align, @@ -131,10 +149,12 @@ static void __iomem *map_capability(struct pci_dev *dev, int off, } p = pci_iomap_range(dev, b...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
..._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_capability(struct pci_dev *dev, int off, size_t minlen, u32 align, @@ -131,10 +149,12 @@ static void __iomem *map_capability(struct pci_dev *dev, int off, } p = pci_iomap_range(dev, b...
2015 Jun 16
0
[PATCH] virtio-pci: alloc only resources actually used.
...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); > +} > + For device config, this might request too much. The spec says: The drivers SHOULD only map part of configuration structure large enough for device operation. I think you should limit this to PAGE_SIZE like we do for...
2015 Jun 18
0
[PATCH v2] virtio-pci: alloc only resources actually used.
...imit; > + I'll have to review the above carefully. Hopefully next week. Any reason you didn't just move code out map_capability to a helper, without changes? Would have made review easier. I don't see reasons to request regions that we aren't going to claim ... > + return request_mem_region(pci_resource_start(dev, bar) + offset, > + length, name); Hmm this seems wrong, resource can be IO, not just memory. > +} > + > static void __iomem *map_capability(struct pci_dev *dev, int off, > size_t minlen, > u32 align, > @@ -131,10 +162,12 @@ stat...
2010 Jul 20
2
[PATCH] vga16fb: refuse to load in face of other driver controlling primary card
We don't want vga16fb to mess with hardware initialized by other driver. Detect it and refuse to load. It fixes nouveau interrupt storm on some machines. Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com> --- drivers/video/vga16fb.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index
2019 Apr 03
0
[PATCH] drm/cirrus: rewrite and modernize driver.
...core */ > -static int cirrus_vram_init(struct cirrus_device *cdev) > -{ > - /* BAR 0 is VRAM */ > - cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); > - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); > - > - if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, > - "cirrusdrmfb_vram")) { > - DRM_ERROR("can't reserve VRAM\n"); > - return -ENXIO; > - } > - > - return 0; > -} > - > -/* > - *...
2019 Apr 03
5
[PATCH] drm/cirrus: rewrite and modernize driver.
...- -/* Map the framebuffer from the card and configure the core */ -static int cirrus_vram_init(struct cirrus_device *cdev) -{ - /* BAR 0 is VRAM */ - cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); - - if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, - "cirrusdrmfb_vram")) { - DRM_ERROR("can't reserve VRAM\n"); - return -ENXIO; - } - - return 0; -} - -/* - * Our emulated hardware has two sets of memory. One is video RAM and can - * simply be used as a linear framebuffer...
2019 Apr 03
5
[PATCH] drm/cirrus: rewrite and modernize driver.
...- -/* Map the framebuffer from the card and configure the core */ -static int cirrus_vram_init(struct cirrus_device *cdev) -{ - /* BAR 0 is VRAM */ - cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); - - if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, - "cirrusdrmfb_vram")) { - DRM_ERROR("can't reserve VRAM\n"); - return -ENXIO; - } - - return 0; -} - -/* - * Our emulated hardware has two sets of memory. One is video RAM and can - * simply be used as a linear framebuffer...
2019 Apr 05
1
[PATCH v3 5/5] drm/cirrus: rewrite and modernize driver.
...- -/* Map the framebuffer from the card and configure the core */ -static int cirrus_vram_init(struct cirrus_device *cdev) -{ - /* BAR 0 is VRAM */ - cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); - - if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, - "cirrusdrmfb_vram")) { - DRM_ERROR("can't reserve VRAM\n"); - return -ENXIO; - } - - return 0; -} - -/* - * Our emulated hardware has two sets of memory. One is video RAM and can - * simply be used as a linear framebuffer...
2019 Apr 04
1
[PATCH v2 6/6] drm/cirrus: rewrite and modernize driver.
...- -/* Map the framebuffer from the card and configure the core */ -static int cirrus_vram_init(struct cirrus_device *cdev) -{ - /* BAR 0 is VRAM */ - cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); - - if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, - "cirrusdrmfb_vram")) { - DRM_ERROR("can't reserve VRAM\n"); - return -ENXIO; - } - - return 0; -} - -/* - * Our emulated hardware has two sets of memory. One is video RAM and can - * simply be used as a linear framebuffer...
2011 Jun 02
0
[PATCH] pci: Use pr_<level> and pr_fmt
...nsigned long long)pci_resource_len(hc_dev, 1)); + dbg("hc_dev = %p\n", hc_dev); + dbg("pci resource start %llx\n", + (unsigned long long)pci_resource_start(hc_dev, 1)); + dbg("pci resource len %llx\n", + (unsigned long long)pci_resource_len(hc_dev, 1)); if(!request_mem_region(pci_resource_start(hc_dev, 1), pci_resource_len(hc_dev, 1), MY_NAME)) { - err("cannot reserve MMIO region"); + pr_err("cannot reserve MMIO region\n"); ret = -ENOMEM; goto exit_disable_device; } @@ -108,9 +108,9 @@ static int zt5550_hc_config(struct pci_dev *pdev)...
2011 Jun 02
0
[PATCH] pci: Use pr_<level> and pr_fmt
...nsigned long long)pci_resource_len(hc_dev, 1)); + dbg("hc_dev = %p\n", hc_dev); + dbg("pci resource start %llx\n", + (unsigned long long)pci_resource_start(hc_dev, 1)); + dbg("pci resource len %llx\n", + (unsigned long long)pci_resource_len(hc_dev, 1)); if(!request_mem_region(pci_resource_start(hc_dev, 1), pci_resource_len(hc_dev, 1), MY_NAME)) { - err("cannot reserve MMIO region"); + pr_err("cannot reserve MMIO region\n"); ret = -ENOMEM; goto exit_disable_device; } @@ -108,9 +108,9 @@ static int zt5550_hc_config(struct pci_dev *pdev)...
2011 Jun 02
0
[PATCH] pci: Use pr_<level> and pr_fmt
...nsigned long long)pci_resource_len(hc_dev, 1)); + dbg("hc_dev = %p\n", hc_dev); + dbg("pci resource start %llx\n", + (unsigned long long)pci_resource_start(hc_dev, 1)); + dbg("pci resource len %llx\n", + (unsigned long long)pci_resource_len(hc_dev, 1)); if(!request_mem_region(pci_resource_start(hc_dev, 1), pci_resource_len(hc_dev, 1), MY_NAME)) { - err("cannot reserve MMIO region"); + pr_err("cannot reserve MMIO region\n"); ret = -ENOMEM; goto exit_disable_device; } @@ -108,9 +108,9 @@ static int zt5550_hc_config(struct pci_dev *pdev)...