From nobody@FreeBSD.org  Tue Oct 25 10:24:35 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AED1016A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 10:24:35 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7472F43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 10:24:35 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9PAOZIC021885
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 10:24:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9PAOZ65021884;
	Tue, 25 Oct 2005 10:24:35 GMT
	(envelope-from nobody)
Message-Id: <200510251024.j9PAOZ65021884@www.freebsd.org>
Date: Tue, 25 Oct 2005 10:24:35 GMT
From: Jacques Caron <jc@oxado.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: amd64 busdma dflt_lock called (by ata) if physmem>4G
X-Send-Pr-Version: www-2.3

>Number:         87977
>Category:       amd64
>Synopsis:       [busdma] [panic] amd64 busdma dflt_lock called (by ata) if physmem>4G
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 25 10:30:15 GMT 2005
>Closed-Date:    Fri Nov 21 06:27:04 UTC 2008
>Last-Modified:  Fri Nov 21 06:27:04 UTC 2008
>Originator:     Jacques Caron
>Release:        5.4
>Organization:
Oxado
>Environment:
FreeBSD db4.fr1.oxado.com 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Thu Oct 20 23:46:49 UTC 2005     root@artemis.oxado.com:/usr/obj/usr/src/sys/SMP  amd64           
>Description:
FreeBSD/amd64 5.4-RELEASE on Tyan K8SD Pro (S2882D) with two Opteron processors and 8 GB RAM, on-board SiI 3114 SATA controller and additional Promise SATA300TX4 SATA controller.

5.4-RELEASE was patched to add support for the Promise controller:

diff -c sys/dev/ata/ata-chipset.c.orig sys/dev/ata/ata-chipset.c
*** sys/dev/ata/ata-chipset.c.orig      Wed May 11 17:15:35 2005
--- sys/dev/ata/ata-chipset.c   Fri Sep  2 16:19:05 2005
***************
*** 1312,1317 ****
--- 1312,1320 ----
       { ATA_PDC20621,  0, PRMIO, PRSX4X,  ATA_UDMA5, "Promise PDC20621" },
       { ATA_PDC20622,  0, PRMIO, PRSX4X,  ATA_SA150, "Promise PDC20622" },
       { ATA_PDC40518,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40518" },
+      { ATA_PDC40519,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40519" },
+      { ATA_PDC40718,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40718" },
+      { ATA_PDC40719,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40719" },
       { 0, 0, 0, 0, 0, 0}};
      char buffer[64];
      uintptr_t devid = 0;
diff -c sys/dev/ata/ata-pci.h.orig sys/dev/ata/ata-pci.h
*** sys/dev/ata/ata-pci.h.orig  Wed May 11 17:15:35 2005
--- sys/dev/ata/ata-pci.h       Fri Sep  2 16:19:56 2005
***************
*** 180,185 ****
--- 180,188 ----
  #define ATA_PDC20579          0x3574105a
  #define ATA_PDC20580          0x3570105a
  #define ATA_PDC40518          0x3d18105a
+ #define ATA_PDC40519            0x3519105a
+ #define ATA_PDC40718            0x3d17105a
+ #define ATA_PDC40719            0x3515105a
  #define ATA_PDC20617          0x6617105a
  #define ATA_PDC20618          0x6626105a
  #define ATA_PDC20619          0x6629105a

Any kind of serious I/O involving several of the Promise-based disks or
a combination of the Promise-based disks and the SiI-based ones will cause
a panic "busdma dflt_lock called".

Any level of I/O on the SiI only apparently never causes the problem.

Setting hw.physmem=3g in /boot/loader.conf apparently makes the problem
go away, but I need the additional memory...

Similar issues with other drivers are found here:
http://www.monkey.org/freebsd/archive/freebsd-amd64/200411/msg00070.html

and possibly here:
http://www.mail-archive.com/freebsd-hardware@freebsd.org/msg00536.html

It seems the issue is either in the busdma code, or the way the busdma code
is used by those drivers.

As an aside, fxp has a long delay during boot with 8G, but this goes away
when hw.physmem is set to 3g.

>How-To-Repeat:
amd64 with 8G RAM and 4 disks on a Promise SATA300TX4,

dd of=/dev/null if=/dev/ad12 bs=256000 &
dd of=/dev/null if=/dev/ad14 bs=256000 &
dd of=/dev/null if=/dev/ad16 bs=256000 &
dd of=/dev/null if=/dev/ad18 bs=256000 &

You will never get to the last one.

>Fix:
Workaround (not fix): set hw.physmem to less than 4G.


>Release-Note:
>Audit-Trail:

From: Thomas Hurst <tom@hur.st>
To: bug-followup@FreeBSD.org
Cc: jc@oxado.com
Subject: Re: amd64/87977 : [busdma] [panic] amd64 busdma dflt_lock called (by ata) if physmem>4G
Date: Tue, 27 Dec 2005 15:52:26 +0000

 I see this with RELENG_6 on a Tyan S2895 using the on-board nForce 4
 SATA with >2 disks and 4G of memory.  A simple gmirror load across 3 or
 more disks is sufficient to cause a panic.
 
 Are there any suggested workarounds beyond not using 4G or finding a
 controller that doesn't use ata(4)?
 
 -- 
 Thomas 'Freaky' Hurst
     http://hur.st/

From: Thomas Hurst <tom@hur.st>
To: Attila Nagy <bra@fsn.hu>
Cc: freebsd-amd64@FreeBSD.org, bug-followup@freebsd.org
Subject: Re: amd64/87977 : [busdma] [panic] amd64 busdma dflt_lock called (by ata) if physmem>4G
Date: Tue, 27 Dec 2005 20:31:22 +0000

 * Attila Nagy (bra@fsn.hu) wrote:
 
 > I believe this is fixed in CURRENT. On 6-STABLE you can set hw.physmem
 > to use a smaller amount of memory or switch to the ata driver before
 > 2005.10.08.
 
 Thanks for the pointer.  I grabbed sys/dev/ata and sys/sys/ata.h off
 my CURRENT laptop and popped it on my RELENG_6 Opteron and it appears
 to work fine with all 4G -- I can pull data off all 4 disks at >250M/s
 without trouble when I could previously not even get past mounting
 filesystems.
 
 Hope to see this merged before too long, but for now at least this pr is
 a little bit more useful :)
 
 -- 
 Thomas 'Freaky' Hurst
     http://hur.st/

From: Attila Nagy <bra@fsn.hu>
To: Thomas Hurst <tom@hur.st>
Cc: freebsd-amd64@FreeBSD.org,  bug-followup@freebsd.org
Subject: Re: amd64/87977 : [busdma] [panic] amd64 busdma dflt_lock called
 (by ata) if physmem>4G
Date: Tue, 27 Dec 2005 21:41:35 +0100

 Thomas Hurst wrote:
 >>I believe this is fixed in CURRENT. On 6-STABLE you can set hw.physmem
 >>to use a smaller amount of memory or switch to the ata driver before
 >>2005.10.08.
 > Thanks for the pointer.  I grabbed sys/dev/ata and sys/sys/ata.h off
 > my CURRENT laptop and popped it on my RELENG_6 Opteron and it appears
 > to work fine with all 4G -- I can pull data off all 4 disks at >250M/s
 > without trouble when I could previously not even get past mounting
 > filesystems.
 > Hope to see this merged before too long, but for now at least this pr is
 > a little bit more useful :)
 Good to hear that, thanks.
 
 According to Soren the whole ATA driver will be merged soon.
 
 -- 
 Attila Nagy                                   e-mail: Attila.Nagy@fsn.hu
 Free Software Network (FSN.HU)                 phone: +3630 306 6758
 ISOs: http://www.fsn.hu/?f=download
State-Changed-From-To: open->feedback 
State-Changed-By: delphij 
State-Changed-When: Mon Nov 3 07:34:45 UTC 2008 
State-Changed-Why:  
Dear submitter, 

Do you think the problem still exists in recent FreeBSD versions? 

Thanks in advance! 


Responsible-Changed-From-To: freebsd-amd64->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Nov 3 07:34:45 UTC 2008 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87977 
State-Changed-From-To: feedback->closed 
State-Changed-By: delphij 
State-Changed-When: Fri Nov 21 06:26:50 UTC 2008 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87977 
>Unformatted:
