summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@linaro.org>2026-06-16 18:40:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-04 13:38:41 +0200
commit5ee32f221713dda4e59eeb95a4a191f5edd413d5 (patch)
tree682107e3b26ea9b08f68d2b478de2c84d1f645f6
parentda443a97abdb6d9d2f19788dd193c537eab3e328 (diff)
downloadlinux-5ee32f221713dda4e59eeb95a4a191f5edd413d5.tar.gz
linux-5ee32f221713dda4e59eeb95a4a191f5edd413d5.zip
misc: fastrpc: Add dma_mask to fastrpc_channel_ctx
[ Upstream commit 9bde43a0e2f469961e18d0a3496a9a74379c22bf ] dma_set_mask_and_coherent only updates the mask to which the device dma_mask pointer points to. Add a dma_mask to the channel ctx and set the device dma_mask to point to that, otherwise the dma_set_mask will return an error and the dma_set_coherent_mask will be skipped too. Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20221125071405.148786-11-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Stable-dep-of: 5401fb4fe10f ("misc: fastrpc: Fix NULL pointer dereference in rpmsg callback") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/fastrpc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index f0e8ec6a79ba..3ba0b322adb2 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -214,6 +214,7 @@ struct fastrpc_channel_ctx {
struct list_head users;
struct miscdevice miscdev;
struct kref refcount;
+ u64 dma_mask;
};
struct fastrpc_user {
@@ -1689,6 +1690,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
kref_init(&data->refcount);
dev_set_drvdata(&rpdev->dev, data);
+ rdev->dma_mask = &data->dma_mask;
dma_set_mask_and_coherent(rdev, DMA_BIT_MASK(32));
INIT_LIST_HEAD(&data->users);
spin_lock_init(&data->lock);