summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorJeffrey Hugo <quic_jhugo@quicinc.com>2025-10-07 13:57:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-23 16:20:36 +0200
commit646868e6962b14e25ae7462fdd1fb061b40c1f16 (patch)
tree0b42cad43779e9f7006d02c2178b9383d2faa432 /drivers/accel
parente15f6ac84445d5604cda22d9cc5891b8fec56ec2 (diff)
downloadlinux-646868e6962b14e25ae7462fdd1fb061b40c1f16.tar.gz
linux-646868e6962b14e25ae7462fdd1fb061b40c1f16.tar.bz2
linux-646868e6962b14e25ae7462fdd1fb061b40c1f16.zip
accel/qaic: Fix bootlog initialization ordering
[ Upstream commit fd6e385528d8f85993b7bfc6430576136bb14c65 ] As soon as we queue MHI buffers to receive the bootlog from the device, we could be receiving data. Therefore all the resources needed to process that data need to be setup prior to queuing the buffers. We currently initialize some of the resources after queuing the buffers which creates a race between the probe() and any data that comes back from the device. If the uninitialized resources are accessed, we could see page faults. Fix the init ordering to close the race. Fixes: 5f8df5c6def6 ("accel/qaic: Add bootlog debugfs") Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Reviewed-by: Carl Vanderlip <carl.vanderlip@oss.qualcomm.com> Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Link: https://lore.kernel.org/r/20251007115750.332169-1-youssef.abdulrahman@oss.qualcomm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/qaic/qaic_debugfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/accel/qaic/qaic_debugfs.c b/drivers/accel/qaic/qaic_debugfs.c
index 20b653d99e52..5ed49daaf541 100644
--- a/drivers/accel/qaic/qaic_debugfs.c
+++ b/drivers/accel/qaic/qaic_debugfs.c
@@ -251,6 +251,9 @@ static int qaic_bootlog_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_d
if (ret)
goto destroy_workqueue;
+ dev_set_drvdata(&mhi_dev->dev, qdev);
+ qdev->bootlog_ch = mhi_dev;
+
for (i = 0; i < BOOTLOG_POOL_SIZE; i++) {
msg = devm_kzalloc(&qdev->pdev->dev, sizeof(*msg), GFP_KERNEL);
if (!msg) {
@@ -266,8 +269,6 @@ static int qaic_bootlog_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_d
goto mhi_unprepare;
}
- dev_set_drvdata(&mhi_dev->dev, qdev);
- qdev->bootlog_ch = mhi_dev;
return 0;
mhi_unprepare: