[PATCH v3] drm/radeon: Fix NULL dereference when updating memory stats

2021-06-24 Thread Mikel Rychliski
stead of embedding it v2") Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_object.c | 29 - drivers/gpu/drm/radeon/radeon_object.h | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c| 13 ++--- 3 files changed, 23 insertions(+), 21 deletion

Re: [PATCH v2] drm/radeon: Fix NULL dereference when updating memory stats

2021-06-24 Thread Mikel Rychliski
On Wednesday, June 23, 2021 2:55:04 AM EDT Christian König wrote: > Please rather keep the new resource as parameter here and update before > adjusting bo->resource. > > This way you also don't need to export radeon_update_memory_usage(). I wasn't sure exactly what you intended with the request t

[PATCH v2] drm/radeon: Fix NULL dereference when updating memory stats

2021-06-22 Thread Mikel Rychliski
stead of embedding it v2") Signed-off-by: Mikel Rychliski --- v2: Update statistics on ghost object destroy drivers/gpu/drm/radeon/radeon_object.c | 33 - drivers/gpu/drm/radeon/radeon_object.h | 7 --- drivers/gpu/drm/radeon/radeon_ttm

[PATCH] drm/radeon: Fix NULL dereference when updating memory stats

2021-06-21 Thread Mikel Rychliski
stead of embedding it v2") Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_object.c | 23 +++ drivers/gpu/drm/radeon/radeon_object.h | 7 --- drivers/gpu/drm/radeon/radeon_ttm.c| 20 +--- 3 files changed, 24 insertions(+), 26

[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM

2020-03-18 Thread Mikel Rychliski
omio() instead of kmemdup(). pci_platform_rom() now has no remaining callers, so remove it. Signed-off-by: Mikel Rychliski --- 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

Re: [PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM

2020-03-18 Thread Mikel Rychliski
Hi Christoph, Thanks for your comments. I'm also replying here to your comments on the previous series. On Tuesday, March 17, 2020 10:28:35 AM EDT Christoph Hellwig wrote: > Any reason drivers can't just use pci_map_rom insteadἅ which already > does the right thing? Some machines don't expose t

[PATCH RESEND v2 1/2] drm/radeon: Stop directly referencing iomem

2020-03-16 Thread Mikel Rychliski
pci_platform_rom() returns an __iomem pointer which should not be accessed directly. Change radeon_read_platform_bios() to use memcpy_fromio() instead of calling kmemdup() on the __iomem pointer. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_bios.c | 11 +++ 1 file

[PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM

2020-03-16 Thread Mikel Rychliski
using ioremap() instead of phys_to_virt() in pci_platform_rom(). Now that pci_platform_rom() creates a new mapping to access the ROM image, update all callers to remove this mapping after extracting the BIOS. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1

[PATCH RESEND v2 0/2] Fix loading of platform ROM from 32-bit EFI

2020-03-16 Thread Mikel Rychliski
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 + drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 11 ++- drivers/gpu/drm/radeon

[PATCH v2 1/2] drm/radeon: Stop directly referencing iomem

2020-03-04 Thread Mikel Rychliski
pci_platform_rom() returns an __iomem pointer which should not be accessed directly. Change radeon_read_platform_bios() to use memcpy_fromio() instead of calling kmemdup() on the __iomem pointer. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_bios.c | 11 +++ 1 file

[PATCH v2 0/2] Fix loading of platform ROM from 32-bit EFI

2020-03-04 Thread Mikel Rychliski
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. Mikel Rychliski (2): drm/radeon: Stop directly referencing iomem PCI: Use ioremap(), not phys_to_virt() for

[PATCH v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM

2020-03-04 Thread Mikel Rychliski
using ioremap() instead of phys_to_virt() in pci_platform_rom(). Now that pci_platform_rom() creates a new mapping to access the ROM image, update all callers to remove this mapping after extracting the BIOS. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1

Re: [PATCH 2/4] PCI: Use ioremap, not phys_to_virt for platform rom

2020-03-03 Thread Mikel Rychliski
On Tuesday, March 3, 2020 9:38:27 AM EST Bjorn Helgaas wrote: > Cosmetics: > > s/ioremap/ioremap()/ (also in commit log) > s/phys_to_virt/phys_to_virt()/ (also in commit log) > s/pci_platform_rom/pci_platform_rom()/ (commit log) > s/rom/ROM/ > This changes the interface of pci_platform_rom() (the

[PATCH 0/4] Fix loading of radeon BIOS from 32-bit EFI

2020-03-03 Thread Mikel Rychliski
This patch set fixes an opps 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. Mikel Rychliski (4): drm/radeon: Stop directly referencing iomem PCI: Use ioremap, not phys_to_virt for platform rom

[PATCH 4/4] drm/amdgpu: iounmap unused mapping

2020-03-03 Thread Mikel Rychliski
Now that pci_platform_rom creates a new mapping to access the ROM image, we should remove this mapping after extracting the BIOS. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 3/4] drm/radeon: iounmap unused mapping

2020-03-03 Thread Mikel Rychliski
Now that pci_platform_rom creates a new mapping to access the ROM image, we should remove this mapping after extracting the BIOS. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_bios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b

[PATCH 2/4] PCI: Use ioremap, not phys_to_virt for platform rom

2020-03-03 Thread Mikel Rychliski
map instead of phys_to_virt in pci_platform_rom. Signed-off-by: Mikel Rychliski --- drivers/pci/rom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 137bf0cee897..e352798eed0c 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/r

[PATCH 1/4] drm/radeon: Stop directly referencing iomem

2020-03-03 Thread Mikel Rychliski
pci_platform_rom returns an __iomem pointer which should not be accessed directly. Change radeon_read_platform_bios to use memcpy_fromio instead of calling kmemdup on the __iomem pointer. Signed-off-by: Mikel Rychliski --- drivers/gpu/drm/radeon/radeon_bios.c | 11 +++ 1 file changed, 7