From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chad Reese Subject: Re: [PATCH] ide: New libata driver for OCTEON SOC Compact Flash interface. Date: Sat, 22 Nov 2008 10:38:50 -0800 Message-ID: <492851BA.3060306@caviumnetworks.com> References: <49261BE5.2010406@caviumnetworks.com> <49280FC5.3040608@ru.mvista.com> <49282187.8090602@ru.mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from smtp2.caviumnetworks.com ([209.113.159.134]:11081 "EHLO smtp2.caviumnetworks.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbYKVSjb (ORCPT ); Sat, 22 Nov 2008 13:39:31 -0500 In-Reply-To: <49282187.8090602@ru.mvista.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Sergei Shtylyov Cc: David Daney , linux-ide@vger.kernel.org, linux-mips Sergei Shtylyov wrote: > Also, this fragment of octeon_cf_bmdma_status() looks doubtful to me: > >> + else if (mio_boot_dma_cfg.s.size != 0xfffff) >> + result |= ATA_DMA_ERR; > > I suppose this only makes sense when DMA interrupt is active. What > does this bitfield mean? When you start the Octeon DMA engine, you program mio_boot_dma_cfg.s.size with the number of 16bit words to transfer. As the DMA runs, the hardware decrements this field. At the end it ends up decrementing past 0 to -1. The above check is simply checking if the DMA completed. Since this specific interrupt can only be generated by the DMA engine, it must have been caused by an error condition if the size is not -1. Chad