summaryrefslogtreecommitdiffstats
path: root/sys/dev/mvs
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-06-12 18:08:11 +0000
committermav <mav@FreeBSD.org>2013-06-12 18:08:11 +0000
commit5049d99749558513380c94f5447234b2ca987bb1 (patch)
tree08384465518a093d04ff6a3145c3ec9314ccc15f /sys/dev/mvs
parent5219f99e6a6b2825f119d9181112455eacffa110 (diff)
downloadFreeBSD-src-5049d99749558513380c94f5447234b2ca987bb1.zip
FreeBSD-src-5049d99749558513380c94f5447234b2ca987bb1.tar.gz
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in mvs(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.
Diffstat (limited to 'sys/dev/mvs')
-rw-r--r--sys/dev/mvs/mvs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c
index 91ca4f0..7f00dee 100644
--- a/sys/dev/mvs/mvs.c
+++ b/sys/dev/mvs/mvs.c
@@ -894,7 +894,7 @@ mvs_legacy_intr(device_t dev, int poll)
if (ccb->ataio.dxfer_len > ch->donecount) {
/* Set this transfer size according to HW capabilities */
ch->transfersize = min(ccb->ataio.dxfer_len - ch->donecount,
- ch->curr[ccb->ccb_h.target_id].bytecount);
+ ch->transfersize);
/* If data write command - put them */
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) {
if (mvs_wait(dev, ATA_S_DRQ, ATA_S_BUSY, 1000) < 0) {
@@ -1334,8 +1334,14 @@ mvs_legacy_execute_transaction(struct mvs_slot *slot)
return;
}
ch->donecount = 0;
- ch->transfersize = min(ccb->ataio.dxfer_len,
- ch->curr[port].bytecount);
+ if (ccb->ataio.cmd.command == ATA_READ_MUL ||
+ ccb->ataio.cmd.command == ATA_READ_MUL48 ||
+ ccb->ataio.cmd.command == ATA_WRITE_MUL ||
+ ccb->ataio.cmd.command == ATA_WRITE_MUL48) {
+ ch->transfersize = min(ccb->ataio.dxfer_len,
+ ch->curr[port].bytecount);
+ } else
+ ch->transfersize = min(ccb->ataio.dxfer_len, 512);
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
ch->fake_busy = 1;
/* If data write command - output the data */
OpenPOWER on IntegriCloud