Skip to content

hw/pmu.py - type int is not subscriptable #449

@step21

Description

@step21

When connecting to the proxy mode on a m3 max, I got an error like "type int is not subscriptable" on line 22 of proxyclient/m1n1/hw/pmu.py where it handles errors and resets the error counter. To bypass this, I checked for type, and if it's an int, I just use it directly without subscripting it. This seemed to work, but I have no idea if this is correct.

This is my hacky bypass:

diff --git a/proxyclient/m1n1/hw/pmu.py b/proxyclient/m1n1/hw/pmu.py
index b545df4..d416b21 100644
--- a/proxyclient/m1n1/hw/pmu.py
+++ b/proxyclient/m1n1/hw/pmu.py
@@ -21,8 +21,14 @@ class PMU:
 
    def reset_panic_counter(self):
        if self.primary:
-            leg_scrpad = self.node.info_leg__scrpad[0]
-            self.spmi.write8(self.reg, leg_scrpad + 2, 0) # error counts
+            print(f"type is {type(self.node.info_leg__scrpad)}")
+            if isinstance(self.node.info_leg__scrpad, int):
+                print("Note: type int is not subscriptable")
+                leg_scrpad = self.node.info_leg__scrpad
+                self.spmi.write8(self.reg, leg_scrpad + 2, 0) # maybe still error counts?
+            else:
+                leg_scrpad = self.node.info_leg__scrpad[0]
+                self.spmi.write8(self.reg, leg_scrpad + 2, 0) # error counts
 
    @staticmethod
    def find_primary_pmu(adt):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions