media: intel/ipu6: Don't re-allocate memory for firmware
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 2 May 2024 15:49:50 +0000 (16:49 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 May 2024 11:18:11 +0000 (12:18 +0100)
commit8a09bb1be67a54b1ab66272731faa0c04b9b675d
tree1dabbb7e295a38a4061bf3a7139dcb0b46a27100
parent1aa1329a67cc214c3b7bd2a14d1301a795760b07
media: intel/ipu6: Don't re-allocate memory for firmware

The ipu6 driver allocated vmalloc memory for the firmware if
request_firmware() somehow managed not to use vmalloc to allocate it.

Still how the memory is allocated by request_firmware() is not specified
in its API, so be prepared for kmalloc-allocated firmware, too. Instead of
allocating new vmalloc-backed buffer for the firmware, obtain the pages
from virtual addresses instead.

Link: https://lore.kernel.org/linux-media/20240502154950.549015-1-sakari.ailus@linux.intel.com
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20240501102236.3b2585d1@canb.auug.org.au/
Fixes: 25fedc021985 ("media: intel/ipu6: add Intel IPU6 PCI device driver")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/pci/intel/ipu6/ipu6-buttress.c
drivers/media/pci/intel/ipu6/ipu6.c