Tejun Heo wrote: > Albert Lee wrote: >> If the trailing data is odd-lengthed, normally the situation is that >> we have odd-lengthed real data before the trailing data. e.g. The real >> data is 9 bytes, but the drive returns 10 bytes (so, the trailing data >> is 1 byte). >> >> In ata_data_xfer(), we have the following code: >> >> /* Transfer trailing 1 byte, if any. */ >> ... (for write case) ... >> iowrite16(le16_to_cpu(align_buf[0]), ap->ioaddr.data_addr); or >> >> ... (for read case) ... >> ioread16(ap->ioaddr.data_addr) >> >> The PATA bus is actually 16-bit wide. So, ata_data_xfer() actually >> implicitly transfers one more byte than we see if it's odd-lengthed. >> >> That's why in atapi_pio_bytes(), the trailing length was round down >> instead round up. > > Hmmm... it's tricky. When draining a partial chunk because of > odd-length short buffer on even-length chunk, it needs to be rounded > down but on all other cases it needs to be rounded up, right? > > This is basically because count isn't updated with actually consumed > number of bytes. I'll fix it and post an updated patch. Okay, updated patchset posted. Albert, can you please review the new one? Thanks. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html