diff options
author | Yijing Wang <wangyijing@huawei.com> | 2014-09-23 13:02:42 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-10-01 14:21:23 -0400 |
commit | 48c3c38f003c25d50a09d3da558667c5ecd530aa (patch) | |
tree | aad2a4190c8622ab17b62384697cc6a356aab545 | |
parent | 81052769e48609525c452d8f078a5786b673e178 (diff) |
PCI/MSI: Remove "pos" from the struct msi_desc msi_attrib
"msi_attrib.pos" is only used for MSI (not MSI-X), and we already cache the
MSI capability offset in "dev->msi_cap".
Remove "pos" from the struct msi_attrib and use "dev->msi_cap" directly.
[bhelgaas: changelog, fix whitespace]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/mips/pci/msi-octeon.c | 6 | ||||
-rw-r--r-- | drivers/pci/host/pcie-designware.c | 5 | ||||
-rw-r--r-- | drivers/pci/msi.c | 2 | ||||
-rw-r--r-- | include/linux/msi.h | 1 |
4 files changed, 4 insertions, 10 deletions
diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c index ab0c5d14c6f7..63bbe07a1ccd 100644 --- a/arch/mips/pci/msi-octeon.c +++ b/arch/mips/pci/msi-octeon.c | |||
@@ -73,8 +73,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) | |||
73 | * wants. Most devices only want 1, which will give | 73 | * wants. Most devices only want 1, which will give |
74 | * configured_private_bits and request_private_bits equal 0. | 74 | * configured_private_bits and request_private_bits equal 0. |
75 | */ | 75 | */ |
76 | pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, | 76 | pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); |
77 | &control); | ||
78 | 77 | ||
79 | /* | 78 | /* |
80 | * If the number of private bits has been configured then use | 79 | * If the number of private bits has been configured then use |
@@ -176,8 +175,7 @@ msi_irq_allocated: | |||
176 | /* Update the number of IRQs the device has available to it */ | 175 | /* Update the number of IRQs the device has available to it */ |
177 | control &= ~PCI_MSI_FLAGS_QSIZE; | 176 | control &= ~PCI_MSI_FLAGS_QSIZE; |
178 | control |= request_private_bits << 4; | 177 | control |= request_private_bits << 4; |
179 | pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, | 178 | pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control); |
180 | control); | ||
181 | 179 | ||
182 | irq_set_msi_desc(irq, desc); | 180 | irq_set_msi_desc(irq, desc); |
183 | write_msi_msg(irq, &msg); | 181 | write_msi_msg(irq, &msg); |
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 52bd3a143563..fa2fa459ed90 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c | |||
@@ -355,9 +355,8 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev, | |||
355 | return -EINVAL; | 355 | return -EINVAL; |
356 | } | 356 | } |
357 | 357 | ||
358 | pci_read_config_word(pdev, desc->msi_attrib.pos+PCI_MSI_FLAGS, | 358 | pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &msg_ctr); |
359 | &msg_ctr); | 359 | msgvec = (msg_ctr & PCI_MSI_FLAGS_QSIZE) >> 4; |
360 | msgvec = (msg_ctr&PCI_MSI_FLAGS_QSIZE) >> 4; | ||
361 | if (msgvec == 0) | 360 | if (msgvec == 0) |
362 | msgvec = (msg_ctr & PCI_MSI_FLAGS_QMASK) >> 1; | 361 | msgvec = (msg_ctr & PCI_MSI_FLAGS_QMASK) >> 1; |
363 | if (msgvec > 5) | 362 | if (msgvec > 5) |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 97d6ef67a3c8..40699a2041b5 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -574,7 +574,6 @@ static struct msi_desc *msi_setup_entry(struct pci_dev *dev) | |||
574 | entry->msi_attrib.entry_nr = 0; | 574 | entry->msi_attrib.entry_nr = 0; |
575 | entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT); | 575 | entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT); |
576 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ | 576 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ |
577 | entry->msi_attrib.pos = dev->msi_cap; | ||
578 | entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1; | 577 | entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1; |
579 | 578 | ||
580 | if (control & PCI_MSI_FLAGS_64BIT) | 579 | if (control & PCI_MSI_FLAGS_64BIT) |
@@ -678,7 +677,6 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base, | |||
678 | entry->msi_attrib.is_64 = 1; | 677 | entry->msi_attrib.is_64 = 1; |
679 | entry->msi_attrib.entry_nr = entries[i].entry; | 678 | entry->msi_attrib.entry_nr = entries[i].entry; |
680 | entry->msi_attrib.default_irq = dev->irq; | 679 | entry->msi_attrib.default_irq = dev->irq; |
681 | entry->msi_attrib.pos = dev->msix_cap; | ||
682 | entry->mask_base = base; | 680 | entry->mask_base = base; |
683 | 681 | ||
684 | list_add_tail(&entry->list, &dev->msi_list); | 682 | list_add_tail(&entry->list, &dev->msi_list); |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 5a91c2d58ffd..44f4746d033b 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -29,7 +29,6 @@ struct msi_desc { | |||
29 | __u8 multi_cap : 3; /* log2 num of messages supported */ | 29 | __u8 multi_cap : 3; /* log2 num of messages supported */ |
30 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 30 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
31 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 31 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
32 | __u8 pos; /* Location of the msi capability */ | ||
33 | __u16 entry_nr; /* specific enabled entry */ | 32 | __u16 entry_nr; /* specific enabled entry */ |
34 | unsigned default_irq; /* default pre-assigned irq */ | 33 | unsigned default_irq; /* default pre-assigned irq */ |
35 | } msi_attrib; | 34 | } msi_attrib; |