diff options
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 720dfe5fc48a..a3a5c65def1c 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -185,7 +185,6 @@ static void pcie_wait_cmd(struct controller *ctrl) | |||
185 | static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) | 185 | static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) |
186 | { | 186 | { |
187 | struct pci_dev *pdev = ctrl_dev(ctrl); | 187 | struct pci_dev *pdev = ctrl_dev(ctrl); |
188 | u16 slot_status; | ||
189 | u16 slot_ctrl; | 188 | u16 slot_ctrl; |
190 | 189 | ||
191 | mutex_lock(&ctrl->ctrl_lock); | 190 | mutex_lock(&ctrl->ctrl_lock); |
@@ -193,30 +192,6 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) | |||
193 | /* Wait for any previous command that might still be in progress */ | 192 | /* Wait for any previous command that might still be in progress */ |
194 | pcie_wait_cmd(ctrl); | 193 | pcie_wait_cmd(ctrl); |
195 | 194 | ||
196 | pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); | ||
197 | if (slot_status & PCI_EXP_SLTSTA_CC) { | ||
198 | pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, | ||
199 | PCI_EXP_SLTSTA_CC); | ||
200 | if (!ctrl->no_cmd_complete) { | ||
201 | /* | ||
202 | * After 1 sec and CMD_COMPLETED still not set, just | ||
203 | * proceed forward to issue the next command according | ||
204 | * to spec. Just print out the error message. | ||
205 | */ | ||
206 | ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n"); | ||
207 | } else if (!NO_CMD_CMPL(ctrl)) { | ||
208 | /* | ||
209 | * This controller seems to notify of command completed | ||
210 | * event even though it supports none of power | ||
211 | * controller, attention led, power led and EMI. | ||
212 | */ | ||
213 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Need to wait for command completed event\n"); | ||
214 | ctrl->no_cmd_complete = 0; | ||
215 | } else { | ||
216 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Maybe the controller is broken\n"); | ||
217 | } | ||
218 | } | ||
219 | |||
220 | pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, &slot_ctrl); | 195 | pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, &slot_ctrl); |
221 | slot_ctrl &= ~mask; | 196 | slot_ctrl &= ~mask; |
222 | slot_ctrl |= (cmd & mask); | 197 | slot_ctrl |= (cmd & mask); |
@@ -796,14 +771,14 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
796 | mutex_init(&ctrl->ctrl_lock); | 771 | mutex_init(&ctrl->ctrl_lock); |
797 | init_waitqueue_head(&ctrl->queue); | 772 | init_waitqueue_head(&ctrl->queue); |
798 | dbg_ctrl(ctrl); | 773 | dbg_ctrl(ctrl); |
774 | |||
799 | /* | 775 | /* |
800 | * Controller doesn't notify of command completion if the "No | 776 | * Controller doesn't notify of command completion if the "No |
801 | * Command Completed Support" bit is set in Slot Capability | 777 | * Command Completed Support" bit is set in Slot Capabilities. |
802 | * register or the controller supports none of power | 778 | * If set, it means the controller can accept hotplug commands |
803 | * controller, attention led, power led and EMI. | 779 | * with no delay between them. |
804 | */ | 780 | */ |
805 | if (NO_CMD_CMPL(ctrl) || | 781 | if (NO_CMD_CMPL(ctrl)) |
806 | !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl))) | ||
807 | ctrl->no_cmd_complete = 1; | 782 | ctrl->no_cmd_complete = 1; |
808 | 783 | ||
809 | /* Check if Data Link Layer Link Active Reporting is implemented */ | 784 | /* Check if Data Link Layer Link Active Reporting is implemented */ |