diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-10-05 04:40:48 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-04 12:01:28 -0500 |
commit | 3c3a1b1759616e6603027108f8abcbec54271e62 (patch) | |
tree | a6976122e885e46633ebfaceae413e4efb39c00b /drivers/pci/hotplug/pciehp_hpc.c | |
parent | f22daf1fb9970f1565f224a0951ba58b5d044605 (diff) |
PCI: pciehp: remove wrong workaround for bad DLLP
Remove wrong workaround for BAD DLLP error, which confused surprise
down error with DLL errors.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 36f8545a281..88b654ec5af 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -535,54 +535,12 @@ int pciehp_power_on_slot(struct slot * slot) | |||
535 | return retval; | 535 | return retval; |
536 | } | 536 | } |
537 | 537 | ||
538 | static inline int pcie_mask_bad_dllp(struct controller *ctrl) | ||
539 | { | ||
540 | struct pci_dev *dev = ctrl->pcie->port; | ||
541 | int pos; | ||
542 | u32 reg; | ||
543 | |||
544 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | ||
545 | if (!pos) | ||
546 | return 0; | ||
547 | pci_read_config_dword(dev, pos + PCI_ERR_COR_MASK, ®); | ||
548 | if (reg & PCI_ERR_COR_BAD_DLLP) | ||
549 | return 0; | ||
550 | reg |= PCI_ERR_COR_BAD_DLLP; | ||
551 | pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, reg); | ||
552 | return 1; | ||
553 | } | ||
554 | |||
555 | static inline void pcie_unmask_bad_dllp(struct controller *ctrl) | ||
556 | { | ||
557 | struct pci_dev *dev = ctrl->pcie->port; | ||
558 | u32 reg; | ||
559 | int pos; | ||
560 | |||
561 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | ||
562 | if (!pos) | ||
563 | return; | ||
564 | pci_read_config_dword(dev, pos + PCI_ERR_COR_MASK, ®); | ||
565 | if (!(reg & PCI_ERR_COR_BAD_DLLP)) | ||
566 | return; | ||
567 | reg &= ~PCI_ERR_COR_BAD_DLLP; | ||
568 | pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, reg); | ||
569 | } | ||
570 | |||
571 | int pciehp_power_off_slot(struct slot * slot) | 538 | int pciehp_power_off_slot(struct slot * slot) |
572 | { | 539 | { |
573 | struct controller *ctrl = slot->ctrl; | 540 | struct controller *ctrl = slot->ctrl; |
574 | u16 slot_cmd; | 541 | u16 slot_cmd; |
575 | u16 cmd_mask; | 542 | u16 cmd_mask; |
576 | int retval = 0; | 543 | int retval; |
577 | int changed; | ||
578 | |||
579 | /* | ||
580 | * Set Bad DLLP Mask bit in Correctable Error Mask | ||
581 | * Register. This is the workaround against Bad DLLP error | ||
582 | * that sometimes happens during turning power off the slot | ||
583 | * which conforms to PCI Express 1.0a spec. | ||
584 | */ | ||
585 | changed = pcie_mask_bad_dllp(ctrl); | ||
586 | 544 | ||
587 | slot_cmd = POWER_OFF; | 545 | slot_cmd = POWER_OFF; |
588 | cmd_mask = PCI_EXP_SLTCTL_PCC; | 546 | cmd_mask = PCI_EXP_SLTCTL_PCC; |
@@ -595,16 +553,11 @@ int pciehp_power_off_slot(struct slot * slot) | |||
595 | retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); | 553 | retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); |
596 | if (retval) { | 554 | if (retval) { |
597 | ctrl_err(ctrl, "Write command failed!\n"); | 555 | ctrl_err(ctrl, "Write command failed!\n"); |
598 | retval = -1; | 556 | return retval; |
599 | goto out; | ||
600 | } | 557 | } |
601 | ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", | 558 | ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", |
602 | __func__, ctrl->cap_base + PCI_EXP_SLTCTL, slot_cmd); | 559 | __func__, ctrl->cap_base + PCI_EXP_SLTCTL, slot_cmd); |
603 | out: | 560 | return 0; |
604 | if (changed) | ||
605 | pcie_unmask_bad_dllp(ctrl); | ||
606 | |||
607 | return retval; | ||
608 | } | 561 | } |
609 | 562 | ||
610 | static irqreturn_t pcie_isr(int irq, void *dev_id) | 563 | static irqreturn_t pcie_isr(int irq, void *dev_id) |