From owner-freebsd-current@FreeBSD.ORG Fri Oct 25 06:45:05 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 42620217; Fri, 25 Oct 2013 06:45:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x235.google.com (mail-ea0-x235.google.com [IPv6:2a00:1450:4013:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC8D520A5; Fri, 25 Oct 2013 06:45:04 +0000 (UTC) Received: by mail-ea0-f181.google.com with SMTP id d10so321349eaj.12 for ; Thu, 24 Oct 2013 23:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9q/4zQdoOzSKWaTXFVrtEdIo1LKb0sWhIWyWrUqfh88=; b=NP5LeA/5E0TczQdz9PquVrkwBoF3tkPMBEygIINaAjna5d9QHmZerIfWEk3C2PyB4r XsKmLSl4VRCPP90p1uKkkkF6K/RKqEoRJ0MUguAhzgfG1HmnKgLw7mEyOD+wn1F5xrCw SNsXrcSplGb9e2M8tVC2g1JqlvJ7TEVGgBUx0PZLzP5CZHKcwyrLKAlsMJpy9aUlvQvG N6ZNzVn4TtYRnbagVfK6TZNHglqVtIinQsc3QI5quhxHIFaEVSJcrqMOJthgmWAeI1/r 4q1UMY9FMc7410TCTYTWWRqmWm24W+0eIN6KU7weLp42/YsEOlx01H4iV9GvxzUnqXof wMeA== X-Received: by 10.14.6.134 with SMTP id 6mr5743663een.66.1382683503229; Thu, 24 Oct 2013 23:45:03 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([178.137.150.35]) by mx.google.com with ESMTPSA id m54sm13887972eex.2.2013.10.24.23.45.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 23:45:02 -0700 (PDT) Sender: Alexander Motin Message-ID: <526A136C.4030800@FreeBSD.org> Date: Fri, 25 Oct 2013 09:45:00 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Alexandre Martins Subject: Re: Troubles with VIA VX900 chipset References: <2304698.vixPKsOToE@pc-alex.netasq.com> In-Reply-To: <2304698.vixPKsOToE@pc-alex.netasq.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: fabien.thomas@netasq.com, current@freebsd.org, fabient@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 25 Oct 2013 06:45:05 -0000 Hi. On 24.10.2013 16:56, Alexandre Martins wrote: > We have seen some issues with the VIA VX900 chipset. The main trouble is that > some SATA hard drive are not seen by the kernel (BIOS and boot-loader are OK). > > After investigations, it seems that during the initialisation of the > controler, some reset commands are send via "ata_via_sata_reset" fonction. > Into the chipset documentation, there is a warning about successive reset > commands, and software must waiting the "BUSY" flag is clear, before send > another reset. I have added a "DELAY(10000)" between the second call of > "ata_sata_phy_reset" and the call of "ata_generic_reset" and the problem > disapear. > > I also made a more complex fix which check the "BUSY" flag. > > Which fix of delai checking is the better one ? One that sleeps less IMO should be better. Blocking system in a tight loop is not good. But still some comments: - ATA devices often want to spinup before reporting !BUSY, that may take up to 10 seconds, not 10 milliseconds, if you really want to get exactly !BUSY, not just wait a bit; - Waiting for readiness if phy reset found no device is probably pointless. - I would reduce polling interval -- 1ms is quite a lot. -- Alexander Motin