15 Révisions

Auteur SHA1 Message Date
Mario Limonciello (AMD) c9eddf75e7 Remove unnecessary includes
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>


[ROCm/amdsmi commit: 924a06d1e1]
2025-09-05 17:44:17 -05:00
Liu, Shuzhou (Bill) 4f750bd4d5 Change default mutex to thread only (#104)
Most sysfs reads do not require cross-process level mutex, and writes to sysfs
should be protected by the kernel already.
Users can still switch to the old behavior by setting the environment variable AMDSMI_MUTEX_CROSS_PROCESS=1.


[ROCm/amdsmi commit: 8e74024b11]
2025-02-11 07:27:03 -06:00
Joe Narlo bad2cc9c23 SWDEV-495787 [AMDSMI] Different license headers
Change copyrights to MIT and remove date

Signed-off-by: Joe Narlo <Joseph.Narlo@amd.com>
Change-Id: I16f5b412f2b9ddefaaa1771aa714cc18829a1be4


[ROCm/amdsmi commit: 3052ad4220]
2024-11-22 08:55:28 -05:00
Eisuke Kawashima efed731082 chore: unset executable permission
Change-Id: I06727774f3b1657a7955b172a40d0dfc9c76d6b9
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 1b6ec8df07]
2024-09-16 17:34:39 -04:00
Maisam Arif c2b9cdfd2e Udpated License Dates
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I8ca199c129c06508bc3e23745ab5ac2d20dce928


[ROCm/amdsmi commit: 105db1afcd]
2024-09-16 16:14:47 -04:00
Galantsev, Dmitrii 815e607285 Fix missing c_str() introduced in c63ea0e
Change-Id: Ife778276aaebd109a413efb3db703de36b730613
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 47c8cd10cf]
2024-07-19 19:12:17 -04:00
Maisam Arif c63ea0e5e0 [SWDEV-474450] Removed DEVICE_MUTEX from gpu_reset
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I706fb47288738bfbde94b56fee66bbf807b3c0cb


[ROCm/amdsmi commit: 8bc8307c60]
2024-07-19 11:47:52 -04:00
Bill(Shuzhou) Liu 39f37c5d33 Remove thread safe only mutex warning message
In multiple GPUs environment, too many warning messages generated,
and then need to be removed.

Change-Id: I275de2397eb0e6b189e2e17e94335cb1e8f97815


[ROCm/amdsmi commit: 78ee3f5e5a]
2024-07-18 20:43:57 -05:00
Bill(Shuzhou) Liu a1aec9c971 Support thread only mutex
The environment variable RSMI_MUTEX_THREAD_ONLY=1 to enable thread only mutex.
The RSMI_INIT_FLAG_THRAD_ONLY_MUTEX can also be pass to rsmi_init()
to enable thread only mutex.

Change-Id: I2d9844039b774e386f03bb9bb130d8c342504ea6


[ROCm/amdsmi commit: dbba33d3f5]
2024-07-18 20:43:38 -05:00
Bill(Shuzhou) Liu eb04dbc1c9 Unlock the mutex when process is dead
After the dead process is detected, pthread_mutex_consistent() will
be called. After that, the pthread_mutex_unlock() should also be
called to unlock it: "It is the responsibility of the application to
recover the state so it can be reused."

Change-Id: I45d3e2e68c3b06779f3acb1e908dbec0c6a39297


[ROCm/amdsmi commit: 06b9232a56]
2024-07-18 20:43:21 -05:00
Maisam Arif 0a20cc33ab Updated License Dates
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Id6fd66b03c602232ecc1a063a534a15fe3a03f56


[ROCm/amdsmi commit: 5dba2f3120]
2023-11-07 03:57:08 -05:00
Bill(Shuzhou) Liu a4c1afe5d4 SWDEV-400644: Reset the mutex only if errors
To prevent reset the mutex while using it, only reset the mutex
if it cannot acquire it.

Change-Id: I95e0ed1bf543f285ce81b4df9c51e16a88081d38


[ROCm/amdsmi commit: 160c99d12d]
2023-05-22 11:20:44 -04:00
Bill(Shuzhou) Liu db11ee60a0 Remove the shared mutex if no process is using it
If the code is crashed and the mutex may be in bad status. The user
has to mannually remove it. The fix will remove the shared mutex
if no process is using it.

Change-Id: I18bf562f2e0a7de8b3f0cccf72d60950b0d9bb2d


[ROCm/amdsmi commit: 76b5528feb]
2022-11-22 10:30:58 -05:00
Chris Freehill 3be45e2ea9 Fix process killed while holding mutex
Previously, when a process holding a shared mutex was killed,
the next time an RSMI application was started, it would not be
able to obtain the mutex--the application would have to exit.
This fix uses pthread_mutexattr_setrobust() to detect this
situation and act accordingingly.

Also, add some missing, needed mutexes and move mutexes
closer to where the protect resource is used.

Change-Id: Icfdc3a246f4cfa3fd008e3f13472199abd76fd35


[ROCm/amdsmi commit: f4938b0ac9]
2020-12-04 12:59:55 -05:00
Chris Freehill 9e57932639 Refactor rsmi to support oam
Change-Id: Idc524e01ba06eb5c8d1682becaf5bf8ced5bffcf


[ROCm/amdsmi commit: 6594f8f58b]
2020-06-22 18:51:46 -05:00