From owner-freebsd-current@FreeBSD.ORG Wed Apr 20 21:18:08 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC2B8106566C for ; Wed, 20 Apr 2011 21:18:07 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 731078FC0C for ; Wed, 20 Apr 2011 21:18:07 +0000 (UTC) Received: by fxm11 with SMTP id 11so983831fxm.13 for ; Wed, 20 Apr 2011 14:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=H+NmXM79EmsUY+hL5Tb4mEt0himJr+NhpSJ7ctWUoW0=; b=x8L/JU+7ZhK4HX1a/M2S39OywQANd1tpFJZru2iMZFk6XEuycrQ6/ilaPeX+s5VBBN YX2RP1wNkiAblXfODQnGuZjab8Cu+tFd3++0D6qntTiWGTCccUndVEkmUyCY1C1FtkQp QOzGPxxjnWZOntBlKcTm5wVIWCBgpAAUcAhe8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=uQQy3TibB38zMVdkAhWB7eBU5Q0Gze2Pp0Z+cAYxHrPUwE9P8R+2+I6foFACiqjSXy Qg1pzJt7LsPQkGXhBu5eWfhPt0htged8CDEFet+RwOqMMMDeZ4MPHQHDuZ16v2bgBL1n +tedjKqNzfRgoOReAGfDWaizcoowJAe4vpt4k= Received: by 10.223.79.79 with SMTP id o15mr791099fak.16.1303334285202; Wed, 20 Apr 2011 14:18:05 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id o17sm401072fal.25.2011.04.20.14.18.03 (version=SSLv3 cipher=OTHER); Wed, 20 Apr 2011 14:18:04 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DAF4D78.4010205@FreeBSD.org> Date: Thu, 21 Apr 2011 00:17:44 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Bruce Cran References: <4DAEAE1B.70207@FreeBSD.org> <20110420132001.000058e1@unknown> <4DAECFDC.2050508@FreeBSD.org> <20110420191922.00002482@unknown> <4DAF2BFC.3030504@FreeBSD.org> In-Reply-To: <4DAF2BFC.3030504@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: multipart/mixed; boundary="------------040701020904010009010701" Cc: FreeBSD-Current Subject: Re: Switch from legacy ata(4) to CAM-based ATA X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2011 21:18:08 -0000 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 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--