From b99e17ee9c84f36781589f0336f21d8032f1b967 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler Date: Tue, 9 Jun 2020 12:48:38 -0700 Subject: [PATCH] drmgr: don't bother with hp children for non PCI slots Only PCI devices have hotpluggable children. So, there is no need to call disable_hp_children() or release_hp_children() for non-PCI devices. In particular this causes messages for VIO slots, that while harmless, could lead a user to misinterpret as actual errors. linux-xej6:~/powerpc-utils # drmgr -c slot -r -s U8408.E8E.10A7ACV-V1-C3 Validating I/O DLPAR capability...yes. failed to open /sys/bus/pci/slots/U8408.E8E.10A7ACV-V1-C3/power: No such file or directory failed to disable hotplug children In remove_slot() check that the device type is PCI_DLPAR_DEV before calling (disable|release)_hp_children(). Signed-off-by: Tyrel Datwyler --- src/drmgr/drslot_chrp_slot.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/drmgr/drslot_chrp_slot.c b/src/drmgr/drslot_chrp_slot.c index 65bf760..0966c25 100644 --- a/src/drmgr/drslot_chrp_slot.c +++ b/src/drmgr/drslot_chrp_slot.c @@ -93,14 +93,17 @@ remove_slot(struct dr_node *node) return -1; } - rc = disable_hp_children(node->drc_name); - if (rc) - say(ERROR, "failed to disable hotplug children\n"); + /* For PCI nodes */ + if (node->dev_type == PCI_DLPAR_DEV) { + rc = disable_hp_children(node->drc_name); + if (rc) + say(ERROR, "failed to disable hotplug children\n"); - rc = release_hp_children(node->drc_name); - if (rc && rc != -EINVAL) { - say(ERROR, "failed to release hotplug children\n"); - return rc; + rc = release_hp_children(node->drc_name); + if (rc && rc != -EINVAL) { + say(ERROR, "failed to release hotplug children\n"); + return rc; + } } say(DEBUG, "The sensor-state of drc_index 0x%x is %d\n", -- 2.39.3