From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Nov 2008 17:49:36 +0000 (GMT) Received: from mail3.caviumnetworks.com ([12.108.191.235]:57399 "EHLO mail3.caviumnetworks.com") by ftp.linux-mips.org with ESMTP id S23819408AbYKURt3 (ORCPT ); Fri, 21 Nov 2008 17:49:29 +0000 Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503) id ; Fri, 21 Nov 2008 12:48:52 -0500 Received: from exch4.caveonetworks.com ([192.168.16.23]) by exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 21 Nov 2008 09:47:55 -0800 Received: from dd1.caveonetworks.com ([64.169.86.201]) by exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 21 Nov 2008 09:47:55 -0800 Message-ID: <4926F44B.2090205@caviumnetworks.com> Date: Fri, 21 Nov 2008 09:47:55 -0800 From: David Daney User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Sergei Shtylyov CC: Alan Cox , linux-ide@vger.kernel.org, linux-mips Subject: Re: [PATCH] ide: New libata driver for OCTEON SOC Compact Flash interface. References: <49261BE5.2010406@caviumnetworks.com> <20081121102137.634616c5@lxorguk.ukuu.org.uk> <4926EA6A.7040704@caviumnetworks.com> <4926EF55.7080004@ru.mvista.com> In-Reply-To: <4926EF55.7080004@ru.mvista.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Nov 2008 17:47:55.0547 (UTC) FILETIME=[48B80EB0:01C94C01] Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 21369 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ddaney@caviumnetworks.com Precedence: bulk X-list: linux-mips Sergei Shtylyov wrote: > David Daney wrote: [...] > >>> What stops the following occuring > >>> ATA irq >>> BUSY still set >>> Queue tasklet > >>> Other irq on same line >>> ATA busy clear >>> Handle command > > Is CF interrupt indeed shared with anything? > >>> Tasklet runs but command was sorted out > >>> (or a reset of the ata controller in the gap) > >> Probably nothing. I will try to sort it out. > > It's the need for the tasklet that seems doubtful to me... > The interrupt occurs *before* the device de-asserts BUSY. A small pause is needed to allow the device to clear BUSY and allow libata to function normally. Calling ata_sff_host_intr() while BUSY is asserted causes the driver to fail, as it is expecting to be called from a true IDE interrupt routine. Delaying calling ata_sff_host_intr() until BUSY is clear (using the tasklet) seemed to be the cleanest way to write the driver given that we are using an interrupt generated by DMA complete. David Daney.