From nobody@FreeBSD.org  Thu Dec 16 08:47: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 83927106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Dec 2010 08:47:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 71A108FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Dec 2010 08:47:53 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oBG8lrZt063791
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Dec 2010 08:47:53 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id oBG8lrfZ063789;
	Thu, 16 Dec 2010 08:47:53 GMT
	(envelope-from nobody)
Message-Id: <201012160847.oBG8lrfZ063789@red.freebsd.org>
Date: Thu, 16 Dec 2010 08:47:53 GMT
From: Dmitry Pryanishnikov <lynx.ripe@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: PIONEER DVD-RW: timeout with ahci(4), OK with ata(4) + ATA_CAM
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         153205
>Category:       kern
>Synopsis:       [ahci] PIONEER DVD-RW: timeout with ahci(4), OK with ata(4) + ATA_CAM
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 16 08:50:06 UTC 2010
>Closed-Date:    
>Last-Modified:  Fri Apr 29 18:40:11 UTC 2011
>Originator:     Dmitry Pryanishnikov
>Release:        RELENG_8
>Organization:
Home
>Environment:
FreeBSD lynx.homenet 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #1: Thu Dec 16 01:36:59 EET 2010     root@lynx.homenet:/databig/obj/databig/ftp/RELENG_8/src.101215/sys/lynx  amd64

>Description:
Hardware: INTEL D975XBX2 mb, Intel Core2 Quad CPU (Q6600), 8Gb of ECC RAM, PATA HDD (SAMSUNG SP1614N), SATA HDD (Seagate ST31000520AS), SATA DVD-RW (PIONEER DVR-215D). Both SATA HDD and SATA DVD-RW are connected to Intel ICH7 SATA300 controller. Worked w/o problems using old ata(4) driver, still works OK using ata(4) in ATA_CAM mode. However, loading ahci(4) results in HDD still working, but DVD-RW doesn't even get detected during the boot (I've tried different SATA ports on this controller and different SATA cables - results are the same).

Kernel configuration:

http://sites.google.com/site/lynxripe/freebsd/pr/20101216-ahci/lynx?attredirects=0&d=1

loader.conf for ata(4) case (for using ahci(4) I simply load it from the loader's prompt):

http://sites.google.com/site/lynxripe/freebsd/pr/20101216-ahci/loader.conf?attredirects=0&d=1

Verbose dmesg w/o ahci module (DVD-RW attached by ata(4) and works OK):

http://sites.google.com/site/lynxripe/freebsd/pr/20101216-ahci/dmesg-v.boot?attredirects=0&d=1

Verbose dmesg with ahci module (DVD-RW does not attach):

http://sites.google.com/site/lynxripe/freebsd/pr/20101216-ahci/dmesg-v-ahci.boot?attredirects=0&d=1

I'm ready to provide any additional information about this HW and try patches on it.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, lynx.ripe@gmail.com
Cc:  
Subject: Re: kern/153205: [ahci] PIONEER DVD-RW: timeout with ahci(4), OK
 with ata(4) + ATA_CAM
Date: Thu, 28 Apr 2011 21:49:51 +0300

 Hi.
 
 As I can see from dmesg, controller reports that command is completed,
 but driver either haven't received interrupt or mishandled it.
 
 Just an idea, could you try to disable MSI interrupts for the controller
 by setting hint.ahci.0.msi=0 in /boot/loader.conf?
 
 -- 
 Alexander Motin

From: Dmytro Pryanyshnikov <lynx.ripe@gmail.com>
To: Alexander Motin <mav@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: kern/153205: [ahci] PIONEER DVD-RW: timeout with ahci(4), OK with
 ata(4) + ATA_CAM
Date: Fri, 29 Apr 2011 21:06:30 +0300

 Hello!
 
 2011/4/28 Alexander Motin <mav@freebsd.org>:
 > Hi.
 >
 > As I can see from dmesg, controller reports that command is completed,
 > but driver either haven't received interrupt or mishandled it.
 >
 > Just an idea, could you try to disable MSI interrupts for the controller
 > by setting hint.ahci.0.msi=0 in /boot/loader.conf?
 
   I've made an investigation using the same kernel config as in
 original submission:
 
 http://sites.google.com/site/lynxripe/freebsd/pr/20101216-ahci/lynx
 
 but with more recent RELENG_8 sources (as of 2011-03-07). So, without
 disabling MSI, problem is the same as originally described (timeout +
 no cd0 when using ahci instead of ata with the Intel ICH7 AHCI SATA
 controller):
 
 http://sites.google.com/site/lynxripe/freebsd/pr/153205/110429/dmesg.txt
 
 Setting hint.ahci.0.msi=0 _almost_ cures the problem: cd0 works, and
 verbose boot logs most often look like this:
 
 http://sites.google.com/site/lynxripe/freebsd/pr/153205/110429/dmesg-nomsi.txt
 
 However, sometimes (I've seen it 2 times out of 6 reboots) vestiges of
 the problem still appear in the form of non-fatal timeout:
 
 http://sites.google.com/site/lynxripe/freebsd/pr/153205/110429/dmesg-nomsi2.txt
 http://sites.google.com/site/lynxripe/freebsd/pr/153205/110429/dmesg-nomsi3.txt
 
 OTOH, ata(4)+ATA_CAM works with MSI enabled for this controller
 (hint.atapci.1.msi=1) just fine:
 
 http://sites.google.com/site/lynxripe/freebsd/pr/153205/110429/dmesg-ata-msi.txt
 
 
 >
 > --
 > Alexander Motin
 >
 
 
 
 -- 
 Sincerely, Dmytro
>Unformatted:
