Skip to content

Commit

Permalink
move seek to beginning of sysfs fd before reading to resolve power_good
Browse files Browse the repository at this point in the history
sysfs returns empty upon plug out cable
  • Loading branch information
dbarashinvd committed Dec 27, 2023
1 parent debcb58 commit 28ee46f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def run(self):
module_fd_path = module_obj.module_power_good_fd_path
self.fds_events_count_dict[module_obj.port_num][fd_name] += 1
try:
val = module_fd.read()
module_fd.seek(0)
val = module_fd.read()
logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}"
.format(module_obj, module_obj.port_num, fd, module_fd_path
, val, self.fds_events_count_dict[module_obj.port_num]))
Expand Down

0 comments on commit 28ee46f

Please sign in to comment.