Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2009 01:42:22 GMT
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/132082: [ patch ] ATA driver does not find PATA drives attached to JMB363 controller
Message-ID:  <200902250142.n1P1gMWb085188@www.freebsd.org>
Resent-Message-ID: <200902250150.n1P1o13r056949@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         132082
>Category:       kern
>Synopsis:       [ patch ] ATA driver does not find PATA drives attached to JMB363 controller
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 25 01:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dieter
>Release:        7.1 amd64
>Organization:
>Environment:
7.1-RELEASE amd64
>Description:
FreeBSD 7.1
amd64
nforce4-ultra (ad2 - ad10)
2 JMicron JMB363 controllers (ad12 and above)

7.1 kernel (without my patch)

# dmesg | grep 363
atapci4: <JMicron JMB363 SATA300 controller> port 0x5c00-0x5c07,0x5800-0x5803,0x
5400-0x5407,0x5000-0x5003,0x4c00-0x4c0f mem 0xfe3fe000-0xfe3fffff irq 12 at devi
ce 0.0 on pci6
# dmesg | grep ^ad
ad2: 305245MB <Seagate ST3320620A 3.AAC> at ata1-master UDMA100
ad4: 715404MB <Seagate ST3750640AS 3.AAE> at ata2-master SATA300
ad6: 715404MB <Seagate ST3750640AS 3.AAE> at ata3-master SATA300
ad8: 953869MB <Hitachi HDT721010SLA360 ST6OA31B> at ata4-master SATA300
ad10: 953869MB <SAMSUNG HD103UJ 1AA01113> at ata5-master SATA300
ad12: 238475MB <Seagate ST3250823AS 3.03> at ata6-master SATA150
ad14: 715404MB <Seagate ST3750330AS SD15> at ata7-master SATA300
ad16: 953869MB <WDC WD10EACS-00ZJB0 01.01B01> at ata8-master SATA300
#

The stock 7.1 kernel (7.0 was the same) does not see any PATA devices
connected to the JMicron JMB363 controllers.  It does see PATA and SATA
devices connected to the nforce4-ultra controller, and they work.  It does
see SATA devices connected to the JMicron JMB363 controllers and they
work.

I added a quick-and-dirty patch to ata-pci.c that tries ata_jmicron_ident()
before ata_ahci_ident().

# dmesg | grep 363
atapci3: <JMicron JMB363 SATA300 controller> at device 0.0 on pci3
atapci4: <JMicron JMB363 SATA300 controller> port 0x5c00-0x5c07,0x5800-0x5803,0x5400-0x5407,0x5000-0x5003,0x4c00-0x4c0f mem \
0xfe3fe000-0xfe3fffff irq 12 at device 0.0 on pci6
# dmesg | grep ^ad
ad2: 305245MB <Seagate ST3320620A 3.AAC> at ata1-master UDMA100
ad4: 715404MB <Seagate ST3750640AS 3.AAE> at ata2-master SATA300
ad6: 715404MB <Seagate ST3750640AS 3.AAE> at ata3-master SATA300
ad8: 953869MB <Hitachi HDT721010SLA360 ST6OA31B> at ata4-master SATA300
ad10: 953869MB <SAMSUNG HD103UJ 1AA01113> at ata5-master SATA300
ad12: 238475MB <Seagate ST3250823AS 3.03> at ata6-master SATA150
ad14: 715404MB <Seagate ST3750330AS SD15> at ata7-master SATA300
ad16: 305245MB <Seagate ST3320620A 3.AAC> at ata8-master UDMA100
ad18: 953869MB <WDC WD10EACS-00ZJB0 01.01B01> at ata9-master SATA300

With my patch, the kernel does see PATA devices (ad16) connected to the
JMicron JMB363 controllers.  The WDC SATA drive gets moved from
ad16 to ad18.

Perhaps unrelated, the Seagate PATA drive connects at UDMA100.
Reading works fine, but writing consistantly fails:

ad16: WARNING - WRITE_DMA UDMA ICRC error (retrying request) LBA=191
ad16: WARNING - WRITE_DMA UDMA ICRC error (retrying request) LBA=191
ad16: FAILURE - WRITE_DMA status=51<READY,DSC,ERROR> error=84<ICRC,ABORTED> LBA=191

I downgraded it from 100 to 66
# atacontrol mode ad16 UDMA66

and at 66 writing works ok.  The same disk works fine at 100
with other controllers.  Standard 80 wire flat ribbon cable,
not round or extra long or anything wierd.

My patch might not be the best way to fix this problem.  For all
I know it might even break something on other systems.  All I
can say is it works for me.  :-)

>How-To-Repeat:
Connect a PATA device to a JMB363 controller.  Boot 7.0 or 7.1 and observe
that the kernel does not find the drive.

>Fix:
My patch works for me.


Patch attached with submission follows:

--- ata-pci.c	2008/04/21 23:14:03	1.1
+++ ata-pci.c	2008/04/21 23:15:41
@@ -76,6 +76,13 @@
     if (pci_get_class(dev) != PCIC_STORAGE)
 	return ENXIO;
 
+    if ( pci_get_vendor(dev) == ATA_JMICRON_ID )
+      {
+	printf("DEBUG ata-pci.c ata_pci_probe() trying ata_jmicron_ident() before ata_ahci_ident()\n");
+	if (!ata_jmicron_ident(dev))
+	    return ATA_PROBE_OK;
+      }
+
     /* if this is an AHCI chipset grab it */
     if (pci_get_subclass(dev) == PCIS_STORAGE_SATA) {
 	if (!ata_ahci_ident(dev))


>Release-Note:
>Audit-Trail:
>Unformatted:



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