mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
hsi: omap_ssi_core: fix missing DMA mask setup for SSI controller device
The OMAP SSI driver uses a synthetic HSI controller device allocated via
hsi_alloc_controller(), which does not go through the normal OF/platform
device initialization path.
As a result, the embedded struct device does not have a DMA mask
initialized by default.
After recent DMA API hardening changes, dma_map_sg() and related helpers
now require a valid dma_mask to be present, otherwise the driver may
crash or trigger warnings when attempting DMA mapping operations.
Fix this by explicitly initializing the DMA mask for the SSI controller
device and setting a 32-bit DMA mask, which matches the hardware
capabilities.
Cc: stable@vger.kernel.org
Fixes: f959dcd6dd ("dma-direct: Fix potential NULL pointer dereference")
Reported-by: Merlijn Wajer <merlijn@wizzup.org>
Closes: https://lore.kernel.org/linux-omap/4ed95c71-2066-6b4c-ad1b-53ef02d79d53@wizzup.org/
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Link: https://patch.msgid.link/20260724130522.706480-1-ivo.g.dimitrov.75@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
659287caa7
commit
e81250ec6b
|
|
@ -499,6 +499,12 @@ static int ssi_probe(struct platform_device *pd)
|
|||
|
||||
pm_runtime_enable(&pd->dev);
|
||||
|
||||
ssi->device.dma_mask = &ssi->device.coherent_dma_mask;
|
||||
|
||||
err = dma_set_mask_and_coherent(&ssi->device, DMA_BIT_MASK(32));
|
||||
if (err)
|
||||
goto out2;
|
||||
|
||||
err = ssi_hw_init(ssi);
|
||||
if (err < 0)
|
||||
goto out2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user