From: Michael R. <md...@li...> - 2015-05-18 23:55:51
|
Current code assumes that slots under a PHB are populated during PHB removal. As a result, we attempt to unconfigure the slot/adapter by powering it off, then checking for an 'unconfigured' state via get_hp_adaptor_status/DR_ENTITY_SENSE. However, if the slot is empty well get an 'emtpy' state instead. We can avoid this by simply not attempting to unconfigure/poweroff an adapter if the slot is empty, but it's possible we rely on this in some cases to safely power-off slots. Instead, simply allow DR_ENTITY_SENSE to report 'empty' after power-off in addition to 'unconfigured'. Signed-by-off: Michael Roth <md...@li...> --- src/drmgr/common_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drmgr/common_pci.c b/src/drmgr/common_pci.c index 64ca08f..119c352 100644 --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -1492,9 +1492,12 @@ enable_hp_children(char *drc_name) int disable_hp_children(char *drc_name) { if (get_hp_adapter_status(drc_name) != NOT_CONFIG) { + int status; + set_hp_adapter_status(PHP_UNCONFIG_ADAPTER, drc_name); + status = get_hp_adapter_status(drc_name); - if (get_hp_adapter_status(drc_name) != NOT_CONFIG) + if (status != NOT_CONFIG && status != EMPTY) return 1; } return 0; -- 1.9.1 |