Re: [PATCH v4 4/4] AHCI: Do not read HOST_IRQ_STAT reg in multi-MSI mode

From: Tejun Heo
Date: Sun Sep 28 2014 - 12:11:02 EST


Hello, Alexander.

On Thu, Sep 25, 2014 at 03:13:24PM +0200, Alexander Gordeev wrote:
> @@ -1797,11 +1797,14 @@ static irqreturn_t ahci_port_thread_fn(int irq, void *dev_instance)
> unsigned long flags;
> u32 status;
>
> - spin_lock_irqsave(&ap->host->lock, flags);
> + spin_lock_irqsave(&pp->intr_lock, flags);
> status = pp->intr_status;
> if (status)
> pp->intr_status = 0;
> - spin_unlock_irqrestore(&ap->host->lock, flags);
> + spin_unlock_irqrestore(&pp->intr_lock, flags);

atomic_xchg() prolly is a better option here.

> +
> + if (!status)
> + return IRQ_NONE;
>
> spin_lock_bh(ap->lock);
> ahci_handle_port_interrupt(ap, port_mmio, status);
> @@ -1824,53 +1827,14 @@ static void ahci_update_intr_status(struct ata_port *ap)
>
> static irqreturn_t ahci_multi_irqs_intr(int irq, void *dev_instance)
> {
...
> + spin_lock(&pp->intr_lock);
> + ahci_update_intr_status(ap);
> + spin_unlock(&pp->intr_lock);

and atomic_or() in update_intr_status.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/