svn commit: r251661 - head/sys/dev/mvs

Alexander Motin mav at FreeBSD.org
Wed Jun 12 18:08:12 UTC 2013


Author: mav
Date: Wed Jun 12 18:08:11 2013
New Revision: 251661
URL: http://svnweb.freebsd.org/changeset/base/251661

Log:
  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`.

Modified:
  head/sys/dev/mvs/mvs.c

Modified: head/sys/dev/mvs/mvs.c
==============================================================================
--- head/sys/dev/mvs/mvs.c	Wed Jun 12 16:44:17 2013	(r251660)
+++ head/sys/dev/mvs/mvs.c	Wed Jun 12 18:08:11 2013	(r251661)
@@ -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 mv
 			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 */


More information about the svn-src-head mailing list