Bugfixes for armada-370-xp SoC from Jason Cooper: * Fix invalid cast (signed to unsigned) * Add missing ->check_device() msi_chip op * Fix releasing of MSIs
Unified · Split
| @@ -133,8 +133,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip, · 132 unmodified lines | ||
| 133 | 133 | struct msi_desc *desc) |
| 134 | 134 | { |
| 135 | 135 | struct msi_msg msg; |
| 136 | − irq_hw_number_t hwirq; | |
| 137 | − int virq; | |
| 136 | + int virq, hwirq; | |
| 138 | 137 | |
| 139 | 138 | hwirq = armada_370_xp_alloc_msi(); |
| 140 | 139 | if (hwirq < 0) |
| @@ -160,8 +159,19 @@ static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip, · 19 unmodified lines | ||
| 160 | 159 | unsigned int irq) |
| 161 | 160 | { |
| 162 | 161 | struct irq_data *d = irq_get_irq_data(irq); |
| 162 | + unsigned long hwirq = d->hwirq; | |
| 163 | + | |
| 163 | 164 | irq_dispose_mapping(irq); |
| 164 | − armada_370_xp_free_msi(d->hwirq); | |
| 165 | + armada_370_xp_free_msi(hwirq); | |
| 166 | +} | |
| 167 | + | |
| 168 | +static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev, | |
| 169 | + int nvec, int type) | |
| 170 | +{ | |
| 171 | + /* We support MSI, but not MSI-X */ | |
| 172 | + if (type == PCI_CAP_ID_MSI) | |
| 173 | + return 0; | |
| 174 | + return -EINVAL; | |
| 165 | 175 | } |
| 166 | 176 | |
| 167 | 177 | static struct irq_chip armada_370_xp_msi_irq_chip = { |
| @@ -202,6 +212,7 @@ static int armada_370_xp_msi_init(struct device_node *node, · 34 unmodified lines | ||
| 202 | 212 | |
| 203 | 213 | msi_chip->setup_irq = armada_370_xp_setup_msi_irq; |
| 204 | 214 | msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq; |
| 215 | + msi_chip->check_device = armada_370_xp_check_msi_device; | |
| 205 | 216 | msi_chip->of_node = node; |
| 206 | 217 | |
| 207 | 218 | armada_370_xp_msi_domain = |