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 304255 Details for
Bug 432452
[RHEL4] 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]
patches combined
linux-kernel-test.patch (text/plain), 10.96 KB, created by
Flavio Leitner
on 2008-04-30 16:51:02 UTC
(
hide
)
Description:
patches combined
Filename:
MIME Type:
Creator:
Flavio Leitner
Created:
2008-04-30 16:51:02 UTC
Size:
10.96 KB
patch
obsolete
> >The MSI should be disabled when moving IRQs on chips without >Mask-and-Pending bits. This patch is based on four upstream >commits listed below: > >b1cbf4e4 [PATCH] msi: fix up the msi enable/disable logic >277bc33b [PATCH] msi: only use a single irq_chip for msi interrupts >58e0543e [PATCH] msi: support masking msi irqs without a mask bit >1769b46a PCI MSI: always toggle legacy-INTx-enable bit upon MSI entry/exit > >This patch will resolve BZ #432452 > >Flavio > >--- > > drivers/infiniband/hw/ipath/ipath_iba7220.c | 5 > drivers/net/tg3_compat.h | 19 --- > drivers/pci/msi.c | 148 ++++++++++------------------ > drivers/pci/pci.c | 26 ++++ > include/linux/libata-compat.h | 18 --- > include/linux/pci.h | 1 > 6 files changed, 81 insertions(+), 136 deletions(-) > >Index: linux-2.6.9/drivers/pci/msi.c >=================================================================== >--- linux-2.6.9.orig/drivers/pci/msi.c >+++ linux-2.6.9/drivers/pci/msi.c >@@ -56,24 +56,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 = 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: >@@ -165,40 +184,13 @@ static void unmask_MSI_irq(unsigned int > msi_set_mask_bit(vector, 0); > } > >-static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector) >-{ >- struct msi_desc *entry; >- unsigned long flags; >- >- spin_lock_irqsave(&msi_lock, flags); >- entry = msi_desc[vector]; >- if (!entry || !entry->dev) { >- spin_unlock_irqrestore(&msi_lock, flags); >- return 0; >- } >- entry->msi_attrib.state = 1; /* Mark it active */ >- spin_unlock_irqrestore(&msi_lock, flags); >- >- return 0; /* never anything pending */ >-} >- > static void release_msi(unsigned int vector); > static void shutdown_msi_irq(unsigned int vector) > { > release_msi(vector); > } > >-#define shutdown_msi_irq_wo_maskbit shutdown_msi_irq >-static void enable_msi_irq_wo_maskbit(unsigned int vector) {} >-static void disable_msi_irq_wo_maskbit(unsigned int vector) {} >-static void ack_msi_irq_wo_maskbit(unsigned int vector) {} >-static void end_msi_irq_wo_maskbit(unsigned int vector) >-{ >- move_msi(vector); >- ack_APIC_irq(); >-} >- >-static unsigned int startup_msi_irq_w_maskbit(unsigned int vector) >+static unsigned int startup_msi_irq(unsigned int vector) > { > struct msi_desc *entry; > unsigned long flags; >@@ -216,12 +208,7 @@ static unsigned int startup_msi_irq_w_ma > return 0; /* never anything pending */ > } > >-#define shutdown_msi_irq_w_maskbit shutdown_msi_irq >-#define enable_msi_irq_w_maskbit unmask_MSI_irq >-#define disable_msi_irq_w_maskbit mask_MSI_irq >-#define ack_msi_irq_w_maskbit mask_MSI_irq >- >-static void end_msi_irq_w_maskbit(unsigned int vector) >+static void end_msi_irq_maskbit(unsigned int vector) > { > move_msi(vector); > unmask_MSI_irq(vector); >@@ -234,44 +221,27 @@ static void end_msi_irq_w_maskbit(unsign > */ > static struct hw_interrupt_type msix_irq_type = { > .typename = "PCI-MSI-X", >- .startup = startup_msi_irq_w_maskbit, >- .shutdown = shutdown_msi_irq_w_maskbit, >- .enable = enable_msi_irq_w_maskbit, >- .disable = disable_msi_irq_w_maskbit, >- .ack = ack_msi_irq_w_maskbit, >- .end = end_msi_irq_w_maskbit, >- .set_affinity = set_msi_irq_affinity >-}; >- >-/* >- * Interrupt Type for MSI PCI/PCI-X/PCI-Express Devices, >- * which implement the MSI Capability Structure with >- * Mask-and-Pending Bits. >- */ >-static struct hw_interrupt_type msi_irq_w_maskbit_type = { >- .typename = "PCI-MSI", >- .startup = startup_msi_irq_w_maskbit, >- .shutdown = shutdown_msi_irq_w_maskbit, >- .enable = enable_msi_irq_w_maskbit, >- .disable = disable_msi_irq_w_maskbit, >- .ack = ack_msi_irq_w_maskbit, >- .end = end_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_maskbit, > .set_affinity = set_msi_irq_affinity > }; > > /* >- * Interrupt Type for MSI PCI/PCI-X/PCI-Express Devices, >- * which implement the MSI Capability Structure without >- * Mask-and-Pending Bits. >+ * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices, >+ * which implement the MSI or MSI-X Capability Structure. > */ >-static struct hw_interrupt_type msi_irq_wo_maskbit_type = { >+static struct hw_interrupt_type msi_irq_type = { > .typename = "PCI-MSI", >- .startup = startup_msi_irq_wo_maskbit, >- .shutdown = shutdown_msi_irq_wo_maskbit, >- .enable = enable_msi_irq_wo_maskbit, >- .disable = disable_msi_irq_wo_maskbit, >- .ack = ack_msi_irq_wo_maskbit, >- .end = end_msi_irq_wo_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_maskbit, > .set_affinity = set_msi_irq_affinity > }; > >@@ -446,12 +416,8 @@ static void irq_handler_init(int cap_id, > spin_lock(&irq_desc[pos].lock); > if (cap_id == PCI_CAP_ID_MSIX) > irq_desc[pos].handler = &msix_irq_type; >- else { >- if (!mask) >- irq_desc[pos].handler = &msi_irq_wo_maskbit_type; >- else >- irq_desc[pos].handler = &msi_irq_w_maskbit_type; >- } >+ else >+ irq_desc[pos].handler = &msi_irq_type; > spin_unlock(&irq_desc[pos].lock); > } > >@@ -468,13 +434,9 @@ static void enable_msi_mode(struct pci_d > msix_enable(control); > pci_write_config_word(dev, msi_control_reg(pos), control); > } >- if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { >- /* PCI Express Endpoint device detected */ >- u16 cmd; >- pci_read_config_word(dev, PCI_COMMAND, &cmd); >- cmd |= PCI_COMMAND_INTX_DISABLE; >- pci_write_config_word(dev, PCI_COMMAND, cmd); >- } >+ >+ /* disable intx */ >+ pci_intx(dev, 0); > } > > void disable_msi_mode(struct pci_dev *dev, int pos, int type) >@@ -490,13 +452,9 @@ void disable_msi_mode(struct pci_dev *de > msix_disable(control); > pci_write_config_word(dev, msi_control_reg(pos), control); > } >- if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { >- /* PCI Express Endpoint device detected */ >- u16 cmd; >- pci_read_config_word(dev, PCI_COMMAND, &cmd); >- cmd &= ~PCI_COMMAND_INTX_DISABLE; >- pci_write_config_word(dev, PCI_COMMAND, cmd); >- } >+ >+ /* enable intx */ >+ pci_intx(dev, 1); > } > > static int msi_lookup_vector(struct pci_dev *dev, int type) >Index: linux-2.6.9/drivers/pci/pci.c >=================================================================== >--- linux-2.6.9.orig/drivers/pci/pci.c >+++ linux-2.6.9/drivers/pci/pci.c >@@ -741,6 +741,31 @@ pci_clear_mwi(struct pci_dev *dev) > } > } > >+/** >+ * pci_intx - enables/disables PCI INTx for device dev >+ * @pdev: the PCI device to operate on >+ * @enable: boolean: whether to enable or disable PCI INTx >+ * >+ * Enables/disables PCI INTx for device dev >+ */ >+void >+pci_intx(struct pci_dev *pdev, int enable) >+{ >+ u16 pci_command, new; >+ >+ pci_read_config_word(pdev, PCI_COMMAND, &pci_command); >+ >+ if (enable) { >+ new = pci_command & ~PCI_COMMAND_INTX_DISABLE; >+ } else { >+ new = pci_command | PCI_COMMAND_INTX_DISABLE; >+ } >+ >+ if (new != pci_command) { >+ pci_write_config_word(pdev, PCI_COMMAND, new); >+ } >+} >+ > #ifndef HAVE_ARCH_PCI_SET_DMA_MASK > /* > * These can be overridden by arch-specific implementations >@@ -1021,6 +1046,7 @@ EXPORT_SYMBOL(pci_request_region); > EXPORT_SYMBOL(pci_set_master); > EXPORT_SYMBOL(pci_set_mwi); > EXPORT_SYMBOL(pci_clear_mwi); >+EXPORT_SYMBOL_GPL(pci_intx); > EXPORT_SYMBOL(pci_set_dma_mask); > EXPORT_SYMBOL(pci_dac_set_dma_mask); > EXPORT_SYMBOL(pci_set_consistent_dma_mask); >Index: linux-2.6.9/include/linux/pci.h >=================================================================== >--- linux-2.6.9.orig/include/linux/pci.h >+++ linux-2.6.9/include/linux/pci.h >@@ -797,6 +797,7 @@ int pci_set_pcie_reset_state(struct pci_ > #define HAVE_PCI_SET_MWI > int pci_set_mwi(struct pci_dev *dev); > void pci_clear_mwi(struct pci_dev *dev); >+void pci_intx(struct pci_dev *dev, int enable); > int __must_check pci_set_dma_mask(struct pci_dev *dev, u64 mask); > int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask); > int __must_check pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); >Index: linux-2.6.9/drivers/infiniband/hw/ipath/ipath_iba7220.c >=================================================================== >--- linux-2.6.9.orig/drivers/infiniband/hw/ipath/ipath_iba7220.c >+++ linux-2.6.9/drivers/infiniband/hw/ipath/ipath_iba7220.c >@@ -1178,10 +1178,7 @@ static void ipath_enable_intx(struct pci > int pos; > > /* first, turn on INTx */ >- pci_read_config_word(pdev, PCI_COMMAND, &cw); >- new = cw & ~PCI_COMMAND_INTX_DISABLE; >- if (new != cw) >- pci_write_config_word(pdev, PCI_COMMAND, new); >+ pci_intx(pdev, 1); > > /* then turn off MSI */ > pos = pci_find_capability(pdev, PCI_CAP_ID_MSI); >Index: linux-2.6.9/drivers/net/tg3_compat.h >=================================================================== >--- linux-2.6.9.orig/drivers/net/tg3_compat.h >+++ linux-2.6.9/drivers/net/tg3_compat.h >@@ -90,23 +90,4 @@ static inline void netif_tx_unlock(struc > spin_unlock(&dev->xmit_lock); > } > >-static inline void pci_intx(struct pci_dev *pdev, int enable) >-{ >- u16 pci_command, new; >- >- pci_read_config_word(pdev, PCI_COMMAND, &pci_command); >- >- if (enable) { >- new = pci_command & ~PCI_COMMAND_INTX_DISABLE; >- } else { >- new = pci_command | PCI_COMMAND_INTX_DISABLE; >- } >- >- if (new != pci_command) { >- pci_write_config_word(pdev, PCI_COMMAND, new); >- } >-} >- >- >- > #endif /* __TG3_COMPAT_H__ */ >Index: linux-2.6.9/include/linux/libata-compat.h >=================================================================== >--- linux-2.6.9.orig/include/linux/libata-compat.h >+++ linux-2.6.9/include/linux/libata-compat.h >@@ -13,22 +13,4 @@ typedef u32 pm_message_t; > > typedef void (*work_func_t)(void *); > >-static inline void >-pci_intx(struct pci_dev *pdev, int enable) >-{ >- u16 pci_command, new; >- >- pci_read_config_word(pdev, PCI_COMMAND, &pci_command); >- >- if (enable) { >- new = pci_command & ~PCI_COMMAND_INTX_DISABLE; >- } else { >- new = pci_command | PCI_COMMAND_INTX_DISABLE; >- } >- >- if (new != pci_command) { >- pci_write_config_word(pdev, PCI_COMMAND, new); >- } >-} >- > #endif /* __LIBATA_COMPAT_H__ */
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 432452
:
294622
|
304118
| 304255