From e9c61588384e324f1e85779fa55f9e35024ab2e6 Mon Sep 17 00:00:00 2001 From: hexin Date: Thu, 15 Aug 2019 17:44:06 +0800 Subject: [PATCH] virpci:fix Secondary Bus Reset bug The parent bridge configuration of the current device should be read and reset, instead of reading the current device configuration. Signed-off-by: He Xin Signed-off-by: Liu Qi Signed-off-by: Zhang Yu Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- src/util/virpci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 7ca755c1a8..4c7c26f981 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -839,7 +839,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev, /* Read the control register, set the reset flag, wait 200ms, * unset the reset flag and wait 200ms. */ - ctl = virPCIDeviceRead16(dev, cfgfd, PCI_BRIDGE_CONTROL); + ctl = virPCIDeviceRead16(dev, parentfd, PCI_BRIDGE_CONTROL); virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL, ctl | PCI_BRIDGE_CTL_RESET);