]> git.baikalelectronics.ru Git - kernel.git/commit
libata: fix ATAPI draining
authorTejun Heo <htejun@gmail.com>
Wed, 12 Dec 2007 03:21:52 +0000 (12:21 +0900)
committerJeff Garzik <jeff@garzik.org>
Tue, 18 Dec 2007 01:43:28 +0000 (20:43 -0500)
commit918aa8fe824608cfabc92512e45ccbcddae3c2b9
treeebc04fbd143756d7ef80e870cd9ae214d2607047
parentd9dbbcda08876c57f258375a2307435bc9033652
libata: fix ATAPI draining

With ATAPI transfer chunk size properly programmed, libata PIO HSM
should be able to handle full spurious data chunks.  Also, it's a good
idea to suppress trailing data warning for misc ATAPI commands as
there can be many of them per command - for example, if the chunk size
is 16 and the drive tries to transfer 510 bytes, there can be 31
trailing data messages.

This patch makes the following updates to libata ATAPI PIO HSM
implementation.

* Make it drain full spurious chunks.

* Suppress trailing data warning message for misc commands.

* Put limit on how many bytes can be drained.

* If odd, round up consumed bytes and the number of bytes to be
  drained.  This gets the number of bytes to drain right for drivers
  which do 16bit PIO.

This patch is partial backport of improve-ATAPI-data-xfer patchset
pending for #upstream.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
include/linux/libata.h