linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/shpchp: fix a bus speed issue on hotplug
@ 2014-05-01 14:35 Marcel Apfelbaum
  2014-05-01 15:43 ` Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Marcel Apfelbaum @ 2014-05-01 14:35 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-kernel, bhelgaas, matthew, mst, marcel.a

When a board is added, the shpchp driver checks if there
is a mismatch between the bridge's adapter and the bus speed.
If there is, it sets the subordinate speed (if there is no device on it).

However, it takes the reference of the board speed from the primary bus
and not from the subordinate. If the primary bus is PCI and not PCIX/PCIe,
its speed is not updated and remains 0xff. As a result hotplug fails
with error: "Speed of bus ff and adapter 0 mismatch".

Fixed that by checking the speed against the subordinate bus.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
 drivers/pci/hotplug/shpchp_ctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 5849927..6efc2ec 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -282,8 +282,8 @@ static int board_added(struct slot *p_slot)
 		return WRONG_BUS_FREQUENCY;
 	}
 
-	bsp = ctrl->pci_dev->bus->cur_bus_speed;
-	msp = ctrl->pci_dev->bus->max_bus_speed;
+	bsp = ctrl->pci_dev->subordinate->cur_bus_speed;
+	msp = ctrl->pci_dev->subordinate->max_bus_speed;
 
 	/* Check if there are other slots or devices on the same bus */
 	if (!list_empty(&ctrl->pci_dev->subordinate->devices))
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-05-17 18:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 14:35 [PATCH] PCI/shpchp: fix a bus speed issue on hotplug Marcel Apfelbaum
2014-05-01 15:43 ` Michael S. Tsirkin
2014-05-01 18:02 ` Bjorn Helgaas
2014-05-01 18:13   ` Marcel Apfelbaum
2014-05-01 18:57     ` Marcel Apfelbaum
2014-05-01 20:00       ` Bjorn Helgaas
2014-05-01 20:36         ` Marcel Apfelbaum
2014-05-04 10:40         ` Marcel Apfelbaum
2014-05-04 13:48 ` Ronen Hod
2014-05-04 14:07   ` Marcel Apfelbaum
2014-05-15 18:41 ` Bjorn Helgaas
2014-05-17 18:47   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).