Merge amd-staging into amd-master 20241106

Signed-off-by: Zhang Ava <niandong.zhang@amd.com>
Change-Id: Ib125dee62e5a893871f5c6df7715177973361a02
This commit is contained in:
Zhang Ava
2024-11-08 08:42:13 +08:00
4 changed files with 44 additions and 11 deletions
+11 -8
View File
@@ -89,14 +89,17 @@ validClockNames.sort()
def driverInitialized():
""" Returns true if amdgpu is found in the list of initialized modules
"""
driverInitialized = ''
try:
driverInitialized = str(subprocess.check_output("cat /sys/module/amdgpu/initstate |grep live", shell=True))
except subprocess.CalledProcessError:
pass
if len(driverInitialized) > 0:
return True
return False
driverInitialized = False
if os.path.exists("/sys/module/amdgpu") :
if os.path.exists("/sys/module/amdgpu/initstate"):
# amdgpu is loadable module
with open("/sys/module/amdgpu/initstate") as initstate:
if 'live' in initstate.read():
driverInitialized = True
else:
# amdgpu is built into the kernel
driverInitialized = True
return driverInitialized
def formatJson(device, log):