Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2012 03:08:24 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r243128 - stable/8/sys/dev/ata
Message-ID:  <201211160308.qAG38Odp006144@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Nov 16 03:08:23 2012
New Revision: 243128
URL: http://svnweb.freebsd.org/changeset/base/243128

Log:
  MFC r242422:
  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 ata(4) with ATA_CAM option.
  This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.

Modified:
  stable/8/sys/dev/ata/ata-all.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/sys/dev/ata/ata-all.c
==============================================================================
--- stable/8/sys/dev/ata/ata-all.c	Fri Nov 16 03:07:27 2012	(r243127)
+++ stable/8/sys/dev/ata/ata-all.c	Fri Nov 16 03:08:23 2012	(r243128)
@@ -1500,6 +1500,14 @@ ata_cam_begin_transaction(device_t dev, 
 			request->flags |= ATA_R_READ;
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT)
 			request->flags |= ATA_R_WRITE;
+		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) {
+			request->transfersize = min(request->bytecount,
+			    ch->curr[ccb->ccb_h.target_id].bytecount);
+		} else
+			request->transfersize = min(request->bytecount, 512);
 	} else {
 		request->data = ccb->csio.data_ptr;
 		request->bytecount = ccb->csio.dxfer_len;
@@ -1516,9 +1524,9 @@ ata_cam_begin_transaction(device_t dev, 
 			request->flags |= ATA_R_READ;
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT)
 			request->flags |= ATA_R_WRITE;
+		request->transfersize = min(request->bytecount,
+		    ch->curr[ccb->ccb_h.target_id].bytecount);
 	}
-	request->transfersize = min(request->bytecount,
-	    ch->curr[ccb->ccb_h.target_id].bytecount);
 	request->retries = 0;
 	request->timeout = (ccb->ccb_h.timeout + 999) / 1000;
 	callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211160308.qAG38Odp006144>