From nobody@FreeBSD.org  Tue Feb  2 00:58:53 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57352106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Feb 2010 00:58:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 455BF8FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Feb 2010 00:58:53 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o120wr1b005128
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 2 Feb 2010 00:58:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o120wqbN005127;
	Tue, 2 Feb 2010 00:58:52 GMT
	(envelope-from nobody)
Message-Id: <201002020058.o120wqbN005127@www.freebsd.org>
Date: Tue, 2 Feb 2010 00:58:52 GMT
From: Sean Winn <sean@gothic.net.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: hw.ata.ata_dma_check_80pin no longer seems to work
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         143462
>Category:       kern
>Synopsis:       [ata] hw.ata.ata_dma_check_80pin no longer seems to work [regression]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 02 01:00:10 UTC 2010
>Closed-Date:    Sun Jul 18 07:12:05 UTC 2010
>Last-Modified:  Sun Jul 18 07:20:07 UTC 2010
>Originator:     Sean Winn
>Release:        8.0-STABLE
>Organization:
>Environment:
FreeBSD queen.gothic.net.au 8.0-STABLE FreeBSD 8.0-STABLE #23: Tue Feb  2 07:15:17 EST 2010
>Description:
PATA-SATA bridge directly in IDE socket, obviously wired incorrectly seeing it doesn't report an 80-pin 'cable', but there is no cable, and it works perfectly well up to UDMA-133 speeds (Condor MP20330-2 is the device).

FreeBSD 7, no problems, just enable hw.ata.ata_dma_check_80pin and most of the problems go away; still a slow PC with faster disks, but it all works.

Recently, I've had to try this with FreeBSD 8 and both with/without ATA_CAM, it no longer seems to apply.

From -v probe...

(aprobe0:ata0:0:0:0): SIGNATURE: 0000
ata0: DMA limited to UDMA33, controller found non-ATA66 cable
(aprobe0:ata0:0:1:0): SIGNATURE: 0000
ata0: DMA limited to UDMA33, controller found non-ATA66 cable

loader.conf definitely has
hw.ata.ata_dma_check_80pin=0


So that check shouldn't even be happening. 

>How-To-Repeat:
Use ancient hardware and a dodgy bridge to make it useful

>Fix:


>Release-Note:
>Audit-Trail:

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, sean@gothic.net.au
Cc:  
Subject: Re: kern/143462: [ata] hw.ata.ata_dma_check_80pin no longer seems
 to work [regression]
Date: Sat, 03 Jul 2010 18:35:37 +0300

 Hi.
 
 As I can see. ata_check_80pin even in FreeBSD 7.x disables only device
 side check. In your case speed limited from the controller driver side.
 Give more information about your controller to figure out what has
 changed there.
 
 -- 
 Alexander Motin
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sun Jul 4 00:57:32 UTC 2010 
State-Changed-Why:  
Note that feedback was requested. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143462 
State-Changed-From-To: feedback->patched 
State-Changed-By: mav 
State-Changed-When: Sat Jul 10 13:46:44 UTC 2010 
State-Changed-Why:  
Patch committed to HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143462 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/143462: commit references a PR
Date: Sat, 10 Jul 2010 13:46:58 +0000 (UTC)

 Author: mav
 Date: Sat Jul 10 13:46:14 2010
 New Revision: 209872
 URL: http://svn.freebsd.org/changeset/base/209872
 
 Log:
   Make hw.ata.ata_dma_check_80pin tunable affect not only device side, but
   also controller side cable checks. Make respective sysctl writable.
   
   PR:		kern/143462
 
 Modified:
   head/sys/dev/ata/ata-all.c
   head/sys/dev/ata/chipsets/ata-acerlabs.c
   head/sys/dev/ata/chipsets/ata-amd.c
   head/sys/dev/ata/chipsets/ata-highpoint.c
   head/sys/dev/ata/chipsets/ata-intel.c
   head/sys/dev/ata/chipsets/ata-ite.c
   head/sys/dev/ata/chipsets/ata-jmicron.c
   head/sys/dev/ata/chipsets/ata-marvell.c
   head/sys/dev/ata/chipsets/ata-promise.c
   head/sys/dev/ata/chipsets/ata-siliconimage.c
   head/sys/dev/ata/chipsets/ata-sis.c
 
 Modified: head/sys/dev/ata/ata-all.c
 ==============================================================================
 --- head/sys/dev/ata/ata-all.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/ata-all.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -105,7 +105,7 @@ SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, C
  	   "ATA disk DMA mode control");
  TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin);
  SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin,
 -	   CTLFLAG_RDTUN, &ata_dma_check_80pin, 1,
 +	   CTLFLAG_RW, &ata_dma_check_80pin, 1,
  	   "Check for 80pin cable before setting ATA DMA mode");
  TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma);
  SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0,
 
 Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-acerlabs.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-acerlabs.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -286,7 +286,7 @@ ata_ali_setmode(device_t dev, int target
          mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) {
  			ata_print_cable(dev, "controller");
  			mode = ATA_UDMA2;
 
 Modified: head/sys/dev/ata/chipsets/ata-amd.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-amd.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-amd.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -119,7 +119,7 @@ ata_amd_setmode(device_t dev, int target
  
  	mode = min(mode, ctlr->chip->max_dma);
  	if (ctlr->chip->cfg1 & AMD_CABLE) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    !(pci_read_config(parent, 0x42, 1) & (1 << devno))) {
  			ata_print_cable(dev, "controller");
  			mode = ATA_UDMA2;
 
 Modified: head/sys/dev/ata/chipsets/ata-highpoint.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-highpoint.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-highpoint.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -216,7 +216,7 @@ ata_highpoint_check_80pin(device_t dev, 
      res = pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x1:0x2);
      pci_write_config(parent, reg, val, 1);
  
 -    if (mode > ATA_UDMA2 && res) {
 +    if (ata_dma_check_80pin && mode > ATA_UDMA2 && res) {
  	ata_print_cable(dev, "controller");
  	mode = ATA_UDMA2;
      }
 
 Modified: head/sys/dev/ata/chipsets/ata-intel.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-intel.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-intel.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -336,7 +336,8 @@ ata_intel_new_setmode(device_t dev, int 
  	u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 };
  
  	mode = min(mode, ctlr->chip->max_dma);
 -	if (mode > ATA_UDMA2 && !(reg54 & (0x10 << devno))) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    !(reg54 & (0x10 << devno))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: head/sys/dev/ata/chipsets/ata-ite.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-ite.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-ite.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -139,7 +139,8 @@ ata_ite_821x_setmode(device_t dev, int t
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* check the CBLID bits for 80 conductor cable detection */
 -	if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x40, 2) &
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    (pci_read_config(parent, 0x40, 2) &
  			     (ch->unit ? (1<<3) : (1<<2)))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
 @@ -186,7 +187,8 @@ ata_ite_8213_setmode(device_t dev, int t
  
  	mode = min(mode, ctlr->chip->max_dma);
  
 -	if (mode > ATA_UDMA2 && !(reg54 & (0x10 << target))) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    !(reg54 & (0x10 << target))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: head/sys/dev/ata/chipsets/ata-jmicron.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-jmicron.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-jmicron.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -149,7 +149,8 @@ ata_jmicron_setmode(device_t dev, int ta
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* check for 80pin cable present */
 -	if (mode > ATA_UDMA2 && pci_read_config(dev, 0x40, 1) & 0x08) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    pci_read_config(dev, 0x40, 1) & 0x08) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: head/sys/dev/ata/chipsets/ata-marvell.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-marvell.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-marvell.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -188,7 +188,8 @@ ata_marvell_setmode(device_t dev, int ta
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* Check for 80pin cable present. */
 -	if (mode > ATA_UDMA2 && ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: head/sys/dev/ata/chipsets/ata-promise.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-promise.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-promise.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -470,7 +470,8 @@ ata_promise_setmode(device_t dev, int ta
      switch (ctlr->chip->cfg1) {
      case PR_OLD:
      case PR_NEW:
 -	if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x50, 2) &
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    (pci_read_config(parent, 0x50, 2) &
  				 (ch->unit ? 1 << 11 : 1 << 10))) {
  	    ata_print_cable(dev, "controller");
  	    mode = ATA_UDMA2;
 @@ -479,7 +480,7 @@ ata_promise_setmode(device_t dev, int ta
  
      case PR_TX:
  	ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b);
 -	if (mode > ATA_UDMA2 &&
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  	    ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x04) {
  	    ata_print_cable(dev, "controller");
  	    mode = ATA_UDMA2;
 @@ -487,7 +488,7 @@ ata_promise_setmode(device_t dev, int ta
  	break;
     
      case PR_MIO:
 -	if (mode > ATA_UDMA2 &&
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  	    (ATA_INL(ctlr->r_res2,
  		     (ctlr->chip->cfg2 & PR_SX4X ? 0x000c0260 : 0x0260) +
  		     (ch->unit << 7)) & 0x01000000)) {
 
 Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-siliconimage.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-siliconimage.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -389,7 +389,8 @@ ata_sii_setmode(device_t dev, int target
  	mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg2 & SII_SETCLK) {
 -	    if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x79, 1) &
 +	    if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +		(pci_read_config(parent, 0x79, 1) &
  				 (ch->unit ? 0x02 : 0x01))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
 
 Modified: head/sys/dev/ata/chipsets/ata-sis.c
 ==============================================================================
 --- head/sys/dev/ata/chipsets/ata-sis.c	Sat Jul 10 11:40:31 2010	(r209871)
 +++ head/sys/dev/ata/chipsets/ata-sis.c	Sat Jul 10 13:46:14 2010	(r209872)
 @@ -243,13 +243,13 @@ ata_sis_setmode(device_t dev, int target
  	mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg1 == SIS_133NEW) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		        pci_read_config(parent, ch->unit ? 0x52 : 0x50,2) & 0x8000) {
  		        ata_print_cable(dev, "controller");
  		        mode = ATA_UDMA2;
  		}
  	} else {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    pci_read_config(parent, 0x48, 1)&(ch->unit ? 0x20 : 0x10)) {
  		    ata_print_cable(dev, "controller");
  		    mode = ATA_UDMA2;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: mav 
State-Changed-When: Sun Jul 18 07:11:26 UTC 2010 
State-Changed-Why:  
patch merged to 8-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143462 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/143462: commit references a PR
Date: Sun, 18 Jul 2010 07:11:15 +0000 (UTC)

 Author: mav
 Date: Sun Jul 18 07:11:03 2010
 New Revision: 210204
 URL: http://svn.freebsd.org/changeset/base/210204
 
 Log:
   MFC r209872:
   Make hw.ata.ata_dma_check_80pin tunable affect not only device side, but
   also controller side cable checks. Make respective sysctl writable.
   
   PR:             kern/143462
 
 Modified:
   stable/8/sys/dev/ata/ata-all.c
   stable/8/sys/dev/ata/chipsets/ata-acerlabs.c
   stable/8/sys/dev/ata/chipsets/ata-amd.c
   stable/8/sys/dev/ata/chipsets/ata-highpoint.c
   stable/8/sys/dev/ata/chipsets/ata-intel.c
   stable/8/sys/dev/ata/chipsets/ata-ite.c
   stable/8/sys/dev/ata/chipsets/ata-jmicron.c
   stable/8/sys/dev/ata/chipsets/ata-marvell.c
   stable/8/sys/dev/ata/chipsets/ata-promise.c
   stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
   stable/8/sys/dev/ata/chipsets/ata-sis.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/dev/ata/ata-all.c
 ==============================================================================
 --- stable/8/sys/dev/ata/ata-all.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/ata-all.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -105,7 +105,7 @@ SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, C
  	   "ATA disk DMA mode control");
  TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin);
  SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin,
 -	   CTLFLAG_RDTUN, &ata_dma_check_80pin, 1,
 +	   CTLFLAG_RW, &ata_dma_check_80pin, 1,
  	   "Check for 80pin cable before setting ATA DMA mode");
  TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma);
  SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0,
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -286,7 +286,7 @@ ata_ali_setmode(device_t dev, int target
          mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) {
  			ata_print_cable(dev, "controller");
  			mode = ATA_UDMA2;
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-amd.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-amd.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-amd.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -119,7 +119,7 @@ ata_amd_setmode(device_t dev, int target
  
  	mode = min(mode, ctlr->chip->max_dma);
  	if (ctlr->chip->cfg1 & AMD_CABLE) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    !(pci_read_config(parent, 0x42, 1) & (1 << devno))) {
  			ata_print_cable(dev, "controller");
  			mode = ATA_UDMA2;
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-highpoint.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-highpoint.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-highpoint.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -216,7 +216,7 @@ ata_highpoint_check_80pin(device_t dev, 
      res = pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x1:0x2);
      pci_write_config(parent, reg, val, 1);
  
 -    if (mode > ATA_UDMA2 && res) {
 +    if (ata_dma_check_80pin && mode > ATA_UDMA2 && res) {
  	ata_print_cable(dev, "controller");
  	mode = ATA_UDMA2;
      }
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-intel.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-intel.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -336,7 +336,8 @@ ata_intel_new_setmode(device_t dev, int 
  	u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 };
  
  	mode = min(mode, ctlr->chip->max_dma);
 -	if (mode > ATA_UDMA2 && !(reg54 & (0x10 << devno))) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    !(reg54 & (0x10 << devno))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-ite.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-ite.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -139,7 +139,8 @@ ata_ite_821x_setmode(device_t dev, int t
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* check the CBLID bits for 80 conductor cable detection */
 -	if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x40, 2) &
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    (pci_read_config(parent, 0x40, 2) &
  			     (ch->unit ? (1<<3) : (1<<2)))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
 @@ -186,7 +187,8 @@ ata_ite_8213_setmode(device_t dev, int t
  
  	mode = min(mode, ctlr->chip->max_dma);
  
 -	if (mode > ATA_UDMA2 && !(reg54 & (0x10 << target))) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    !(reg54 & (0x10 << target))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-jmicron.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-jmicron.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-jmicron.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -149,7 +149,8 @@ ata_jmicron_setmode(device_t dev, int ta
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* check for 80pin cable present */
 -	if (mode > ATA_UDMA2 && pci_read_config(dev, 0x40, 1) & 0x08) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    pci_read_config(dev, 0x40, 1) & 0x08) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-marvell.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -188,7 +188,8 @@ ata_marvell_setmode(device_t dev, int ta
  
  	mode = min(mode, ctlr->chip->max_dma);
  	/* Check for 80pin cable present. */
 -	if (mode > ATA_UDMA2 && ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
  	}
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-promise.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-promise.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -470,7 +470,8 @@ ata_promise_setmode(device_t dev, int ta
      switch (ctlr->chip->cfg1) {
      case PR_OLD:
      case PR_NEW:
 -	if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x50, 2) &
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +	    (pci_read_config(parent, 0x50, 2) &
  				 (ch->unit ? 1 << 11 : 1 << 10))) {
  	    ata_print_cable(dev, "controller");
  	    mode = ATA_UDMA2;
 @@ -479,7 +480,7 @@ ata_promise_setmode(device_t dev, int ta
  
      case PR_TX:
  	ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b);
 -	if (mode > ATA_UDMA2 &&
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  	    ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x04) {
  	    ata_print_cable(dev, "controller");
  	    mode = ATA_UDMA2;
 @@ -487,7 +488,7 @@ ata_promise_setmode(device_t dev, int ta
  	break;
     
      case PR_MIO:
 -	if (mode > ATA_UDMA2 &&
 +	if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  	    (ATA_INL(ctlr->r_res2,
  		     (ctlr->chip->cfg2 & PR_SX4X ? 0x000c0260 : 0x0260) +
  		     (ch->unit << 7)) & 0x01000000)) {
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -389,7 +389,8 @@ ata_sii_setmode(device_t dev, int target
  	mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg2 & SII_SETCLK) {
 -	    if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x79, 1) &
 +	    if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
 +		(pci_read_config(parent, 0x79, 1) &
  				 (ch->unit ? 0x02 : 0x01))) {
  		ata_print_cable(dev, "controller");
  		mode = ATA_UDMA2;
 
 Modified: stable/8/sys/dev/ata/chipsets/ata-sis.c
 ==============================================================================
 --- stable/8/sys/dev/ata/chipsets/ata-sis.c	Sun Jul 18 05:09:10 2010	(r210203)
 +++ stable/8/sys/dev/ata/chipsets/ata-sis.c	Sun Jul 18 07:11:03 2010	(r210204)
 @@ -243,13 +243,13 @@ ata_sis_setmode(device_t dev, int target
  	mode = min(mode, ctlr->chip->max_dma);
  
  	if (ctlr->chip->cfg1 == SIS_133NEW) {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		        pci_read_config(parent, ch->unit ? 0x52 : 0x50,2) & 0x8000) {
  		        ata_print_cable(dev, "controller");
  		        mode = ATA_UDMA2;
  		}
  	} else {
 -		if (mode > ATA_UDMA2 &&
 +		if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
  		    pci_read_config(parent, 0x48, 1)&(ch->unit ? 0x20 : 0x10)) {
  		    ata_print_cable(dev, "controller");
  		    mode = ATA_UDMA2;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
