Re: todays git: WARNING: at drivers/ata/libata-sff.c:1017ata_sff_hsm_move+0x45e/0x750()

From: Alan Cox
Date: Sat Jan 10 2009 - 10:13:36 EST


O> Your problem is that the *device* is wanting to transfer a set of bytes
> not divisible by four. If you want to use word based PIO, you'll have
> to fall back to collecting bytes for the last two. Alternatively, you

Nope.. you can't do that with ATA block transfers - it isn't the same as
SCSI

> could just do byte PIO for all reply lengths like this ... they occur
> all over the SCSI standard, but not usually in critical paths.

The problem we have is that the sg list the drivers were given had a
segment which was not divisible in length by four and was *NOT* the last
segment in the sg list

The logic in the ATA PIO code is basically


for each sg entry

compute the number of bytes to transfer staying within
the page
transfer that many bytes (but may be more)

if and only if the transfer is NOT the last segment but is
more than the bytes requested - WARN


The block alignment is set to 4 bytes so the block code should be handing
down stuff which is safe. Some of the sense and other stuff is "adjusted"
by the libata-scsi conversion code which at this point I suspect is the
offender.

This is why libata uses the pad buffers we don't get to be quite so exact
about transfer sizes as SCSI is.

Alan
--
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/