projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PCI PM: Split PCI Express port suspend-resume
[deliverable/linux.git]
/
drivers
/
pci
/
msi.c
diff --git
a/drivers/pci/msi.c
b/drivers/pci/msi.c
index 74801f7df9c901ad21017ce2a831e0cd61c8af1c..b4a90badd0a6d66c57c83961f8bc956a49aa7d7a 100644
(file)
--- a/
drivers/pci/msi.c
+++ b/
drivers/pci/msi.c
@@
-103,11
+103,11
@@
static void msix_set_enable(struct pci_dev *dev, int enable)
}
}
}
}
-static void msix_flush_writes(
unsigned int irq
)
+static void msix_flush_writes(
struct irq_desc *desc
)
{
struct msi_desc *entry;
{
struct msi_desc *entry;
- entry = get_irq_
msi(irq
);
+ entry = get_irq_
desc_msi(desc
);
BUG_ON(!entry || !entry->dev);
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
BUG_ON(!entry || !entry->dev);
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
@@
-135,11
+135,11
@@
static void msix_flush_writes(unsigned int irq)
* Returns 1 if it succeeded in masking the interrupt and 0 if the device
* doesn't support MSI masking.
*/
* Returns 1 if it succeeded in masking the interrupt and 0 if the device
* doesn't support MSI masking.
*/
-static int msi_set_mask_bits(
unsigned int irq
, u32 mask, u32 flag)
+static int msi_set_mask_bits(
struct irq_desc *desc
, u32 mask, u32 flag)
{
struct msi_desc *entry;
{
struct msi_desc *entry;
- entry = get_irq_
msi(irq
);
+ entry = get_irq_
desc_msi(desc
);
BUG_ON(!entry || !entry->dev);
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
BUG_ON(!entry || !entry->dev);
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
@@
-172,9
+172,9
@@
static int msi_set_mask_bits(unsigned int irq, u32 mask, u32 flag)
return 1;
}
return 1;
}
-void read_msi_msg
(unsigned int irq
, struct msi_msg *msg)
+void read_msi_msg
_desc(struct irq_desc *desc
, struct msi_msg *msg)
{
{
- struct msi_desc *entry = get_irq_
msi(irq
);
+ struct msi_desc *entry = get_irq_
desc_msi(desc
);
switch(entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
{
switch(entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
{
@@
-211,9
+211,16
@@
void read_msi_msg(unsigned int irq, struct msi_msg *msg)
}
}
}
}
-void write_msi_msg(unsigned int irq, struct msi_msg *msg)
+void read_msi_msg(unsigned int irq, struct msi_msg *msg)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ read_msi_msg_desc(desc, msg);
+}
+
+void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
{
{
- struct msi_desc *entry = get_irq_
msi(irq
);
+ struct msi_desc *entry = get_irq_
desc_msi(desc
);
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
{
switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI:
{
@@
-252,21
+259,31
@@
void write_msi_msg(unsigned int irq, struct msi_msg *msg)
entry->msg = *msg;
}
entry->msg = *msg;
}
+void write_msi_msg(unsigned int irq, struct msi_msg *msg)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ write_msi_msg_desc(desc, msg);
+}
+
void mask_msi_irq(unsigned int irq)
{
void mask_msi_irq(unsigned int irq)
{
- msi_set_mask_bits(irq, 1, 1);
- msix_flush_writes(irq);
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ msi_set_mask_bits(desc, 1, 1);
+ msix_flush_writes(desc);
}
void unmask_msi_irq(unsigned int irq)
{
}
void unmask_msi_irq(unsigned int irq)
{
- msi_set_mask_bits(irq, 1, 0);
- msix_flush_writes(irq);
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ msi_set_mask_bits(desc, 1, 0);
+ msix_flush_writes(desc);
}
static int msi_free_irqs(struct pci_dev* dev);
}
static int msi_free_irqs(struct pci_dev* dev);
-
static struct msi_desc* alloc_msi_entry(void)
{
struct msi_desc *entry;
static struct msi_desc* alloc_msi_entry(void)
{
struct msi_desc *entry;
@@
-303,9
+320,11
@@
static void __pci_restore_msi_state(struct pci_dev *dev)
pci_intx_for_msi(dev, 0);
msi_set_enable(dev, 0);
write_msi_msg(dev->irq, &entry->msg);
pci_intx_for_msi(dev, 0);
msi_set_enable(dev, 0);
write_msi_msg(dev->irq, &entry->msg);
- if (entry->msi_attrib.maskbit)
- msi_set_mask_bits(dev->irq, entry->msi_attrib.maskbits_mask,
+ if (entry->msi_attrib.maskbit) {
+ struct irq_desc *desc = irq_to_desc(dev->irq);
+ msi_set_mask_bits(desc, entry->msi_attrib.maskbits_mask,
entry->msi_attrib.masked);
entry->msi_attrib.masked);
+ }
pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
control &= ~PCI_MSI_FLAGS_QSIZE;
pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
control &= ~PCI_MSI_FLAGS_QSIZE;
@@
-327,8
+346,9
@@
static void __pci_restore_msix_state(struct pci_dev *dev)
msix_set_enable(dev, 0);
list_for_each_entry(entry, &dev->msi_list, list) {
msix_set_enable(dev, 0);
list_for_each_entry(entry, &dev->msi_list, list) {
+ struct irq_desc *desc = irq_to_desc(entry->irq);
write_msi_msg(entry->irq, &entry->msg);
write_msi_msg(entry->irq, &entry->msg);
- msi_set_mask_bits(
entry->irq
, 1, entry->msi_attrib.masked);
+ msi_set_mask_bits(
desc
, 1, entry->msi_attrib.masked);
}
BUG_ON(list_empty(&dev->msi_list));
}
BUG_ON(list_empty(&dev->msi_list));
@@
-596,7
+616,8
@@
void pci_msi_shutdown(struct pci_dev* dev)
/* Return the the pci reset with msi irqs unmasked */
if (entry->msi_attrib.maskbit) {
u32 mask = entry->msi_attrib.maskbits_mask;
/* Return the the pci reset with msi irqs unmasked */
if (entry->msi_attrib.maskbit) {
u32 mask = entry->msi_attrib.maskbits_mask;
- msi_set_mask_bits(dev->irq, mask, ~mask);
+ struct irq_desc *desc = irq_to_desc(dev->irq);
+ msi_set_mask_bits(desc, mask, ~mask);
}
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI)
return;
}
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI)
return;
@@
-755,28
+776,19
@@
void pci_no_msi(void)
pci_msi_enable = 0;
}
pci_msi_enable = 0;
}
-void pci_msi_init_pci_dev(struct pci_dev *dev)
-{
- INIT_LIST_HEAD(&dev->msi_list);
-}
-
-#ifdef CONFIG_ACPI
-#include <linux/acpi.h>
-#include <linux/pci-acpi.h>
-static void __devinit msi_acpi_init(void)
+/**
+ * pci_msi_enabled - is MSI enabled?
+ *
+ * Returns true if MSI has not been disabled by the command-line option
+ * pci=nomsi.
+ **/
+int pci_msi_enabled(void)
{
{
- if (acpi_pci_disabled)
- return;
- pci_osc_support_set(OSC_MSI_SUPPORT);
- pcie_osc_support_set(OSC_MSI_SUPPORT);
+ return pci_msi_enable;
}
}
-#else
-static inline void msi_acpi_init(void) { }
-#endif /* CONFIG_ACPI */
+EXPORT_SYMBOL(pci_msi_enabled);
-void
__devinit msi_init(void
)
+void
pci_msi_init_pci_dev(struct pci_dev *dev
)
{
{
- if (!pci_msi_enable)
- return;
- msi_acpi_init();
+ INIT_LIST_HEAD(&dev->msi_list);
}
}
This page took
0.04484 seconds
and
5
git commands to generate.