OSDN Git Service

drm/i915/hwmon: Expose power1_max_interval
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Thu, 13 Oct 2022 15:45:25 +0000 (08:45 -0700)
committerAnshuman Gupta <anshuman.gupta@intel.com>
Mon, 17 Oct 2022 09:27:23 +0000 (14:57 +0530)
commit4c2572fe0ae742c2fa25b6fbb06ef4b3cd08b454
treef7972146375e5946e4632d5813cee440c5c49178
parentc8939848f7e4b01fe37295529f8b94e93ffbdd16
drm/i915/hwmon: Expose power1_max_interval

Expose power1_max_interval, that is the tau corresponding to PL1, as a
custom hwmon attribute. Some bit manipulation is needed because of the
format of PKG_PWR_LIM_1_TIME in
GT0_PACKAGE_RAPL_LIMIT register (1.x * power(2,y)).

v2: Update date and kernel version in Documentation (Badal)
v3: Cleaned up hwm_power1_max_interval_store() (Badal)
v4:
  - Fixed review comments (Anshuman)
  - In hwm_power1_max_interval_store() get PKG_MAX_WIN from
    pkg_power_sku when it is valid (Ashutosh)
  - KernelVersion: 6.2, Date: February 2023 in doc (Tvrtko)
v5: On some of the DGFX setups it is seen that although pkg_power_sku
    is valid the field PKG_WIN_MAX is not populated. So it is
    decided to stick to default value of PKG_WIN_MAX (Ashutosh)
v6: Change contact to intel-gfx (Rodrigo)
    Fixed variable types in hwm_power1_max_interval_store (Andi)
    Documented PKG_MAX_WIN_DEFAULT (Andi)
    Removed else in hwm_attributes_visible (Andi)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221013154526.2105579-7-ashutosh.dixit@intel.com
Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
drivers/gpu/drm/i915/i915_hwmon.c
drivers/gpu/drm/i915/intel_mchbar_regs.h