Commit Graph

2 Commits

Author SHA1 Message Date
Jon Hunter
6fa354a3b2 thermal: tegra-oc-event: Fix warning
Building the tegra-oc-event driver generates the following warning ...

 drivers/thermal/tegra234-oc-event.c:180:31: warning: assignment discards
 ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   180 |         tegra234_oc->soc_data = match->data;                                                                                                                                                                                                |                               ^

Fix this by correcting the type for the soc_data structure member.

Bug 4190030

Change-Id: I8879186dfbf247eea57266281f489d57c9675292
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934695
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Yi-Wei Wang <yiweiw@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-12 19:11:48 -07:00
Yi-Wei Wang
b270392b4f drivers: thermal: Add Tegra234 OC event driver
SOC_THERM is the primary hardware component of Tegra on-die thermal
management strategies. SOC_THERM includes the function of
externally-signaled event detection (SOC_THERM_edp) which centralizes
a few mechanisms for detecting and responding to externally signaled
electrical events, such as overcurrent events, undervoltage events, and
so on. These are known as "OC alarms" because they often indicate an
overcurrent event.

The Jetson Module's on-board power monitor INA3221 is configured to
trigger CPU/GPU hardware clock throttling via Tegra234 SOCTHERM_OC when
the Module input current exceeds the preprogrammed overcurrent threshold
to keep Module power consumption within the TDP power budget.

CPU/GPU performance may drop when hardware clock throttling occurs.
To allow the user to infer whether the performance degradation is
related to the overcurrent event, the Tegra234 OC event driver is
implemented which sends a Message ReQuest (MRQ) to the BPMP firmware to
provide information regarding the overcurrent enable state and the event
count to userspace via the hwmon sysfs interface.

Bug 3571683

Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>
Change-Id: I6cc3579944efc92916189f097ccfed2ccba26051
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862007
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-17 07:03:26 -07:00