tici IRQ tuning (#24170)

* first pass

* move that back

* move that

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: cf6c0ef19a
taco
Adeeb Shihadeh 3 years ago committed by GitHub
parent 1e3ae0a704
commit 9ce9e38cf7
  1. 23
      selfdrive/hardware/tici/hardware.py

@ -58,6 +58,9 @@ MM_MODEM_ACCESS_TECHNOLOGY_LTE = 1 << 14
def sudo_write(val, path): def sudo_write(val, path):
os.system(f"sudo su -c 'echo {val} > {path}'") os.system(f"sudo su -c 'echo {val} > {path}'")
def affine_irq(val, irq):
sudo_write(str(val), f"/proc/irq/{irq}/smp_affinity_list")
class Tici(HardwareBase): class Tici(HardwareBase):
@cached_property @cached_property
@ -419,6 +422,12 @@ class Tici(HardwareBase):
gov = 'ondemand' if powersave_enabled else 'performance' gov = 'ondemand' if powersave_enabled else 'performance'
sudo_write(gov, f"/sys/devices/system/cpu/cpufreq/policy{n}/scaling_governor") sudo_write(gov, f"/sys/devices/system/cpu/cpufreq/policy{n}/scaling_governor")
# *** IRQ config ***
affine_irq(5, 565) # kgsl-3d0
affine_irq(4, 740) # xhci-hcd:usb1 goes on the boardd core
for irq in range(237, 246):
affine_irq(5, irq) # camerad
def get_gpu_usage_percent(self): def get_gpu_usage_percent(self):
try: try:
used, total = open('/sys/class/kgsl/kgsl-3d0/gpubusy').read().strip().split() used, total = open('/sys/class/kgsl/kgsl-3d0/gpubusy').read().strip().split()
@ -432,6 +441,14 @@ class Tici(HardwareBase):
# Allow thermald to write engagement status to kmsg # Allow thermald to write engagement status to kmsg
os.system("sudo chmod a+w /dev/kmsg") os.system("sudo chmod a+w /dev/kmsg")
# *** IRQ config ***
# move these off the default core
affine_irq(1, 7) # msm_drm
affine_irq(1, 250) # msm_vidc
affine_irq(1, 8) # i2c_geni (sensord)
sudo_write("f", "/proc/irq/default_smp_affinity")
# *** GPU config *** # *** GPU config ***
sudo_write("0", "/sys/class/kgsl/kgsl-3d0/min_pwrlevel") sudo_write("0", "/sys/class/kgsl/kgsl-3d0/min_pwrlevel")
sudo_write("0", "/sys/class/kgsl/kgsl-3d0/max_pwrlevel") sudo_write("0", "/sys/class/kgsl/kgsl-3d0/max_pwrlevel")
@ -472,3 +489,9 @@ class Tici(HardwareBase):
pass pass
return r return r
if __name__ == "__main__":
t = Tici()
t.initialize_hardware()
t.set_power_save(False)

Loading…
Cancel
Save