aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajesh Shah <rajesh.shah@intel.com>2006-05-23 13:14:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 15:00:00 -0400
commit020d502488bebdbc1b2c2828d996f04e563f082a (patch)
tree101cf0138612137dc08844dff137f927ed0a3b8b
parent1edab4a164b229807853682f7ff7858c11dd3481 (diff)
[PATCH] PCI: Allow MSI to work on kexec kernel
We recently ran into a problem where the e1000 device failed to work properly on the kexec kernel. MSI was enabled for the device in the main kernel when it crashed. The e1000 driver tried to enable MSI on the kexec kernel, but the code bailed early when it found that MSI was already enabled in the hardware, even though the software state was not properly set up in the kexec'd kernel. This patch fixes the problem by moving the early return to after making sure that the software state is properly initialized. Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/pci/msi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 4aea563bda60..9c69b6966e79 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -940,14 +940,13 @@ int pci_enable_msi(struct pci_dev* dev)
940 if (!pos) 940 if (!pos)
941 return -EINVAL; 941 return -EINVAL;
942 942
943 pci_read_config_word(dev, msi_control_reg(pos), &control);
944 if (control & PCI_MSI_FLAGS_ENABLE)
945 return 0; /* Already in MSI mode */
946
947 if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) { 943 if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
948 /* Lookup Sucess */ 944 /* Lookup Sucess */
949 unsigned long flags; 945 unsigned long flags;
950 946
947 pci_read_config_word(dev, msi_control_reg(pos), &control);
948 if (control & PCI_MSI_FLAGS_ENABLE)
949 return 0; /* Already in MSI mode */
951 spin_lock_irqsave(&msi_lock, flags); 950 spin_lock_irqsave(&msi_lock, flags);
952 if (!vector_irq[dev->irq]) { 951 if (!vector_irq[dev->irq]) {
953 msi_desc[dev->irq]->msi_attrib.state = 0; 952 msi_desc[dev->irq]->msi_attrib.state = 0;