Bug 148526

Summary: [ahci] ahci driver does not boot on AMD chip
Product: Base System Reporter: Yury <yury>
Component: amd64Assignee: freebsd-amd64 (Nobody) <amd64>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
bad_boot_msgs.txt
none
good_boot_msgs.txt none

Description Yury 2010-07-12 18:50:05 UTC
 Trying to buildkernel with ahci driver instead of ata (or with 
 it) ends up with infinite loop of requests from ahci driver, exiting 
 only by manual reboot.
 Smth about "timeout" and "not ready" messages.

How-To-Repeat:  To build kernel with ahci driver on such hardware. To include 
 ahci in loader.conf is sufficient.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-07-12 18:51:31 UTC
Responsible Changed
From-To: gnats-admin->freebsd-i386

recover formatting.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2010-07-12 18:53:14 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-amd64

oops, reclassify.
Comment 3 Andriy Gapon freebsd_committer freebsd_triage 2010-12-05 14:29:32 UTC
Can you provide some technical information about the problem?
Screen captures, etc?

Alexander,
maybe you've got some ideas/suggestions?

-- 
Andriy Gapon
Comment 4 Alexander Motin freebsd_committer freebsd_triage 2010-12-05 14:41:17 UTC
On 05.12.2010 16:29, Andriy Gapon wrote:
> Can you provide some technical information about the problem?
> Screen captures, etc?
>
> Alexander,
> maybe you've got some ideas/suggestions?

Not with this info. Verbose dmesg with fresh STABLE would be more useful.

-- 
Alexander Motin
Comment 5 Yury 2010-12-09 17:08:05 UTC
Here they are, message files.

The "bad" file is messages during boot try with the ahci driver, and the "good" 
one is the backed up kernel version with ata driver.  In the "bad" boot try 
messages last lines could repeat infinitely. And, as I can see there are some 
'time-out' messages in "good" variant, but everything works just fine. BIOS was 
updated to 15.06.

Only differences in kernel config files are:

< device        ata
< device        atadisk
    ---
  > #device        ata
  > #device        atadisk

< ##device        ahci
< device        atapicd
    ---
  > device        ahci
  > #device        atapicd

P.S. Sorry, can't figure out how to reply properly. Undeliverable if sent to 
"<bug-followup@FreeBSD.org>"
Comment 6 Andriy Gapon freebsd_committer freebsd_triage 2010-12-16 17:11:38 UTC
on 09/12/2010 19:08 Yury said the following:
> Here they are, message files.
> 
> The "bad" file is messages during boot try with the ahci driver, and the "good"
> one is the backed up kernel version with ata driver.  In the "bad" boot try
> messages last lines could repeat infinitely. And, as I can see there are some
> 'time-out' messages in "good" variant, but everything works just fine. BIOS was
> updated to 15.06.
> 
> Only differences in kernel config files are:
> 
> < device        ata
> < device        atadisk
>    ---
>  > #device        ata
>  > #device        atadisk
> 
> < ##device        ahci
> < device        atapicd
>    ---
>  > device        ahci
>  > #device        atapicd
> 

Yury,
will you be able to test ahci with this hardware using stable/8?

Alexander,
can you please take a look at this PR?

-- 
Andriy Gapon
Comment 7 Alexander Motin freebsd_committer freebsd_triage 2010-12-16 17:39:50 UTC
On 16.12.2010 19:11, Andriy Gapon wrote:
> on 09/12/2010 19:08 Yury said the following:
>> Here they are, message files.
>>
>> The "bad" file is messages during boot try with the ahci driver, and the "good"
>> one is the backed up kernel version with ata driver.  In the "bad" boot try
>> messages last lines could repeat infinitely. And, as I can see there are some
>> 'time-out' messages in "good" variant, but everything works just fine. BIOS was
>> updated to 15.06.
>>
>> Only differences in kernel config files are:
>>
>> <  device        ata
>> <  device        atadisk
>>     ---
>>   >  #device        ata
>>   >  #device        atadisk
>>
>> <  ##device        ahci
>> <  device        atapicd
>>     ---
>>   >  device        ahci
>>   >  #device        atapicd
>>
>
> Yury,
> will you be able to test ahci with this hardware using stable/8?

I can see interrupt status bit set here. Timeout in that case may mean 
that interrupt was not delivered/handled for some reason. Could you 
check if this controller supports MSI interrupts with `pciconf -lvbc`? 
If it does and driver uses it - you may try to disable it by setting 
loader tunable `hint.ahci.0.msi=0'.

It could also be useful to enable verbose kernel messages at boot menu.

-- 
Alexander Motin
Comment 8 Alexander Motin freebsd_committer freebsd_triage 2010-12-17 09:32:50 UTC
Yury wrote:
> Yes, pciconf is non-empty about MSI (attached).
> 
> And the hint.ahci.0.msi="0" in loader.conf worked for me, with it it can
> boot, thank you.
> `Good' AHCI verbose messages are attached also.
> (The kernel configuration was changed to not only include AHCI, but also
> ATA driver, because I have IDE CD-ROM.)

As I can see, AHCI is not the only controller in this system using MSI.
Does the others (sound, network, ...) work correctly?

Linux explicitly disables MSI for SB600 chips, but not for this SB700.

-- 
Alexander Motin
Comment 9 Alexander Motin freebsd_committer freebsd_triage 2011-04-28 20:09:58 UTC
State Changed
From-To: open->closed

Specific case handled by setting tunable. Real problem cause and 
possibility of permanent fix is unclear. May be board-specific.