Hello,

On Tue, Feb 20, 2007 at 06:21:32PM -0700, Dan Williams wrote:
> @@ -149,9 +145,9 @@ static void vsc_intr_mask_update(struct ata_port *ap, u8 
> ctl)
>               VSC_SATA_INT_MASK_OFFSET + ap->port_no;
>       mask = readb(mask_addr);
>       if (ctl & ATA_NIEN)
> -             mask |= 0x80;
> +             mask = 0xff;
>       else
> -             mask &= 0x7F;
> +             mask = 0x0;
>       writeb(mask, mask_addr);

Wouldn't it be better to listen for SATA error interrupt
(e.g. hotplug) even during polling commands?

> @@ -290,59 +286,35 @@ static irqreturn_t vsc_sata_interrupt (int irq, void 
> *dev_instance)
>       struct ata_host *host = dev_instance;
>       unsigned int i;
>       unsigned int handled = 0;
> -     u32 int_status;
> +     u32 status;
>  
> -     spin_lock(&host->lock);
> +     status = readl(host->iomap[VSC_MMIO_BAR] + VSC_SATA_INT_STAT_OFFSET);
>  
> -     int_status = readl(host->iomap[VSC_MMIO_BAR] +
> -                        VSC_SATA_INT_STAT_OFFSET);
> -
> -     for (i = 0; i < host->n_ports; i++) {
> -             if (int_status & ((u32) 0xFF << (8 * i))) {
> -                     struct ata_port *ap;
> +     if (status == 0xffffffff) {
> +             printk(KERN_ERR DRV_NAME ": IRQ status == 0xffffffff, "
> +                     "PCI fault or device removal?\n");
> +             goto out;
> +     } else if (!status)
> +             goto out;

I think unlikely() here will be helpful.  e.g.

        if (unlikely(status == 0 || status == 0xffffffff)) {
                /* blah blah */
                goto out;
        }

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to