Re: [PATCH 2.6.16] sata_mv.c :: three bug fixes

From: Dan Aloni
Date: Wed Mar 29 2006 - 12:02:28 EST


On Wed, Mar 29, 2006 at 09:50:31AM -0500, Mark Lord wrote:
> This patch is against 2.6.16, and fixes three serious bugs in sata_mv.c.
> The same fixes are applicable to 2.6.16-git*.
>
> (1) A DMA transfer size of 0x10000 was not being written
> as 0x0000 in the PRDs. Fixed.
>
> (1) The DEV_IRQ interrupt cause bit happens spuriously
> during EDMA operation, and was not being ignored by the driver.
> This led to various "drive busy" errors being reported,
> with associated unpredictable behaviour. Fixed.

I saw that happening too, thanks for the fix.

> (2) If a SATA or PCI interrupt was received with no outstanding
> command, the interrupt handler still attempted to invoke
> ata_qc_complete(), triggering assert()/BUG_ON() behaviour
> elsewhere in libata. Fixed.

Dito. Thanks again.

> The driver still has issues with confusion after error-recovery,
> but should now be reliable in the absence of drive errors.
> I will be looking more into the error-handling bugs next.
>
> Signed-Off-By: Mark Lord <mlord@xxxxxxxxx>
> ---
>[...]
> /* we'll need the HC success int register in most cases */
> hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS);
> if (hc_irq_cause) {
> writelfl(~hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS);
> }
>
> VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n",
> hc,relevant,hc_irq_cause);
>
> for (port = port0; port < port0 + MV_PORTS_PER_HC; port++) {
> - ap = host_set->ports[port];
> + struct ata_port *ap = host_set->ports[port];
> + struct mv_port_priv *pp = ap->private_data;

The original code checks ap for NULL, are you sure it is safe to
remove this?

--
Dan Aloni
da-x@xxxxxxxxxxxxx, da-x@xxxxxxxxxxx, da-x@xxxxxxx, dan@xxxxxxxxx
-
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/