Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Apr 2011 00:17:44 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        Bruce Cran <bruce@cran.org.uk>
Cc:        FreeBSD-Current <freebsd-current@freebsd.org>
Subject:   Re: Switch from legacy ata(4) to CAM-based ATA
Message-ID:  <4DAF4D78.4010205@FreeBSD.org>
In-Reply-To: <4DAF2BFC.3030504@FreeBSD.org>
References:  <4DAEAE1B.70207@FreeBSD.org>	<20110420132001.000058e1@unknown>	<4DAECFDC.2050508@FreeBSD.org> <20110420191922.00002482@unknown> <4DAF2BFC.3030504@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040701020904010009010701
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Alexander Motin wrote:
> Bruce Cran wrote:
>> On Wed, 20 Apr 2011 15:21:48 +0300
>> Alexander Motin <mav@FreeBSD.org> wrote:
>>
>>> Verbose dmesg from the fresh system would be appreciated.
>> I've put a verbose dmesg at
>> http://www.cran.org.uk/~brucec/freebsd/dmesg.verbose_20110420.txt
> 
> Thank you. I've compared your and Daniel dmesgs, and while they are
> showing different emulated controllers, the problems seems to be common:
> ata_generic_reset() reports two devices on the channel with CD, while
> there is only one. As result, attempts to send requests to the missing
> device predictably cause timeouts. I have doubts that problem is
> specific to CAM-based ATA. It looks more probable to me that difference
> is just in command timeouts: 1 second with legacy ATA, and 30 seconds
> with CAM. Could you show me verbose dmesg with legacy ATA to make sure?
> Same time I'll try to think what can we do about it.

2 Bruce: Looking on XEN sources, it seems that the only place how it
differs missing and present disk is the device signature. ata(4) at this
moment doesn't checks signature if it is not ATAPI and READY bit is set.
Attached patch should solve the problem by using more strict check, and
I only hope it won't break anything else. Try it please.

2 Daniel: Your situation is different, as both devices reported equally
during soft-reset. The only place where I see difference is on SATA
layer. But the funny thing is that I can't find SATA support in XEN
sources. What are you using? Can you send me full verbose dmesg and
`pciconf -lvcb`?

-- 
Alexander Motin

--------------040701020904010009010701
Content-Type: text/plain;
 name="ata_strict.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ata_strict.patch"

Index: ata-lowlevel.c
===================================================================
--- ata-lowlevel.c	(revision 220837)
+++ ata-lowlevel.c	(working copy)
@@ -535,7 +535,7 @@
 		    if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 			ch->devices |= ATA_ATAPI_MASTER;
 		    }
-		    else if (stat0 & ATA_S_READY) {
+		    else if (lsb == 0 && msb == 0 && (stat0 & ATA_S_READY)) {
 			ch->devices |= ATA_ATA_MASTER;
 		    }
 		}
@@ -568,7 +568,7 @@
 		    if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 			ch->devices |= ATA_ATAPI_SLAVE;
 		    }
-		    else if (stat1 & ATA_S_READY) {
+		    else if (lsb == 0 && msb == 0 && (stat1 & ATA_S_READY)) {
 			ch->devices |= ATA_ATA_SLAVE;
 		    }
 		}

--------------040701020904010009010701--



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