Skip to content

Commit

Permalink
Rescan the root bus when a new mux is added
Browse files Browse the repository at this point in the history
FRU devices can be incorrectly associated with rootbus after BMC reset 
if a MUX was left open during shutdown. This prevents the scanning of 
the same addresses on other legs of the MUX and few FRU devices are 
missing under FRU list. Rescan the rootbus before scanning the mux 
channel removes these devices from the rootbus. Next scan on the mux 
channel will find these devices on the correct logic bus.

Without Fix, when 5 HSBPs connected to system:
    before cold reset:
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_0
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_1
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_2
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_3

    after cold reset:
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_0
        |-/xyz/openbmc_project/FruDevice/BHS2U8X4U2HSBP_1

Tested: Tested and verified that all FRU devices are scanning properly.

Change-Id: I470fe49084697a179d8f7b5241d342ef02964e39
Signed-off-by: PavanKumarIntel <pavanx.kumar.martha@intel.com>
  • Loading branch information
PavanMarthaIntel authored and ZhikuiRen committed Mar 16, 2023
1 parent 6e22c87 commit 7fc486f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fru_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,15 @@ int main()
<< "\n";
continue;
}
int rootBus = getRootBus(bus);
if (rootBus >= 0)
{
rescanOneBus(busMap,
static_cast<uint16_t>(rootBus),
dbusInterfaceMap, false,
unknownBusObjectCount, powerIsOn,
objServer, systemBus);
}
rescanOneBus(busMap, static_cast<uint16_t>(bus),
dbusInterfaceMap, false,
unknownBusObjectCount, powerIsOn,
Expand Down

0 comments on commit 7fc486f

Please sign in to comment.