Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2012 14:17:58 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230912 - head/sys/cam/ata
Message-ID:  <201202021417.q12EHw1S040836@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Feb  2 14:17:58 2012
New Revision: 230912
URL: http://svn.freebsd.org/changeset/base/230912

Log:
  Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables.
  
  Even having more specific hint.ata.X.mode controls, global ones are
  still could be useful from some points, including compatibility.
  
  PR:		kern/164651
  MFC after:	1 week

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Thu Feb  2 12:22:22 2012	(r230911)
+++ head/sys/cam/ata/ata_xpt.c	Thu Feb  2 14:17:58 2012	(r230912)
@@ -186,6 +186,12 @@ static void	 ata_dev_async(u_int32_t asy
 static void	 ata_action(union ccb *start_ccb);
 static void	 ata_announce_periph(struct cam_periph *periph);
 
+static int ata_dma = 1;
+static int atapi_dma = 1;
+
+TUNABLE_INT("hw.ata.ata_dma", &ata_dma);
+TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma);
+
 static struct xpt_xport ata_xport = {
 	.alloc_device = ata_alloc_device,
 	.action = ata_action,
@@ -356,6 +362,13 @@ probestart(struct cam_periph *periph, un
 			if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE)
 				mode = cts.xport_specific.sata.mode;
 		}
+		if (periph->path->device->protocol == PROTO_ATA) {
+			if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX))
+				mode = ATA_PIO_MAX;
+		} else {
+			if (atapi_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX))
+				mode = ATA_PIO_MAX;
+		}
 negotiate:
 		/* Honor device capabilities. */
 		wantmode = mode = ata_max_mode(ident_buf, mode);



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