Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 301970 Details for
Bug 432451
[RHEL5] Setting IRQ affinity does not work with MSI devices
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
fix smp_affinity for MSI
rhel5-all-5-patches.diff (text/plain), 5.62 KB, created by
Michal Schmidt
on 2008-04-10 12:50:00 UTC
(
hide
)
Description:
fix smp_affinity for MSI
Filename:
MIME Type:
Creator:
Michal Schmidt
Created:
2008-04-10 12:50:00 UTC
Size:
5.62 KB
patch
obsolete
>diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c >index 7922259..43946a2 100644 >--- a/drivers/pci/msi.c >+++ b/drivers/pci/msi.c >@@ -61,24 +61,43 @@ static int msi_cache_init(void) > return 0; > } > >+static void msi_set_enable(struct pci_dev *dev, int enable) >+{ >+ int pos; >+ u16 control; >+ >+ pos = pci_find_capability(dev, PCI_CAP_ID_MSI); >+ if (pos) { >+ pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control); >+ control &= ~PCI_MSI_FLAGS_ENABLE; >+ if (enable) >+ control |= PCI_MSI_FLAGS_ENABLE; >+ pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); >+ } >+} >+ > static void msi_set_mask_bit(unsigned int vector, int flag) > { > struct msi_desc *entry; > > entry = (struct msi_desc *)msi_desc[vector]; >- if (!entry || !entry->dev || !entry->mask_base) >+ if (!entry || !entry->dev) > return; > switch (entry->msi_attrib.type) { > case PCI_CAP_ID_MSI: > { >- int pos; >- u32 mask_bits; >- >- pos = (long)entry->mask_base; >- pci_read_config_dword(entry->dev, pos, &mask_bits); >- mask_bits &= ~(1); >- mask_bits |= flag; >- pci_write_config_dword(entry->dev, pos, mask_bits); >+ if (entry->msi_attrib.maskbit) { >+ int pos; >+ u32 mask_bits; >+ >+ pos = (long)entry->mask_base; >+ pci_read_config_dword(entry->dev, pos, &mask_bits); >+ mask_bits &= ~(1); >+ mask_bits |= flag; >+ pci_write_config_dword(entry->dev, pos, mask_bits); >+ } else { >+ msi_set_enable(entry->dev, !flag); >+ } > break; > } > case PCI_CAP_ID_MSIX: >@@ -86,6 +105,7 @@ static void msi_set_mask_bit(unsigned int vector, int flag) > int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + > PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET; > writel(flag, entry->mask_base + offset); >+ readl(entry->mask_base + offset); > break; > } > default: >@@ -173,7 +193,7 @@ static void unmask_MSI_irq(unsigned int vector) > msi_set_mask_bit(vector, 0); > } > >-static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector) >+static unsigned int startup_msi_irq(unsigned int vector) > { > struct msi_desc *entry; > unsigned long flags; >@@ -186,13 +206,6 @@ static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector) > } > entry->msi_attrib.state = 1; /* Mark it active */ > spin_unlock_irqrestore(&msi_lock, flags); >- >- return 0; /* never anything pending */ >-} >- >-static unsigned int startup_msi_irq_w_maskbit(unsigned int vector) >-{ >- startup_msi_irq_wo_maskbit(vector); > unmask_MSI_irq(vector); > return 0; /* never anything pending */ > } >@@ -209,67 +222,40 @@ static void shutdown_msi_irq(unsigned int vector) > spin_unlock_irqrestore(&msi_lock, flags); > } > >-static void end_msi_irq_wo_maskbit(unsigned int vector) >-{ >- move_native_irq(vector); >- ack_APIC_irq(); >-} >- >-static void end_msi_irq_w_maskbit(unsigned int vector) >+static void end_msi_irq(unsigned int vector) > { > move_native_irq(vector); > unmask_MSI_irq(vector); > ack_APIC_irq(); > } > >-static void do_nothing(unsigned int vector) >-{ >-} >- > /* > * Interrupt Type for MSI-X PCI/PCI-X/PCI-Express Devices, > * which implement the MSI-X Capability Structure. > */ > static struct hw_interrupt_type msix_irq_type = { > .typename = "PCI-MSI-X", >- .startup = startup_msi_irq_w_maskbit, >+ .startup = startup_msi_irq, > .shutdown = shutdown_msi_irq, > .enable = unmask_MSI_irq, > .disable = mask_MSI_irq, > .ack = mask_MSI_irq, >- .end = end_msi_irq_w_maskbit, >+ .end = end_msi_irq, > .set_affinity = set_msi_affinity > }; > > /* > * Interrupt Type for MSI PCI/PCI-X/PCI-Express Devices, >- * which implement the MSI Capability Structure with >- * Mask-and-Pending Bits. >+ * which implement the MSI Capability Structure. > */ >-static struct hw_interrupt_type msi_irq_w_maskbit_type = { >+static struct hw_interrupt_type msi_irq_type = { > .typename = "PCI-MSI", >- .startup = startup_msi_irq_w_maskbit, >+ .startup = startup_msi_irq, > .shutdown = shutdown_msi_irq, > .enable = unmask_MSI_irq, > .disable = mask_MSI_irq, > .ack = mask_MSI_irq, >- .end = end_msi_irq_w_maskbit, >- .set_affinity = set_msi_affinity >-}; >- >-/* >- * Interrupt Type for MSI PCI/PCI-X/PCI-Express Devices, >- * which implement the MSI Capability Structure without >- * Mask-and-Pending Bits. >- */ >-static struct hw_interrupt_type msi_irq_wo_maskbit_type = { >- .typename = "PCI-MSI", >- .startup = startup_msi_irq_wo_maskbit, >- .shutdown = shutdown_msi_irq, >- .enable = do_nothing, >- .disable = do_nothing, >- .ack = do_nothing, >- .end = end_msi_irq_wo_maskbit, >+ .end = end_msi_irq, > .set_affinity = set_msi_affinity > }; > >@@ -431,12 +417,8 @@ static void irq_handler_init(int cap_id, int pos, int mask) > spin_lock_irqsave(&irq_desc[pos].lock, flags); > if (cap_id == PCI_CAP_ID_MSIX) > irq_desc[pos].chip = &msix_irq_type; >- else { >- if (!mask) >- irq_desc[pos].chip = &msi_irq_wo_maskbit_type; >- else >- irq_desc[pos].chip = &msi_irq_w_maskbit_type; >- } >+ else >+ irq_desc[pos].chip = &msi_irq_type; > spin_unlock_irqrestore(&irq_desc[pos].lock, flags); > } > >@@ -455,10 +437,8 @@ static void enable_msi_mode(struct pci_dev *dev, int pos, int type) > pci_write_config_word(dev, msi_control_reg(pos), control); > dev->msix_enabled = 1; > } >- if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { >- /* PCI Express Endpoint device detected */ >- pci_intx(dev, 0); /* disable intx */ >- } >+ >+ pci_intx(dev, 0); /* disable intx */ > } > > void disable_msi_mode(struct pci_dev *dev, int pos, int type) >@@ -476,10 +456,8 @@ void disable_msi_mode(struct pci_dev *dev, int pos, int type) > pci_write_config_word(dev, msi_control_reg(pos), control); > dev->msix_enabled = 0; > } >- if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { >- /* PCI Express Endpoint device detected */ >- pci_intx(dev, 1); /* enable intx */ >- } >+ >+ pci_intx(dev, 1); /* enable intx */ > } > > static int msi_lookup_vector(struct pci_dev *dev, int type)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 432451
:
294621
| 301970