Skip to content

acctonbmc: Fix oob-mdio-util.sh write operation#268

Open
louis-nexthop wants to merge 1 commit into
facebook:heliumfrom
nexthop-ai:acctonbmc-fix-oob-mdio-util
Open

acctonbmc: Fix oob-mdio-util.sh write operation#268
louis-nexthop wants to merge 1 commit into
facebook:heliumfrom
nexthop-ai:acctonbmc-fix-oob-mdio-util

Conversation

@louis-nexthop

Copy link
Copy Markdown

Description

Fix bug in the write operation of oob-mdio-util.sh.

  1. data is the forth argument, not the third.
  2. ctrl_cmd must be in hex representation because mdio-util expects it here. So, I used printf "0x%08X", similar to how it's done for the read operation.

Motivation

oob-mdio-util.sh has a bug when doing a register write to the OOB management switch.

Test Plan

Before:
Note: usage is oob-mdio-util.sh {read|write} <port> <offset> [<value>]

root@bmc-oob:~# oob-mdio-util.sh read 1 0x7
Write to PHY 0x12.0x0, value is 0x9a27
Read from PHY 0x12.0x1, value is 0x1         # <----- Read: got 0x1

root@bmc-oob:~# oob-mdio-util.sh write 1 0x7 0xabcd
Write to PHY 0x12.0x1, value is 0x7
Write to PHY 0x12.0x0, value is 0x38439      # <----- Write: wrong command was sent. ctrl_cmd supposed to be a 16-bit value

root@bmc-oob:~# oob-mdio-util.sh read 1 0x7
Write to PHY 0x12.0x0, value is 0x9a27
Read from PHY 0x12.0x1, value is 0x1         # <----- Read back: WRONG! Still got 0x1

After:

root@bmc-oob:~# oob-mdio-util.sh read 1 0x7
Write to PHY 0x12.0x0, value is 0x9a27
Read from PHY 0x12.0x1, value is 0x1

root@bmc-oob:~# oob-mdio-util.sh write 1 0x7 0xabcd
Write to PHY 0x12.0x1, value is 0xabcd
Write to PHY 0x12.0x0, value is 0x9627        # <----- Write: correct value of ctrl_cmd

root@bmc-oob:~# oob-mdio-util.sh read 1 0x7
Write to PHY 0x12.0x0, value is 0x9a27
Read from PHY 0x12.0x1, value is 0xabcd       # <----- Read back: GOOD! Got the value we wrote

Signed-off-by: Louis Maliyam <louis@nexthop.ai>
@meta-cla meta-cla Bot added the CLA Signed label Jun 8, 2026
@louis-nexthop louis-nexthop changed the title [acctonbmc] Fix oob-mdio-util.sh write operation acctonbmc: Fix oob-mdio-util.sh write operation Jun 8, 2026
@meta-codesync

meta-codesync Bot commented Jun 8, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D107914551. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant