| 3b87886b | 13-Feb-2025 |
Steven Price <[email protected]> |
drm/panthor: Clean up FW version information display
Assigning a string to an array which is too small to include the NUL byte at the end causes a warning on some compilers. But this function also h
drm/panthor: Clean up FW version information display
Assigning a string to an array which is too small to include the NUL byte at the end causes a warning on some compilers. But this function also has some other oddities like the 'header' array which is only ever used within sizeof().
Tidy up the function by removing the 'header' array, allow the NUL byte to be present in git_sha_header, and calculate the length directly from git_sha_header.
Reported-by: Will Deacon <[email protected]> Closes: https://lore.kernel.org/all/20250213154237.GA11897@willie-the-truck/ Fixes: 9d443deb0441 ("drm/panthor: Display FW version information") Signed-off-by: Steven Price <[email protected]> Acked-by: Will Deacon <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| c63c3bfd | 03-Mar-2025 |
Adrián Larumbe <[email protected]> |
drm/panthor: Avoid sleep locking in the internal BO size path
Commit 434e5ca5b5d7 ("drm/panthor: Expose size of driver internal BO's over fdinfo") locks the VMS xarray, to avoid UAF errors when the
drm/panthor: Avoid sleep locking in the internal BO size path
Commit 434e5ca5b5d7 ("drm/panthor: Expose size of driver internal BO's over fdinfo") locks the VMS xarray, to avoid UAF errors when the same VM is being concurrently destroyed by another thread. However, that puts the current thread in atomic context, which means taking the VMS' heap locks will trigger a warning as the thread is no longer allowed to sleep.
Because in this case replacing the heap mutex with a spinlock isn't feasible, the fdinfo handler no longer traverses the list of heaps for every single VM associated with an open DRM file. Instead, when a new heap chunk is allocated, its size is accumulated into a pool-wide tally, which also makes the atomic context code path somewhat faster.
Signed-off-by: Adrián Larumbe <[email protected]> Fixes: 434e5ca5b5d7 ("drm/panthor: Expose size of driver internal BO's over fdinfo") Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| e379856b | 03-Mar-2025 |
Adrián Larumbe <[email protected]> |
drm/panthor: Replace sleep locks with spinlocks in fdinfo path
Commit 0590c94c3596 ("drm/panthor: Fix race condition when gathering fdinfo group samples") introduced an xarray lock to deal with pote
drm/panthor: Replace sleep locks with spinlocks in fdinfo path
Commit 0590c94c3596 ("drm/panthor: Fix race condition when gathering fdinfo group samples") introduced an xarray lock to deal with potential use-after-free errors when accessing groups fdinfo figures. However, this toggles the kernel's atomic context status, so the next nested mutex lock will raise a warning when the kernel is compiled with mutex debug options:
CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
Replace Panthor's group fdinfo data mutex with a guarded spinlock.
Signed-off-by: Adrián Larumbe <[email protected]> Fixes: 0590c94c3596 ("drm/panthor: Fix race condition when gathering fdinfo group samples") Reviewed-by: Liviu Dudau <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| 0590c94c | 30-Jan-2025 |
Adrián Larumbe <[email protected]> |
drm/panthor: Fix race condition when gathering fdinfo group samples
Commit e16635d88fa0 ("drm/panthor: add DRM fdinfo support") failed to protect access to groups with an xarray lock, which could le
drm/panthor: Fix race condition when gathering fdinfo group samples
Commit e16635d88fa0 ("drm/panthor: add DRM fdinfo support") failed to protect access to groups with an xarray lock, which could lead to use-after-free errors.
Fixes: e16635d88fa0 ("drm/panthor: add DRM fdinfo support") Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Adrián Larumbe <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| 57e233c3 | 17-Dec-2024 |
Boris Brezillon <[email protected]> |
drm/panthor: Fix a race between the reset and suspend path
If a reset is scheduled when the suspend happens, we drop the reset-pending info on the floor assuming the resume will fix things, but the
drm/panthor: Fix a race between the reset and suspend path
If a reset is scheduled when the suspend happens, we drop the reset-pending info on the floor assuming the resume will fix things, but the resume logic might try a fast reset. If we're lucky, the fast reset fails and we fallback to a slow reset, but if the FW was corrupted in a way that makes it partially functional (it boots but doesn't quite do what it's expected to do), we won't notice immediately that things are not working correctly, leading to a new reset further down the road.
Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block") Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| ec62d37d | 11-Dec-2024 |
Boris Brezillon <[email protected]> |
drm/panthor: Fix the fast-reset logic
If we do a GPU soft-reset, that's no longer fast reset. This also means the slow reset fallback doesn't work because the MCU state is only reset after a GPU sof
drm/panthor: Fix the fast-reset logic
If we do a GPU soft-reset, that's no longer fast reset. This also means the slow reset fallback doesn't work because the MCU state is only reset after a GPU soft-reset.
Let's move the retry logic to panthor_device_resume() to issue a soft-reset between the fast and slow attempts, and patch panthor_gpu_suspend() to only power-off the L2 when a fast reset is requested.
v3: - No changes
v2: - Add R-b
Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| 303e9e98 | 11-Dec-2024 |
Boris Brezillon <[email protected]> |
drm/panthor: Be robust against resume failures
When the runtime PM resume callback returns an error, it puts the device in a state where it can't be resumed anymore. Make sure we can recover from su
drm/panthor: Be robust against resume failures
When the runtime PM resume callback returns an error, it puts the device in a state where it can't be resumed anymore. Make sure we can recover from such transient failures by calling pm_runtime_set_suspended() explicitly after a pm_runtime_resume_and_get() failure.
v3: - Add R-b/A-b
v2: - Add a comment explaining potential races in panthor_device_resume_and_get()
Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Adrian Larumbe <[email protected]> Acked-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| b0758224 | 11-Dec-2024 |
Boris Brezillon <[email protected]> |
drm/panthor: Ignore devfreq_{suspend, resume}_device() failures
devfreq_{resume,suspend}_device() don't bother undoing the suspend_count modifications if something fails, so either it assumes failur
drm/panthor: Ignore devfreq_{suspend, resume}_device() failures
devfreq_{resume,suspend}_device() don't bother undoing the suspend_count modifications if something fails, so either it assumes failures are harmless, or it's super fragile/buggy. In either case it's not something we can address at the driver level, so let's just assume failures are harmless for now, like is done in panfrost.
v3: - Add R-b
v2: - Add R-b
Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Adrian Larumbe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| dcddad6c | 11-Dec-2024 |
Boris Brezillon <[email protected]> |
drm/panthor: Be robust against runtime PM resume failures in the suspend path
The runtime PM resume operation is not guaranteed to succeed, but if it fails, the device should be in a suspended state
drm/panthor: Be robust against runtime PM resume failures in the suspend path
The runtime PM resume operation is not guaranteed to succeed, but if it fails, the device should be in a suspended state. Make sure we're robust to resume failures in the unplug path.
v3: - Fix typo - Add R-bs
v2: - Move the bit that belonged in the next commit - Drop the panthor_device_unplug() changes
Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Adrian Larumbe <[email protected]> Reviewed-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
show more ...
|
| 498893bd | 19-Nov-2024 |
Karunika Choo <[email protected]> |
drm/panthor: Simplify FW fast reset path
Stop checking the FW halt_status as MCU_STATUS should be sufficient. This should make the check for successful FW halt and subsequently setting fast_reset to
drm/panthor: Simplify FW fast reset path
Stop checking the FW halt_status as MCU_STATUS should be sufficient. This should make the check for successful FW halt and subsequently setting fast_reset to true more robust.
We should also clear GLB_REQ.GLB_HALT bit only on post-reset prior to starting the FW and only if we're doing a fast reset, because the slow reset will re-initialize all FW sections, including the global interface.
Signed-off-by: Karunika Choo <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Liviu Dudau <[email protected]>
show more ...
|
| dd7db8d9 | 30-Oct-2024 |
Akash Goel <[email protected]> |
drm/panthor: Explicitly set the coherency mode
This commit fixes the potential misalignment between the value of device tree property "dma-coherent" and default value of COHERENCY_ENABLE register. P
drm/panthor: Explicitly set the coherency mode
This commit fixes the potential misalignment between the value of device tree property "dma-coherent" and default value of COHERENCY_ENABLE register. Panthor driver didn't explicitly program the COHERENCY_ENABLE register with the desired coherency mode. The default value of COHERENCY_ENABLE register is implementation defined, so it may not be always aligned with the "dma-coherent" property value. The commit also checks the COHERENCY_FEATURES register to confirm that the coherency protocol is actually supported or not.
v2: - Added R-b tags
Signed-off-by: Akash Goel <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Reviewed-by: Steven Price <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Liviu Dudau <[email protected]>
show more ...
|