libata: update ATAPI overflow draining
authorTejun Heo <htejun@gmail.com>
Tue, 19 Feb 2008 10:35:37 +0000 (11:35 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 19 Feb 2008 10:35:37 +0000 (11:35 +0100)
commit56c819df77f96c3fc0c2a979e12b478403728790
tree104a8538980dbb267a9a26cb4c34eae583cedeb3
parente164094964e6e20fe7fce418e06a9dce952bb7a4
libata: update ATAPI overflow draining

For misc ATAPI commands which transfer variable length data to the
host, overflow can occur due to application or hardware bug.  Such
overflows can be ignored safely as long as overflow data is properly
drained.  libata HSM implementation has this implemented in
__atapi_pio_bytes() and recently updated for 2.6.24-rc but it requires
further improvements.  Improve drain logic such that...

* Report overflow errors using ehi desc mechanism instead of printing
  directly.

* Properly calculate the number of bytes to be drained considering
  actual number of consumed bytes for partial draining.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/ata/libata-core.c