Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hssi: increate timeout to 1 second #3132

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions binaries/hssi/ethernet/hssicommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
DEFAULT_BDF = 'ssss:bb:dd.f'

# mailbox register poll interval 1 microseconds
HSSI_POLL_SLEEP_TIME = 1/1000000
HSSI_POLL_SLEEP_TIME_SEC = 1/1000000

# mailbox register poll timeout 500 microseconds
HSSI_POLL_TIMEOUT = 5/10000
# Mailbox register poll timeout 1 second. Responses are typically much
# faster than one second, but in rare cases can take a while. No reason
# to make this short since timeout is generally a failure.
HSSI_POLL_TIMEOUT_SEC = 1

HSSI_FEATURE_ID = 0x15

Expand Down Expand Up @@ -1185,11 +1187,11 @@ def clear_reg_bits(self,
idx, width, 0)
self.write32(region_index, reg_offset, value)

time.sleep(HSSI_POLL_SLEEP_TIME)
if total_time > HSSI_POLL_TIMEOUT:
time.sleep(HSSI_POLL_SLEEP_TIME_SEC)
if total_time > HSSI_POLL_TIMEOUT_SEC:
return False

total_time = HSSI_POLL_SLEEP_TIME + total_time
total_time = HSSI_POLL_SLEEP_TIME_SEC + total_time
return False

def clear_reg(self,
Expand All @@ -1209,11 +1211,11 @@ def clear_reg(self,
return True
self.write32(region_index, reg_offset, 0x0)

time.sleep(HSSI_POLL_SLEEP_TIME)
if total_time > HSSI_POLL_TIMEOUT:
time.sleep(HSSI_POLL_SLEEP_TIME_SEC)
if total_time > HSSI_POLL_TIMEOUT_SEC:
return False

total_time = HSSI_POLL_SLEEP_TIME + total_time
total_time = HSSI_POLL_SLEEP_TIME_SEC + total_time

return False

Expand Down Expand Up @@ -1262,10 +1264,10 @@ def read_poll_timeout(self,
if ((reg_data >> bit_index) & 1) == 1:
return True

time.sleep(HSSI_POLL_SLEEP_TIME)
if total_time > HSSI_POLL_TIMEOUT:
time.sleep(HSSI_POLL_SLEEP_TIME_SEC)
if total_time > HSSI_POLL_TIMEOUT_SEC:
return False
total_time = HSSI_POLL_SLEEP_TIME + total_time
total_time = HSSI_POLL_SLEEP_TIME_SEC + total_time

return False

Expand Down
Loading