From owner-linux-pci@atrey.karlin.mff.cuni.cz Mon Oct 31 16:32:31 2005 Message-Id: <20051101002124.779002843@csdlinux-2.jf.intel.com> Date: Mon, 31 Oct 2005 16:20:13 -0800 From: rajesh.shah@intel.com To: kristen.c.accardi@intel.com, gregkh@suse.de Cc: akpm@osdl.org, rajesh.shah@intel.com Subject: [patch 8/8] pciehp: fix handling of power faults during hotplug Content-Disposition: inline; filename=pciehp-fix-powerfault-handling The current pciehp implementation reports a power-fail error even if the condition has cleared by the time the corresponding interrupt handling code gets a chance to run. This patch fixes this problem. Signed-off-by: Rajesh Shah Signed-off-by: Greg Kroah-Hartman drivers/pci/hotplug/pciehp_hpc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- gregkh-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c 2005-11-02 10:58:40.000000000 -0800 +++ gregkh-2.6/drivers/pci/hotplug/pciehp_hpc.c 2005-11-02 10:58:41.000000000 -0800 @@ -481,7 +481,6 @@ u16 slot_status; u8 pwr_fault; int retval = 0; - u8 status; DBG_ENTER_ROUTINE @@ -493,15 +492,13 @@ retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(slot->ctrl->cap_base), slot_status); if (retval) { - err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__); + err("%s : Cannot check for power fault\n", __FUNCTION__); return retval; } pwr_fault = (u8)((slot_status & PWR_FAULT_DETECTED) >> 1); - status = (pwr_fault != 1) ? 1 : 0; DBG_LEAVE_ROUTINE - /* Note: Logic 0 => fault */ - return status; + return pwr_fault; } static int hpc_set_attention_status(struct slot *slot, u8 value)