Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Improve freq and throttle documentation

Add xe_gt_throttle under the "GT Frequency Management" and improve the
narrative making sure the documentation for both *_freq and throttle/*
attributes follow the same style.

Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20251029-gt-throttle-cri-v3-6-d1f5abbb8114@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

+52 -41
+3
Documentation/gpu/xe/xe_gt_freq.rst
··· 7 7 .. kernel-doc:: drivers/gpu/drm/xe/xe_gt_freq.c 8 8 :doc: Xe GT Frequency Management 9 9 10 + .. kernel-doc:: drivers/gpu/drm/xe/xe_gt_throttle.c 11 + :doc: Xe GT Throttle 12 + 10 13 Internal API 11 14 ============ 12 15
+16 -14
drivers/gpu/drm/xe/xe_gt_freq.c
··· 29 29 * PCODE is the ultimate decision maker of the actual running frequency, based 30 30 * on thermal and other running conditions. 31 31 * 32 - * Xe's Freq provides a sysfs API for frequency management: 32 + * Xe's Freq provides a sysfs API for frequency management under 33 + * ``<device>/tile#/gt#/freq0/`` directory. 33 34 * 34 - * device/tile#/gt#/freq0/<item>_freq *read-only* files: 35 + * **Read-only** attributes: 35 36 * 36 - * - act_freq: The actual resolved frequency decided by PCODE. 37 - * - cur_freq: The current one requested by GuC PC to the PCODE. 38 - * - rpn_freq: The Render Performance (RP) N level, which is the minimal one. 39 - * - rpa_freq: The Render Performance (RP) A level, which is the achievable one. 40 - * Calculated by PCODE at runtime based on multiple running conditions 41 - * - rpe_freq: The Render Performance (RP) E level, which is the efficient one. 42 - * Calculated by PCODE at runtime based on multiple running conditions 43 - * - rp0_freq: The Render Performance (RP) 0 level, which is the maximum one. 37 + * - ``act_freq``: The actual resolved frequency decided by PCODE. 38 + * - ``cur_freq``: The current one requested by GuC PC to the PCODE. 39 + * - ``rpn_freq``: The Render Performance (RP) N level, which is the minimal one. 40 + * - ``rpa_freq``: The Render Performance (RP) A level, which is the achievable one. 41 + * Calculated by PCODE at runtime based on multiple running conditions 42 + * - ``rpe_freq``: The Render Performance (RP) E level, which is the efficient one. 43 + * Calculated by PCODE at runtime based on multiple running conditions 44 + * - ``rp0_freq``: The Render Performance (RP) 0 level, which is the maximum one. 44 45 * 45 - * device/tile#/gt#/freq0/<item>_freq *read-write* files: 46 + * **Read-write** attributes: 46 47 * 47 - * - min_freq: Min frequency request. 48 - * - max_freq: Max frequency request. 49 - * If max <= min, then freq_min becomes a fixed frequency request. 48 + * - ``min_freq``: Min frequency request. 49 + * - ``max_freq``: Max frequency request. 50 + * If max <= min, then freq_min becomes a fixed frequency 51 + * request. 50 52 */ 51 53 52 54 static struct xe_guc_pc *
+33 -27
drivers/gpu/drm/xe/xe_gt_throttle.c
··· 17 17 /** 18 18 * DOC: Xe GT Throttle 19 19 * 20 - * Provides sysfs entries and other helpers for frequency throttle reasons in GT 21 - * 22 - * device/gt#/freq0/throttle/status - Overall status 23 - * device/gt#/freq0/throttle/reason_pl1 - Frequency throttle due to PL1 24 - * device/gt#/freq0/throttle/reason_pl2 - Frequency throttle due to PL2 25 - * device/gt#/freq0/throttle/reason_pl4 - Frequency throttle due to PL4, Iccmax etc. 26 - * device/gt#/freq0/throttle/reason_thermal - Frequency throttle due to thermal 27 - * device/gt#/freq0/throttle/reason_prochot - Frequency throttle due to prochot 28 - * device/gt#/freq0/throttle/reason_ratl - Frequency throttle due to RATL 29 - * device/gt#/freq0/throttle/reason_vr_thermalert - Frequency throttle due to VR THERMALERT 30 - * device/gt#/freq0/throttle/reason_vr_tdc - Frequency throttle due to VR TDC 20 + * The GT frequency may be throttled by hardware/firmware for various reasons 21 + * that are provided through attributes under the ``freq0/throttle/`` directory. 22 + * Their availability depend on the platform and some may not be visible if that 23 + * reason is not available. 31 24 * 32 25 * The following attributes are available on Crescent Island platform: 33 - * device/gt#/freq0/throttle/status - Overall throttle status 34 - * device/gt#/freq0/throttle/reason_pl1 - Frequency throttle due to package PL1 35 - * device/gt#/freq0/throttle/reason_pl2 - Frequency throttle due to package PL2 36 - * device/gt#/freq0/throttle/reason_pl4 - Frequency throttle due to PL4 37 - * device/gt#/freq0/throttle/reason_prochot - Frequency throttle due to prochot 38 - * device/gt#/freq0/throttle/reason_soc_thermal - Frequency throttle due to SoC thermal 39 - * device/gt#/freq0/throttle/reason_mem_thermal - Frequency throttle due to memory thermal 40 - * device/gt#/freq0/throttle/reason_vr_thermal - Frequency throttle due to VR thermal 41 - * device/gt#/freq0/throttle/reason_iccmax - Frequency throttle due to ICCMAX 42 - * device/gt#/freq0/throttle/reason_ratl - Frequency throttle due to RATL thermal algorithm 43 - * device/gt#/freq0/throttle/reason_soc_avg_thermal - Frequency throttle due to SoC average temp 44 - * device/gt#/freq0/throttle/reason_fastvmode - Frequency throttle due to VR is hitting FastVMode 45 - * device/gt#/freq0/throttle/reason_psys_pl1 - Frequency throttle due to PSYS PL1 46 - * device/gt#/freq0/throttle/reason_psys_pl2 - Frequency throttle due to PSYS PL2 47 - * device/gt#/freq0/throttle/reason_p0_freq - Frequency throttle due to P0 frequency 48 - * device/gt#/freq0/throttle/reason_psys_crit - Frequency throttle due to PSYS critical 26 + * 27 + * - ``status``: Overall throttle status 28 + * - ``reason_pl1``: package PL1 29 + * - ``reason_pl2``: package PL2 30 + * - ``reason_pl4``: package PL4 31 + * - ``reason_prochot``: prochot 32 + * - ``reason_soc_thermal``: SoC thermal 33 + * - ``reason_mem_thermal``: Memory thermal 34 + * - ``reason_vr_thermal``: VR thermal 35 + * - ``reason_iccmax``: ICCMAX 36 + * - ``reason_ratl``: RATL thermal algorithm 37 + * - ``reason_soc_avg_thermal``: SoC average temp 38 + * - ``reason_fastvmode``: VR is hitting FastVMode 39 + * - ``reason_psys_pl1``: PSYS PL1 40 + * - ``reason_psys_pl2``: PSYS PL2 41 + * - ``reason_p0_freq``: P0 frequency 42 + * - ``reason_psys_crit``: PSYS critical 43 + * 44 + * Other platforms support the following reasons: 45 + * 46 + * - ``status``: Overall status 47 + * - ``reason_pl1``: package PL1 48 + * - ``reason_pl2``: package PL2 49 + * - ``reason_pl4``: package PL4, Iccmax etc. 50 + * - ``reason_thermal``: thermal 51 + * - ``reason_prochot``: prochot 52 + * - ``reason_ratl``: RATL hermal algorithm 53 + * - ``reason_vr_thermalert``: VR THERMALERT 54 + * - ``reason_vr_tdc``: VR TDC 49 55 */ 50 56 51 57 static struct xe_gt *dev_to_gt(struct device *dev)