From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:40:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A70C1065672; Thu, 9 Feb 2012 07:40:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 655168FC17; Thu, 9 Feb 2012 07:40:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q197eElD087840; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197eEaH087838; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090740.q197eEaH087838@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231252 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:40:14 -0000 Author: mav Date: Thu Feb 9 07:40:13 2012 New Revision: 231252 URL: http://svn.freebsd.org/changeset/base/231252 Log: MFC r230912: 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 Modified: stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:38:56 2012 (r231251) +++ stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:40:13 2012 (r231252) @@ -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);