aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 7c2a9dd6f6a4..b3e700d2a7f7 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -168,6 +168,9 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
168 168
169 mutex_lock(&ctrl->ctrl_lock); 169 mutex_lock(&ctrl->ctrl_lock);
170 170
171 /* Wait for any previous command that might still be in progress */
172 pcie_wait_cmd(ctrl);
173
171 pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); 174 pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
172 if (slot_status & PCI_EXP_SLTSTA_CC) { 175 if (slot_status & PCI_EXP_SLTSTA_CC) {
173 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, 176 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
@@ -200,10 +203,6 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
200 pcie_capability_write_word(pdev, PCI_EXP_SLTCTL, slot_ctrl); 203 pcie_capability_write_word(pdev, PCI_EXP_SLTCTL, slot_ctrl);
201 ctrl->slot_ctrl = slot_ctrl; 204 ctrl->slot_ctrl = slot_ctrl;
202 205
203 /*
204 * Wait for command completion.
205 */
206 pcie_wait_cmd(ctrl);
207 mutex_unlock(&ctrl->ctrl_lock); 206 mutex_unlock(&ctrl->ctrl_lock);
208} 207}
209 208