From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 15 16:30:02 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD74416A403 for ; Sun, 15 Jul 2007 16:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id AF49913C4A6 for ; Sun, 15 Jul 2007 16:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l6FGU2QN084554 for ; Sun, 15 Jul 2007 16:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l6FGU2Qp084551; Sun, 15 Jul 2007 16:30:02 GMT (envelope-from gnats) Resent-Date: Sun, 15 Jul 2007 16:30:02 GMT Resent-Message-Id: <200707151630.l6FGU2Qp084551@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Morozovsky Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 147C216A402; Sun, 15 Jul 2007 16:23:01 +0000 (UTC) (envelope-from marck@woozle.rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 8568513C467; Sun, 15 Jul 2007 16:23:00 +0000 (UTC) (envelope-from marck@woozle.rinet.ru) Received: from woozle.rinet.ru (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.1/8.14.1) with ESMTP id l6FG7rdO042852; Sun, 15 Jul 2007 20:07:53 +0400 (MSD) (envelope-from marck@woozle.rinet.ru) Received: (from marck@localhost) by woozle.rinet.ru (8.14.1/8.14.1/Submit) id l6FG7rNF042851; Sun, 15 Jul 2007 20:07:53 +0400 (MSD) (envelope-from marck) Message-Id: <200707151607.l6FG7rNF042851@woozle.rinet.ru> Date: Sun, 15 Jul 2007 20:07:53 +0400 (MSD) From: Dmitry Morozovsky To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: sos@FreeBSD.org Subject: kern/114605: [patch] ata: new loader tunable for 80-pin cable check X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitry Morozovsky List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2007 16:30:03 -0000 >Number: 114605 >Category: kern >Synopsis: [patch] ata: new loader tunable for 80-pin cable check >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 15 16:30:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Dmitry Morozovsky >Release: FreeBSD 7-CURRENT/6-STABLE >Organization: Cronyx Plus LLC (RiNet ISP) >Environment: System: FreeBSD 7-CURRENT/6-STABLE >Description: Some laptops like mime MSI S420 reports non-80-wire cable on their ATA disks hence limiting DMA operations to ATA33. On the other hand, both win32 and Linuces use ultra-DMA mode for these disks without a problem. Attached patch introduces new loader tunable allowing user to bypass 80-pin cable check to set DMA mode reported by the device. My checks did not reveal any problems, at least with systems available to me. >How-To-Repeat: >Fix: Index: share/man/man4/ata.4 =================================================================== RCS file: /home/ncvs/src/share/man/man4/ata.4,v retrieving revision 1.72 diff -u -r1.72 ata.4 --- share/man/man4/ata.4 10 Mar 2007 12:44:22 -0000 1.72 +++ share/man/man4/ata.4 15 Jul 2007 14:56:37 -0000 @@ -87,6 +87,9 @@ set to 1 for DMA access, 0 for PIO (default is DMA). .It Va hw.ata.atapi_dma set to 1 for DMA access, 0 for PIO (default is DMA). +.It Va hw.ata.dma_skip80pincheck +set to 1 to skip checks for 80-pin cable (useful for some laptops). +Default is disabled. .It Va hw.ata.wc set to 1 to enable Write Caching, 0 to disable (default is enabled). .Em WARNING : Index: sys/dev/ata/ata-all.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v retrieving revision 1.279 diff -u -r1.279 ata-all.c --- sys/dev/ata/ata-all.c 23 Feb 2007 16:25:08 -0000 1.279 +++ sys/dev/ata/ata-all.c 15 Jul 2007 14:56:37 -0000 @@ -75,6 +75,7 @@ uma_zone_t ata_request_zone; uma_zone_t ata_composite_zone; int ata_wc = 1; +int dma_skip80pincheck = 0; /* local vars */ static int ata_dma = 1; @@ -88,6 +89,10 @@ TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0, "ATAPI device DMA mode control"); +TUNABLE_INT("hw.ata.dma_skip80pincheck", &dma_skip80pincheck); +SYSCTL_INT(_hw_ata, OID_AUTO, dma_skip80pincheck, CTLFLAG_RDTUN, + &dma_skip80pincheck, 0, + "Skip checks for 80pin cable for ATA device when setting DMA mode"); TUNABLE_INT("hw.ata.wc", &ata_wc); SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLAG_RDTUN, &ata_wc, 0, "ATA disk write caching"); Index: sys/dev/ata/ata-all.h =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-all.h,v retrieving revision 1.124 diff -u -r1.124 ata-all.h --- sys/dev/ata/ata-all.h 26 Jun 2007 22:13:43 -0000 1.124 +++ sys/dev/ata/ata-all.h 15 Jul 2007 14:56:37 -0000 @@ -519,6 +519,7 @@ extern struct intr_config_hook *ata_delayed_attach; extern devclass_t ata_devclass; extern int ata_wc; +extern int dma_skip80pincheck; /* public prototypes */ /* ata-all.c: */ Index: sys/dev/ata/ata-chipset.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v retrieving revision 1.198 diff -u -r1.198 ata-chipset.c --- sys/dev/ata/ata-chipset.c 25 Jun 2007 08:21:21 -0000 1.198 +++ sys/dev/ata/ata-chipset.c 15 Jul 2007 14:56:37 -0000 @@ -5507,9 +5507,15 @@ struct ata_device *atadev = device_get_softc(dev); if (mode > ATA_UDMA2 && !(atadev->param.hwres & ATA_CABLE_ID)) { - ata_print_cable(dev, "device"); - mode = ATA_UDMA2; + if (dma_skip80pincheck) { + if (bootverbose) + device_printf(dev, "non-ATA66 cable check ignored\n"); + } else { + ata_print_cable(dev, "device"); + mode = ATA_UDMA2; + } } + return mode; } >Release-Note: >Audit-Trail: >Unformatted: