From rshah1@unix-os.sc.intel.com Tue Aug 16 22:28:36 2005
Date: Tue, 16 Aug 2005 17:32:04 -0700
From: Rajesh Shah <rajesh.shah@intel.com>
To: gregkh@suse.de, kristen.c.accardi@intel.com,
	pcihpd-discuss@lists.sourceforge.net
Cc: Martin.Franc@ca.kontron.com, mario.lorenzini@ca.kontron.com,
	Sebastien.Bouchard@ca.kontron.com
Subject: PCI: Fix PCI bus mastering enable problem in pciehp
Message-ID: <20050816173203.A24471@unix-os.sc.intel.com>

Martin Franc reported that the pciehp driver was not enabling bus
master capability on his hot-plugged card. pciehprm_enable_card()
was updating the PCI command register only if _HPP indicated a
value for SERR or PERR that was different from the current setting.
I don't have hardware that reproduces this problem, but Martin
reports that this patch fixes the problem for him.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/hotplug/pciehprm_acpi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- gregkh-2.6.orig/drivers/pci/hotplug/pciehprm_acpi.c	2005-08-28 16:41:01.000000000 -0700
+++ gregkh-2.6/drivers/pci/hotplug/pciehprm_acpi.c	2005-09-09 13:51:46.000000000 -0700
@@ -1696,15 +1696,15 @@ void pciehprm_enable_card(
 	pci_bus->number = func->bus;
 	devfn = PCI_DEVFN(func->device, func->function);
 
-	rc = pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &command);
+	rc = pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &cmd);
 
 	if (card_type == PCI_HEADER_TYPE_BRIDGE) {
-		rc = pci_bus_read_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, &bcommand);
+		rc = pci_bus_read_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, &bcmd);
 	}
 
-	cmd = command  = command | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE
+	command  = cmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE
 		| PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
-	bcmd = bcommand  = bcommand | PCI_BRIDGE_CTL_NO_ISA;
+	bcommand  = bcmd | PCI_BRIDGE_CTL_NO_ISA;
 
 	ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus);
 	if (ab) {
