From nobody@FreeBSD.org  Fri Jun 12 09:07:27 2009
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 52587106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Jun 2009 09:07:27 +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 24F018FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Jun 2009 09:07:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C97Q6I082009
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Jun 2009 09:07:26 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n5C97QaY082008;
	Fri, 12 Jun 2009 09:07:26 GMT
	(envelope-from nobody)
Message-Id: <200906120907.n5C97QaY082008@www.freebsd.org>
Date: Fri, 12 Jun 2009 09:07:26 GMT
From: Keeper <hd_keeper@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ata] JMicron JMB363 controller does not recognize PATA hard disk
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         135497
>Category:       kern
>Synopsis:       [ata] JMicron JMB363 controller does not recognize PATA hard disk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 12 09:10:01 UTC 2009
>Closed-Date:    
>Last-Modified:  Fri Mar 12 08:20:05 UTC 2010
>Originator:     Keeper
>Release:        7.1-RELEASE, 7.2-RELEASE
>Organization:
none
>Environment:
System: FreeBSD aeon 7.2-RELEASE-p1 FreeBSD 7.2-RELEASE-p1 #0: Wed Jun 10 20:09:14 MSD 2009 keeper@aeon:/usr/obj/usr/src/sys/KEEPER i386
Hardware: Motherboard ASUS P5K-E with JMicron JMB363 PATA controller
BIOS settings: J-Micron eSATA/PATA Controller - Enabled, Controller Mode - IDE
>Description:
I've got a motherboard ASUS P5K-E with JMicron JMB363 PATA controller.
I connect Seagate PATA hard disk to the JMicron controller's port.
After the system startup, the kernel do recognize JMB363 PATA controller,
but PATA hard disk is not recognized:

atapci0: [JMicron JMB363 SATA300 controller] port 0xec00-0xec07,0xe880-0xe883,0xe800-0xe807,0xe480-0
xe483,0xe400-0xe40f mem 0xfeafe000-0xfeafffff irq 16 at device 0.0 on pci3
atapci0: [ITHREAD]
atapci0: AHCI called from vendor specific driver
atapci0: AHCI Version 01.00 controller with 2 ports detected

No corresponding device file is created under /dev either.
Also, I've tried both patches (patch.txt and patch-2.diff)
submitted for PR kern/132082 with no success.

>How-To-Repeat:
Get a box with a motherboard with Intel ICH9 chipset and JMicron JMB363 PATA
controller.
Connect a PATA (IDE) hard disk to the PATA controller's port.
Boot FreeBSD either 7.1-RELEASE or 7.2-RELEASE.

>Fix:
I've found a dirty hack to work around this issue. Detaching and attaching
ATA channels do some magic - PATA hard disk becomes available and works fine
afterwards.

# atacontrol detach ata4 && atacontrol attach ata4
ata4: [ITHREAD]
ad9: 76319MB [Seagate ST380011A 8.01] at ata4-slave UDMA100
GEOM_LABEL: Label for provider ad9s1 is ntfs/PORTABLE.
Master:      no device present
Slave:   ad9 [ST380011A/8.01] ATA/ATAPI revision 6

If one executes this magic command once again, the hard disk disappears:

# atacontrol detach ata4 && atacontrol attach ata4
GEOM_LABEL: Label ntfs/PORTABLE removed.
ata4: [ITHREAD]
Master:      no device present
Slave:       no device present


>Release-Note:
>Audit-Trail:

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, hd_keeper@mail.ru
Cc:  
Subject: Re: kern/135497: [ata] JMicron JMB363 controller does not recognize
 PATA hard disk
Date: Fri, 12 Mar 2010 10:18:45 +0200

 Booting with verbose messages may give more info.
 
 -- 
 Alexander Motin
>Unformatted:
