Displaying 20 results from an estimated 248 matches for "iounmap".
2010 Jun 05
2
[PATCH] kmmio/mmiotrace: fix double free of kmmio_fault_pages
After every iounmap mmiotrace has to free kmmio_fault_pages, but it
can't do it directly, so it defers freeing by RCU.
It usually works, but when mmiotraced code calls ioremap-iounmap
multiple times without sleeping between (so RCU won't kick in and
start freeing) it can be given the same virtual address, so...
2020 Feb 07
1
[PATCH] drm/cirrus: add drm_driver.release callback.
...+502,16 @@ static void cirrus_mode_config_init(struct cirrus_device *cirrus)
/* ------------------------------------------------------------------ */
+static void cirrus_release(struct drm_device *dev)
+{
+ struct cirrus_device *cirrus = dev->dev_private;
+
+ drm_mode_config_cleanup(dev);
+ iounmap(cirrus->mmio);
+ iounmap(cirrus->vram);
+ kfree(cirrus);
+}
+
DEFINE_DRM_GEM_FOPS(cirrus_fops);
static struct drm_driver cirrus_driver = {
@@ -515,6 +525,7 @@ static struct drm_driver cirrus_driver = {
.fops = &cirrus_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
+ .release = cirrus...
2010 Jun 13
1
[PATCHv2] kmmio/mmiotrace: fix double free of kmmio_fault_pages
After every iounmap mmiotrace has to free kmmio_fault_pages, but it
can't do it directly, so it defers freeing by RCU.
It usually works, but when mmiotraced code calls ioremap-iounmap
multiple times without sleeping between (so RCU won't kick in and
start freeing) it can be given the same virtual address, so...
2020 Feb 10
1
[PATCH v2] drm/cirrus: add drm_driver.release callback.
Move final cleanups from cirrus_pci_remove() to the new callback.
Add drm_atomic_helper_shutdown() call to cirrus_pci_remove().
Set pointers to NULL after iounmap() and check them before using
them to make sure we don't touch released hardware.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
drivers/gpu/drm/cirrus/cirrus.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/c...
2017 Dec 12
4
[PATCHv2] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe/remove paths balanced a
devm_ioremap() with an iounmap() rather than its devm variant. This ends
up corrupting the devm datastructures, and results in the following
boot-time splat on arm64 under QEMU 2.9.0:
[ 3.450397] ------------[ cut here ]------------
[ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844)
[ 3.460534] WARNIN...
2017 Dec 12
4
[PATCHv2] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe/remove paths balanced a
devm_ioremap() with an iounmap() rather than its devm variant. This ends
up corrupting the devm datastructures, and results in the following
boot-time splat on arm64 under QEMU 2.9.0:
[ 3.450397] ------------[ cut here ]------------
[ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844)
[ 3.460534] WARNIN...
2019 Dec 20
0
[PATCH 2/4] drm/cirrus: add drm_driver.release callback.
...+510,16 @@ static void cirrus_mode_config_init(struct cirrus_device *cirrus)
/* ------------------------------------------------------------------ */
+static void cirrus_release(struct drm_device *dev)
+{
+ struct cirrus_device *cirrus = dev->dev_private;
+
+ drm_mode_config_cleanup(dev);
+ iounmap(cirrus->mmio);
+ iounmap(cirrus->vram);
+ kfree(cirrus);
+}
+
DEFINE_DRM_GEM_FOPS(cirrus_fops);
static struct drm_driver cirrus_driver = {
@@ -523,6 +533,7 @@ static struct drm_driver cirrus_driver = {
.fops = &cirrus_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
+ .release = cirrus...
2020 Feb 19
0
[PATCH 31/52] drm/cirrus: Fully embrace devm_
...g_reset(dev);
@@ -609,33 +608,18 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
ret = drm_dev_register(dev, 0);
if (ret)
- goto err_cleanup;
+ return ret;
drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
return 0;
-
-err_cleanup:
- iounmap(cirrus->mmio);
-err_unmap_vram:
- iounmap(cirrus->vram);
-err_dev_put:
- drm_dev_put(dev);
-err_pci_release:
- pci_release_regions(pdev);
- return ret;
}
static void cirrus_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- struct cirrus_device *cirrus...
2020 Mar 13
3
[PATCH RESEND v2 0/2] Fix loading of platform ROM from 32-bit EFI
This patch series fixes an oops when loading the radeon driver on old Macs
with a 32-bit EFI implementation.
Tested on a MacPro 1,1 with a Radeon X1900 XT card and 32-bit kernel.
Changes in v2:
- Add iounmap() call in nouveau
- Update function comment for pci_platform_rom()
- Minor changes to commit messages
Mikel Rychliski (2):
drm/radeon: Stop directly referencing iomem
PCI: Use ioremap(), not phys_to_virt() for platform ROM
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 +
driver...
2017 Dec 12
0
[PATCHv2] virtio_mmio: fix devm cleanup
2017-12-12 21:45 GMT+08:00 Mark Rutland <mark.rutland at arm.com>:
> Recent rework of the virtio_mmio probe/remove paths balanced a
> devm_ioremap() with an iounmap() rather than its devm variant. This ends
> up corrupting the devm datastructures, and results in the following
> boot-time splat on arm64 under QEMU 2.9.0:
>
> [ 3.450397] ------------[ cut here ]------------
> [ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b484...
2017 Dec 12
2
[PATCH] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe path balanced a devm_ioremap()
with an iounmap() rather than its devm variant. This ends up corrupting
the devm datastructures, and results in the following boot failure on
arm64 under QEMU 2.9.0:
[ 3.450397] ------------[ cut here ]------------
[ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844)
[ 3.460534] WARNING:...
2017 Dec 12
2
[PATCH] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe path balanced a devm_ioremap()
with an iounmap() rather than its devm variant. This ends up corrupting
the devm datastructures, and results in the following boot failure on
arm64 under QEMU 2.9.0:
[ 3.450397] ------------[ cut here ]------------
[ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844)
[ 3.460534] WARNING:...
2020 Mar 02
1
[PATCH 30/51] drm/cirrus: Fully embrace devm_
...g_reset(dev);
@@ -609,33 +608,18 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
ret = drm_dev_register(dev, 0);
if (ret)
- goto err_cleanup;
+ return ret;
drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
return 0;
-
-err_cleanup:
- iounmap(cirrus->mmio);
-err_unmap_vram:
- iounmap(cirrus->vram);
-err_dev_put:
- drm_dev_put(dev);
-err_pci_release:
- pci_release_regions(pdev);
- return ret;
}
static void cirrus_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- struct cirrus_device *cirrus...
2020 Mar 17
2
[PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...m - ioremap() the ROM image provided by the platform
> * @pdev: pointer to pci device struct
> * @size: pointer to receive size of pci window over ROM
> + *
> + * Return: kernel virtual pointer to image of ROM
> + *
> + * The caller is responsible for removing the mapping with iounmap()
> */
> void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
> {
> if (pdev->rom && pdev->romlen) {
> *size = pdev->romlen;
> - return phys_to_virt((phys_addr_t)pdev->rom);
> + return ioremap(pdev->rom, pdev->romlen);
> }...
2020 Mar 19
2
[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...y_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
---
Tested on a MacPro 1,1 with a Radeon X1900 XT card and 32-bit kernel.
Changes in v3:
- Inline pci_platform_rom()
Changes in v2:
- Add iounmap() call in nouveau
- Update function comment for pci_platform_rom()
- Minor changes to commit messages
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 31 +++++++++++++---------
.../gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 17 ++++++++++--
drivers/gpu/drm/radeon/radeon_bios.c...
2010 May 16
0
[PATCH v3 1/3] fbdev: allow passing more than one aperture for handoff
...f((struct ttm_buffer_object **)&par->vmw_bo);
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index ecf4055..4a56f46 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -168,7 +168,7 @@ static void efifb_destroy(struct fb_info *info)
{
if (info->screen_base)
iounmap(info->screen_base);
- release_mem_region(info->aperture_base, info->aperture_size);
+ release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
framebuffer_release(info);
}
@@ -292,8 +292,13 @@ static int __devinit efifb_probe(struct platform_de...
2012 Aug 19
1
[PATCH 09/10] drm/nv50/evo: store iomem pointer in properly typed field
...m = object->oclass->ofuncs->rd08;
+ void __iomem *iomem = ((struct evo_object *)object)->iomem;
iowrite32_native(data, iomem + addr);
}
@@ -60,7 +65,7 @@ nv50_evo_channel_del(struct nouveau_channel **pevo)
nouveau_bo_ref(NULL, &evo->push.buffer);
if (evo->object)
- iounmap(evo->object->oclass->ofuncs);
+ iounmap(((struct evo_object *)evo->object)->iomem);
kfree(evo);
}
@@ -112,6 +117,7 @@ nv50_evo_channel_new(struct drm_device *dev, int chid,
struct nouveau_drm *drm = nouveau_drm(dev);
struct nv50_display *disp = nv50_display(dev);
struct n...
2020 Mar 13
0
[PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM
.../amdgpu_bios.c
index 50dff69a0f6e..ea6a1fa98ad9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -207,6 +207,7 @@ static bool amdgpu_read_platform_bios(struct amdgpu_device *adev)
return false;
memcpy_fromio(adev->bios, bios, size);
+ iounmap(bios);
if (!check_atom_bios(adev->bios, size)) {
kfree(adev->bios);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
index 9b91da09dc5f..8a60a0db7b14 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci....
2020 Aug 19
0
[PATCH 04/28] net/au1000-eth: stop using DMA_ATTR_NON_CONSISTENT
...up->dma_addr, 0,
- DMA_ATTR_NON_CONSISTENT);
+ &aup->dma_addr, 0);
if (!aup->vaddr) {
dev_err(&pdev->dev, "failed to allocate data buffers\n");
err = -ENOMEM;
@@ -1310,9 +1309,8 @@ static int au1000_probe(struct platform_device *pdev)
err_remap2:
iounmap(aup->mac);
err_remap1:
- dma_free_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
- (void *)aup->vaddr, aup->dma_addr,
- DMA_ATTR_NON_CONSISTENT);
+ dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
+ (void *)aup->vaddr, aup...
2017 Dec 12
2
[PATCH] virtio_mmio: fix devm cleanup
On Tue, Dec 12, 2017 at 02:09:52PM +0100, Cornelia Huck wrote:
> On Tue, 12 Dec 2017 12:53:02 +0000
> Mark Rutland <mark.rutland at arm.com> wrote:
>
> > Recent rework of the virtio_mmio probe path balanced a devm_ioremap()
> > with an iounmap() rather than its devm variant. This ends up corrupting
> > the devm datastructures, and results in the following boot failure on
> > arm64 under QEMU 2.9.0:
> >
> > [ 3.450397] ------------[ cut here ]------------
> > [ 3.453822] Trying to vfree() nonexistent v...