Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a1f83ac authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

Merge tag 'mvebu-irqchip-fixes-3.15' of git://git.infradead.org/linux-mvebu into irq/urgent

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
parents 3894e9e8 ff3c6645
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -133,8 +133,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
				       struct msi_desc *desc)
				       struct msi_desc *desc)
{
{
	struct msi_msg msg;
	struct msi_msg msg;
	irq_hw_number_t hwirq;
	int virq, hwirq;
	int virq;


	hwirq = armada_370_xp_alloc_msi();
	hwirq = armada_370_xp_alloc_msi();
	if (hwirq < 0)
	if (hwirq < 0)
@@ -160,8 +159,19 @@ static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip,
					   unsigned int irq)
					   unsigned int irq)
{
{
	struct irq_data *d = irq_get_irq_data(irq);
	struct irq_data *d = irq_get_irq_data(irq);
	unsigned long hwirq = d->hwirq;

	irq_dispose_mapping(irq);
	irq_dispose_mapping(irq);
	armada_370_xp_free_msi(d->hwirq);
	armada_370_xp_free_msi(hwirq);
}

static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev,
					  int nvec, int type)
{
	/* We support MSI, but not MSI-X */
	if (type == PCI_CAP_ID_MSI)
		return 0;
	return -EINVAL;
}
}


static struct irq_chip armada_370_xp_msi_irq_chip = {
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,


	msi_chip->setup_irq = armada_370_xp_setup_msi_irq;
	msi_chip->setup_irq = armada_370_xp_setup_msi_irq;
	msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq;
	msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq;
	msi_chip->check_device = armada_370_xp_check_msi_device;
	msi_chip->of_node = node;
	msi_chip->of_node = node;


	armada_370_xp_msi_domain =
	armada_370_xp_msi_domain =