From ae416e6b2936fdb70aeee6eb9066115d4521daa6 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Fri, 25 Apr 2008 14:39:06 -0700 Subject: pciehp: Fix wrong slot capability check Current pciehp saves only 8bits of Slot Capability registers in ctrl->ctrlcap. But it refers more than 8bit for checking EMI capability. It is clearly a bug and EMI would never work. To fix this problem, this patch saves full Slot Capability contens in ctrl->slot_cap. It also reduce the redundant reads of Slot Capability register. And this pach also cleans up the macros to check the slot capabilitys (e.g. MRL_SENS(), and so on). Signed-off-by: Kenji Kaneshige Signed-off-by: Kristen Carlson Accardi Signed-off-by: Jesse Barnes --- drivers/pci/hotplug/pciehp_hpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/pci/hotplug/pciehp_hpc.c') diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 7104a15e2661..58f8018970fa 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -1058,11 +1058,11 @@ int pcie_init_hardware_part2(struct controller *ctrl, struct pcie_device *dev) } cmd = PRSN_DETECT_ENABLE; - if (ATTN_BUTTN(ctrl->ctrlcap)) + if (ATTN_BUTTN(ctrl)) cmd |= ATTN_BUTTN_ENABLE; - if (POWER_CTRL(ctrl->ctrlcap)) + if (POWER_CTRL(ctrl)) cmd |= PWR_FAULT_DETECT_ENABLE; - if (MRL_SENS(ctrl->ctrlcap)) + if (MRL_SENS(ctrl)) cmd |= MRL_DETECT_ENABLE; if (!pciehp_poll_mode) cmd |= HP_INTR_ENABLE; @@ -1181,7 +1181,7 @@ int pcie_init(struct controller *ctrl, struct pcie_device *dev) ctrl->slot_device_offset = 0; ctrl->num_slots = 1; ctrl->first_slot = slot_cap >> 19; - ctrl->ctrlcap = slot_cap & 0x0000007f; + ctrl->slot_cap = slot_cap; rc = pcie_init_hardware_part1(ctrl, dev); if (rc) -- cgit v1.2.3