Commit graph

1280650 commits

Author SHA1 Message Date
Rafay Ahmed
d94588328f
Enable lte_em05 to be built as a module (#384) 2025-08-15 20:05:01 +02:00
Rafay Ahmed
670f4c34f9 Add LTE EM05 driver 2025-08-13 11:55:09 +08:00
Mecid
0e6860fe85
Sync Rock5B, 5B-Plus, 5T DT's with Radxa (#381)
* Sync Rock5B, 5B-Plus, 5T DT's

From Radxa's Kernel fork: https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr5.1/arch/arm64/boot/dts/rockchip/

* Keep Armbian's soc_thermal for fan speed on Rock5B
2025-08-12 19:22:03 +02:00
Alban Browaeys
fcd6317671 Fix PCI SATA link training instability on rock-5-itx
Based on upstream initial dts definition.

Signed-off-by: Alban Browaeys <alban.browaeys@gmail.com>
2025-08-11 18:15:18 +02:00
Niklas Cassel
46bbde3971 UPSTREAM: phy: rockchip-snps-pcie3: add support for rockchip,rx-common-refclk-mode
>From the RK3588 Technical Reference Manual, Part1,
section 6.19 PCIe3PHY_GRF Register Description:
"rxX_cmn_refclk_mode"
RX common reference clock mode for lane X. This mode should be enabled
only when the far-end and near-end devices are running with a common
reference clock.

The hardware reset value for this field is 0x1 (enabled).
Note that this register field is only available on RK3588, not on RK3568.

The link training either fails or is highly unstable (link state will jump
continuously between L0 and recovery) when this mode is enabled while
using an endpoint running in Separate Reference Clock with No SSC (SRNS)
mode or Separate Reference Clock with SSC (SRIS) mode.
(Which is usually the case when using a real SoC as endpoint, e.g. the
RK3588 PCIe controller can run in both Root Complex and Endpoint mode.)

Add support for the device tree property rockchip,rx-common-refclk-mode,
such that the PCIe PHY can be used in configurations where the Root
Complex and Endpoint are not using a common reference clock.

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20240412125818.17052-3-cassel@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Alban Browaeys <alban.browaeys@gmail.com>
2025-08-11 18:15:18 +02:00
Jonas Karlman
c8af2ee277 RFC: drm/panthor: Do not set clk rate when device is suspended
On Rockchip RK3588 trying to change the SCMI_CLK_GPU rate when the GPU
device is PM runtime suspended may cause a kernel panic:

  $ echo 1000000000 > /sys/class/devfreq/fb000000.gpu/min_freq

  SError Interrupt on CPU4, code 0x00000000be000411 -- SError
  CPU: 4 UID: 0 PID: 241 Comm: sh Not tainted 6.15.0-rc3 #1 VOLUNTARY
  Hardware name: Radxa ROCK 5B (DT)
  pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : smc_send_message+0x140/0x148
  lr : smc_send_message+0xd8/0x148
  sp : ffff8000827138c0
  x29: ffff8000827138c0 x28: ffff000008764000 x27: 0000000000000000
  x26: 0000000000000000 x25: 00000000ffffffff x24: ffff800082713b28
  x23: ffff00000696b010 x22: ffff000003db4da0 x21: ffff000003fdae80
  x20: ffff0000053f22c0 x19: ffff000003db4d80 x18: 0000000000000000
  x17: 0000000000000000 x16: 0000000000000000 x15: 00000000245df550
  x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
  x11: 0000000000000040 x10: ffff000003fde138 x9 : ffff000003fde130
  x8 : ffff000005e5c948 x7 : 0000000000000000 x6 : 0000000000000000
  x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
  x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
  Kernel panic - not syncing: Asynchronous SError Interrupt
  CPU: 4 UID: 0 PID: 241 Comm: sh Not tainted 6.15.0-rc3 #1 VOLUNTARY
  Hardware name: Radxa ROCK 5B (DT)
  Call trace:
   show_stack+0x28/0x78 (C)
   dump_stack_lvl+0x58/0x74
   dump_stack+0x14/0x1c
   panic+0x14c/0x328
   add_taint+0x0/0xc0
   arm64_serror_panic+0x60/0x6c
   do_serror+0x24/0x60
   el1h_64_error_handler+0x2c/0x40
   el1h_64_error+0x6c/0x70
   smc_send_message+0x140/0x148 (P)
   do_xfer+0xb0/0x1f8
   scmi_clock_rate_set+0xc0/0x220
   scmi_clk_set_rate+0x24/0x38
   clk_change_rate+0x164/0x288
   clk_core_set_rate_nolock+0x1dc/0x314
   clk_set_rate+0x34/0x144
   _opp_config_clk_single+0x2c/0x90
   _set_opp+0x104/0x564
   dev_pm_opp_set_rate+0x110/0x260
   panthor_devfreq_target+0x38/0x60 [panthor]
   devfreq_set_target+0x84/0x180
   devfreq_update_target+0xb4/0xcc
   update_devfreq+0x10/0x18
   set_freq_store+0x6c/0xb4
   dev_attr_store+0x14/0x24
   sysfs_kf_write+0x54/0x60
   kernfs_fop_write_iter+0x118/0x1e0
   vfs_write+0x224/0x390
   ksys_write+0x68/0x100
   __arm64_sys_write+0x18/0x20
   invoke_syscall+0x44/0x100
   el0_svc_common.constprop.0+0x3c/0xe0
   do_el0_svc+0x18/0x20
   el0_svc+0x2c/0xc0
   el0t_64_sync_handler+0x104/0x130
   el0t_64_sync+0x170/0x174
  SMP: stopping secondary CPUs
  Kernel Offset: disabled
  CPU features: 0x0e00,000000e0,01202650,8201700b
  Memory Limit: 3838 MB
  ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---

This typically happen when CLK_GPU is disabled or when PD_GPU is down.

Add a config_clks ops that will not set core clk rate when the device is
PM runtime suspended.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-08-11 18:14:50 +02:00
Jonas Karlman
bd3e32bbfb RFC: arm64: dts: rockchip: rk3588: Use scmi gpu clk as main GPU clock
CLK_GPU is the main clock for the GPU on RK3588, it's typical source
pll can be one of gpll, cpll, aupll, npll or spll. For higher clock
rates it is also possible to use the gpu pvtpll as pll source.

The logic to switch between a normal pll and the pvtpll depending on
rate is handled in TF-A firmware, and exposed to Linux as a scmi clock.
TF-A will typically change to use normal pll for rates up to 200 MHz and
use pvtpll for 300 MHz or more.

Change to use the SCMI_CLK_GPU as the main GPU clock and add the normal
CLK_GPU as a bus clk to model this in a similar way as on RK356x.

Prior to this change the GPU clk rate was max 850 MHz:

  $ glmark2-es2-gbm -b terrain
  [...]
    GL_VENDOR:      Mesa
    GL_RENDERER:    Mali-G610 (Panfrost)
    GL_VERSION:     OpenGL ES 3.1 Mesa 25.0.4
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 fullscreen
  [...]
  [terrain] <default>: FPS: 139 FrameTime: 7.231 ms

After this the GPU clk rate can use the 1 GHz rate with PVTPLL:

  [terrain] <default>: FPS: 152 FrameTime: 6.579 ms

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-08-11 18:14:50 +02:00
Jonas Karlman
b25d684fd3 RFC: drm/panthor: Add support for a bus clk
On RK3588 the GPU clk is exposed using a normal CLK_GPU and also as
SCMI_CLK_GPU. The main clock for the GPU is the SCMI_CLK_GPU, however,
the normal CLK_GPU also need to be enabled independently.

Add support for a bus clk to handle these two different clocks, similar
to panfrost.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-08-11 18:14:50 +02:00
Jonas Karlman
a27540d13f RFC: dt-bindings: gpu: mali-valhall-csf: Add bus clock for RK3588
Add support for a bus clock for rockchip,rk3588-mali compatible.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-08-11 18:14:50 +02:00
Jann Horn
623b4385c2 drm/panthor: Fix memory leak in panthor_ioctl_group_create()
When bailing out due to group_priority_permit() failure, the queue_args
need to be freed. Fix it by rearranging the function to use the
goto-on-error pattern, such that the success case flows straight without
indentation while error cases jump forward to cleanup.

Cc: stable@vger.kernel.org
Fixes: 5f7762042f8a ("drm/panthor: Restrict high priorities on group_create")
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20241113-panthor-fix-gcq-bailout-v1-1-654307254d68@google.com
2025-07-29 10:14:49 +02:00
Tvrtko Ursulin
401347d9b6 drm/sched: Avoid double re-lock on the job free path
Currently the job free work item will lock sched->job_list_lock first time
to see if there are any jobs, free a single job, and then lock again to
decide whether to re-queue itself if there are more finished jobs.

Since drm_sched_get_finished_job() already looks at the second job in the
queue we can simply add the signaled check and have it return the presence
of more jobs to be freed to the caller. That way the work item does not
have to lock the list again and repeat the signaled check.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250716085117.56864-1-tvrtko.ursulin@igalia.com
2025-07-29 10:14:49 +02:00
Lin.Cao
d5aaa0d5d2 drm/sched: Remove optimization that causes hang when killing dependent jobs
When application A submits jobs and application B submits a job with a
dependency on A's fence, the normal flow wakes up the scheduler after
processing each job. However, the optimization in
drm_sched_entity_add_dependency_cb() uses a callback that only clears
dependencies without waking up the scheduler.

When application A is killed before its jobs can run, the callback gets
triggered but only clears the dependency without waking up the scheduler,
causing the scheduler to enter sleep state and application B to hang.

Remove the optimization by deleting drm_sched_entity_clear_dep() and its
usage, ensuring the scheduler is always woken up when dependencies are
cleared.

Fixes: 777dbd458c ("drm/amdgpu: drop a dummy wakeup scheduler")
Cc: stable@vger.kernel.org # v4.6+
Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250717084453.921097-1-lincao12@amd.com
2025-07-29 10:14:49 +02:00
Maíra Canal
81896cebca drm/sched: Allow drivers to skip the reset and keep on running
When the DRM scheduler times out, it's possible that the GPU isn't hung;
instead, a job just took unusually long (longer than the timeout) but is
still running, and there is, thus, no reason to reset the hardware. This
can occur in two scenarios:

  1. The job is taking longer than the timeout, but the driver determined
     through a GPU-specific mechanism that the hardware is still making
     progress. Hence, the driver would like the scheduler to skip the
     timeout and treat the job as still pending from then onward. This
     happens in v3d, Etnaviv, and Xe.
  2. Timeout has fired before the free-job worker. Consequently, the
     scheduler calls `sched->ops->timedout_job()` for a job that isn't
     timed out.

These two scenarios are problematic because the job was removed from the
`sched->pending_list` before calling `sched->ops->timedout_job()`, which
means that when the job finishes, it won't be freed by the scheduler
though `sched->ops->free_job()` - leading to a memory leak.

To solve these problems, create a new `drm_gpu_sched_stat`, called
DRM_GPU_SCHED_STAT_NO_HANG, which allows a driver to skip the reset. The
new status will indicate that the job must be reinserted into
`sched->pending_list`, and the hardware / driver will still complete that
job.

Reviewed-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-2-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
2025-07-29 10:14:49 +02:00
Maíra Canal
124868d4b0 drm/sched: Rename DRM_GPU_SCHED_STAT_NOMINAL to DRM_GPU_SCHED_STAT_RESET
Among the scheduler's statuses, the only one that indicates an error is
DRM_GPU_SCHED_STAT_ENODEV. Any status other than DRM_GPU_SCHED_STAT_ENODEV
signifies that the operation succeeded and the GPU is in a nominal state.

However, to provide more information about the GPU's status, it is needed
to convey more information than just "OK".

Therefore, rename DRM_GPU_SCHED_STAT_NOMINAL to
DRM_GPU_SCHED_STAT_RESET, which better communicates the meaning of this
status. The status DRM_GPU_SCHED_STAT_RESET indicates that the GPU has
hung, but it has been successfully reset and is now in a nominal state
again.

Reviewed-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-1-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
2025-07-29 10:14:49 +02:00
Adrián Larumbe
ab97738cf5 drm/panthor: Remove dead VM flushing code
Commit ec62d37d2c0d("drm/panthor: Fix the fast-reset logic") did away
with the only reference to panthor_vm_flush_all(), so let's get rid
of the orphaned definition.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250711154557.739326-1-adrian.larumbe@collabora.com
2025-07-29 10:14:49 +02:00
Simona Vetter
d0ea442359 drm/panthor: Fix UAF in panthor_gem_create_with_handle() debugfs code
The object is potentially already gone after the drm_gem_object_put().
In general the object should be fully constructed before calling
drm_gem_handle_create(), except the debugfs tracking uses a separate
lock and list and separate flag to denotate whether the object is
actually initialized.

Since I'm touching this all anyway simplify this by only adding the
object to the debugfs when it's ready for that, which allows us to
delete that separate flag. panthor_gem_debugfs_bo_rm() already checks
whether we've actually been added to the list or this is some error
path cleanup.

v2: Fix build issues for !CONFIG_DEBUGFS (Adrián)

v3: Add linebreak and remove outdated comment (Liviu)

Fixes: a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS")
Cc: Adrián Larumbe <adrian.larumbe@collabora.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250709135220.1428931-1-simona.vetter@ffwll.ch
2025-07-29 10:14:49 +02:00
Steven Price
3bbf3a76e6 drm/panthor: Wait for _READY register when powering on
panthor_gpu_block_power_on() takes a register offset (rdy_reg) for the
purpose of waiting for the power transition to complete. However, a
copy/paste error converting to use the new 64 register functions
switched it to using the pwrtrans_reg register instead. Fix the function
to use the correct register.

Fixes: 4d230aa209ed ("drm/panthor: Add 64-bit and poll register accessors")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/r/20250630140704.432409-1-steven.price@arm.com
2025-07-29 10:14:49 +02:00
Philipp Stanner
92af7ff37e drm/sched: Warn if pending_list is not empty
drm_sched_fini() can leak jobs under certain circumstances.

Warn if that happens.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250710125412.128476-7-phasta@kernel.org
2025-07-29 10:14:49 +02:00
Philipp Stanner
4a9e7f5189 drm/sched: Avoid memory leaks with cancel_job() callback
Since its inception, the GPU scheduler can leak memory if the driver
calls drm_sched_fini() while there are still jobs in flight.

The simplest way to solve this in a backwards compatible manner is by
adding a new callback, drm_sched_backend_ops.cancel_job(), which
instructs the driver to signal the hardware fence associated with the
job. Afterwards, the scheduler can safely use the established free_job()
callback for freeing the job.

Implement the new backend_ops callback cancel_job().

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://lore.kernel.org/dri-devel/20250418113211.69956-1-tvrtko.ursulin@igalia.com/
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250710125412.128476-4-phasta@kernel.org
2025-07-29 10:14:49 +02:00
Tvrtko Ursulin
0d939aa0e9 drm/sched: Consolidate drm_sched_rq_select_entity_rr
Extract out two copies of the identical code to
drm_sched_rq_select_entity_rr()'s epilogue to make it smaller and more
readable.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
[phasta: commit message]
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250708122121.75689-1-tvrtko.ursulin@igalia.com
2025-07-29 10:14:49 +02:00
Tvrtko Ursulin
59b7c9d0ff drm/sched: De-clutter drm_sched_init
Move work queue allocation into a helper for a more streamlined function
body.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250704130754.89935-1-tvrtko.ursulin@igalia.com
2025-07-29 10:14:49 +02:00
Thomas Zimmermann
f353f5a0ea drm/scheduler: Include <linux/export.h>
Fix the compile-time warnings

  drivers/gpu/drm/scheduler/sched_entity.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing
  drivers/gpu/drm/scheduler/sched_fence.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing
  drivers/gpu/drm/scheduler/sched_main.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: a934a57a42f6 ("scripts/misc-check: check missing #include <linux/export.h> when W=1")
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250612121633.229222-9-tzimmermann@suse.de
2025-07-29 10:14:49 +02:00
Karunika Choo
42ad1820ec drm/panthor: Clean up 64-bit register definitions
With the introduction of 64-bit register accessors, the separate *_HI
definitions are no longer necessary. This change removes them and
renames the corresponding *_LO entries for cleaner and more consistent
register definitions.

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Link: https://lore.kernel.org/r/20250606101835.41840-3-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2025-07-29 10:14:49 +02:00
Karunika Choo
713f728f0e drm/panthor: Add 64-bit and poll register accessors
This patch adds 64-bit register accessors to simplify register access in
Panthor. It also adds 32-bit and 64-bit variants for read_poll_timeout.

This patch also updates Panthor to use the new 64-bit accessors and poll
functions.

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Link: https://lore.kernel.org/r/20250606101835.41840-2-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2025-07-29 10:14:49 +02:00
Boris Brezillon
fc09e07a30 drm/panthor: Fix the user MMIO offset logic for emulators
Currently, we pick the MMIO offset based on the size of the pgoff_t
type seen by the process that manipulates the FD, such that a 32-bit
process can always map the user MMIO ranges. But this approach doesn't
work well for emulators like FEX, where the emulator is a 64-bit binary
which might be executing 32-bit code. In that case, the kernel thinks
it's the 64-bit process and assumes DRM_PANTHOR_USER_MMIO_OFFSET_64BIT
is in use, but the UMD library expects DRM_PANTHOR_USER_MMIO_OFFSET_32BIT,
because it can't mmap() anything above the pgoff_t size.

In order to solve that, we need a way to explicitly set the user MMIO
offset from the UMD, such that the kernel doesn't have to guess it
from the TIF_32BIT flag set on user thread. We keep the old behavior
if DRM_PANTHOR_SET_USER_MMIO_OFFSET is never called.

Changes in v2:
- Drop the lock/immutable fields and allow SET_USER_MMIO_OFFSET
  requests to race with mmap() requests
- Don't do the is_user_mmio_offset test twice in panthor_mmap()
- Improve the uAPI docs

Changes in v3:
- Bump to version 1.5 instead of 1.4 after rebasing
- Add R-bs
- Fix/rephrase comment as suggested by Liviu

Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/r/20250606080932.4140010-3-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2025-07-29 10:14:49 +02:00
Adrián Larumbe
e3750149ec drm/panthor: Fix build warning when DEBUG_FS is disabled
Commit a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM
objects over DebugFS") causes a build warning and linking error when
built without support for DebugFS, because of a non-inline non-static
function declaration in a header file.

On top of that, the function is only being used inside a single
compilation unit, so there is no point in exposing it as a global
symbol.

This is a follow-up from Arnd Bergmann's first fix.
Also move panthor_gem_debugfs_set_usage_flags() into panthor_gem.c and
declare it static.

Fixes: a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Closes: https://lore.kernel.org/dri-devel/20250424142419.47b9d457@collabora.com/T/#t
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/r/20250424184041.356191-1-adrian.larumbe@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2025-07-29 10:14:49 +02:00
Ivan Podogov
6e99efe1a5 Partial revert: bring back second parameter of __assign_str 2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
9723a712de drm/doc: Document some tracepoints as uAPI
This commit adds a document section in drm-uapi.rst about tracepoints,
and mark the events gpu_scheduler_trace.h as stable uAPI.

The goal is to explicitly state that tools can rely on the fields,
formats and semantics of these events.

Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-10-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
ddfc1a9c8e drm: Get rid of drm_sched_job.id
Its only purpose was for trace events, but jobs can already be
uniquely identified using their fence.

The downside of using the fence is that it's only available
after 'drm_sched_job_arm' was called which is true for all trace
events that used job.id so they can safely switch to using it.

Suggested-by: Tvrtko Ursulin <tursulin@igalia.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-9-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Tvrtko Ursulin
dcf72a4bb0 drm/sched: Remove a hole from struct drm_sched_job
We can re-order some struct members and take u32 credits outside of the
pointer sandwich and also for the last_dependency member we can get away
with an unsigned int since for dependency we use xa_limit_32b.

Pahole report before:
        /* size: 160, cachelines: 3, members: 14 */
        /* sum members: 156, holes: 1, sum holes: 4 */
        /* last cacheline: 32 bytes */

And after:
        /* size: 152, cachelines: 3, members: 14 */
        /* last cacheline: 24 bytes */

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250221105038.79665-4-tvrtko.ursulin@igalia.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
a5db7581f2 drm/sched: Cleanup event names
All events now start with the same prefix (drm_sched_job_).

drm_sched_job_wait_dep was misleading because it wasn't waiting
at all. It's now replaced by trace_drm_sched_job_unschedulable,
which is only traced if the job cannot be scheduled.
For moot dependencies, nothing is traced.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-8-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
0a41e1e914 drm/sched: Add the drm_client_id to the drm_sched_run/exec_job events
For processes with multiple drm_file instances, the drm_client_id is
the only way to map jobs back to their unique owner.

It's even more useful if drm client_name is set, because now a tool
can map jobs to the client name instead of only having access to
the process name.

Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-7-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
85197ad4b2 drm/sched: Trace dependencies for GPU jobs
We can't trace dependencies from drm_sched_job_add_dependency
because when it's called the job's fence is not available yet.

So instead each dependency is traced individually when
drm_sched_entity_push_job is used.

Tracing the dependencies allows tools to analyze the dependencies
between the jobs (previously it was only possible for fences
traced by drm_sched_job_wait_dep).

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-6-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
f5ca99ddef drm/sched: Cleanup gpu_scheduler trace events
A fence uniquely identify a job, so this commits updates the places
where a kernel pointer was used as an identifier by:

   "fence=%llu:%llu"

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-5-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
7ac54eef79 drm/sched: Add device name to the drm_sched_process_job event
Since switching the scheduler from using kthreads to workqueues in
commit a6149f039369 ("drm/sched: Convert drm scheduler to use a work
queue rather than kthread") userspace applications cannot determine
the device from the PID of the threads sending the trace events
anymore.

Each queue had its own kthread which had a given PID for the whole
time. So, at least for amdgpu, it was possible to associate a PID
to the hardware queues of each GPU in the system. Then, when a
drm_run_job trace event was received by userspace, the source PID
allowed to associate it back to the correct GPU.

With workqueues this is not possible anymore, so the event needs to
contain the dev_name() to identify the device.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-4-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Pierre-Eric Pelloux-Prayer
bae30fa3ef drm/sched: Store the drm client_id in drm_sched_fence
This will be used in a later commit to trace the drm client_id in
some of the gpu_scheduler trace events.

This requires changing all the users of drm_sched_job_init to
add an extra parameter.

The newly added drm_client_id field in the drm_sched_fence is a bit
of a duplicate of the owner one. One suggestion I received was to
merge those 2 fields - this can't be done right now as amdgpu uses
some special values (AMDGPU_FENCE_OWNER_*) that can't really be
translated into a client id. Christian is working on getting rid of
those; when it's done we should be able to squash owner/drm_client_id
together.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-3-pierre-eric.pelloux-prayer@amd.com
2025-07-29 10:14:49 +02:00
Lin.Cao
70f0056af2 drm/scheduler: signal scheduled fence when kill job
When an entity from application B is killed, drm_sched_entity_kill()
removes all jobs belonging to that entity through
drm_sched_entity_kill_jobs_work(). If application A's job depends on a
scheduled fence from application B's job, and that fence is not properly
signaled during the killing process, application A's dependency cannot be
cleared.

This leads to application A hanging indefinitely while waiting for a
dependency that will never be resolved. Fix this issue by ensuring that
scheduled fences are properly signaled when an entity is killed, allowing
dependent applications to continue execution.

Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250515020713.1110476-1-lincao12@amd.com
2025-07-29 10:14:49 +02:00
Philipp Stanner
346e8f5d52 drm/sched: Remove kthread header
The kthread header doesn't need to be included anymore. It's a relict
from commit a6149f039369 ("drm/sched: Convert drm scheduler to use a
work queue rather than kthread").

Remove the unneeded includes.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250314101023.111248-3-phasta@kernel.org
2025-07-29 10:14:49 +02:00
Philipp Stanner
da5f073c5a drm/sched: Fix outdated comments referencing thread
The GPU scheduler's comments refer to a "thread" at various places.
Those are leftovers from commit a6149f039369 ("drm/sched: Convert drm
scheduler to use a work queue rather than kthread").

Replace all references to kthreads.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250314101023.111248-2-phasta@kernel.org
2025-07-29 10:14:49 +02:00
Hsun Lai
5b801c24d1 rk3566-lckfb-tspi: update dts name 2025-07-25 07:42:29 +02:00
Igor
77c2e6a020 Update and rename README to README.md 2025-07-18 17:55:38 +02:00
Khusika Dhamar Gusti
d91913c483 media: rockchip: hdmirx: change HDMI unplug message to debug
If HDMI 5V power is missing, set log unplug event
at debug level instead of error level to reduce log spam.

This change was introduced in commit cc4331bada ("media: rockchip: hdmirx: silence spam on opi5plus")
and accidentally reverted in commit c15bc2efba ("add itc type to hdmirx")

Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
2025-07-17 09:21:18 +08:00
Hsun Lai
b8e8f4b083 arm64: add device tree for 100ASK DshanPi A1 (RK3576) 2025-07-16 19:06:18 +02:00
Ivan Podogov
e43544dba6 Fix for RetrOled display refresh rate 2025-07-12 12:50:27 +02:00
amazingfate
6478d7499c arch: arm64: dts: add rockchip,default-link-up to pcie2 ethernet nodes of opi5ultra
Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
2025-07-11 17:21:29 +02:00
Khusika Dhamar Gusti
c8f1b42186 arch: arm64: dts: Add OrangePi 5 Ultra board
Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
2025-07-11 17:21:29 +02:00
Mitchell Ma
7ee713c95b arm64: dts: rockchip: add 10fhd overlay for rock-5t
Signed-off-by: Mitchell Ma <machuang@radxa.com>
2025-06-19 08:39:24 +02:00
Jack Huang
5271a2ffc8 arm64: dts: add imb3588 dts
Signed-off-by: Jack Huang <jackhuang021@gmail.com>
2025-06-03 21:10:51 +08:00
amazingfate
a9da5bff98 arch: arm64: dts: armsom-cm5: slow down sdio freq to 100M for stability 2025-05-30 09:18:17 +08:00
amazingfate
d1b7c9db55 arch: arm64: dts: armsom-sige5: slow down sdio freq to 100M for stability 2025-05-30 09:18:17 +08:00