From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: ->ack_intr in m68k IDE drivers [was: Re: [PATCH 2/5] ide: ->ide_dma_clear_irq() -> ->clear_irq()] Date: Fri, 22 May 2009 23:19:24 +0400 Message-ID: <4A16FABC.3010906@ru.mvista.com> References: <200808192031.40288.bzolnier@gmail.com> <48CEDD89.5060107@ru.mvista.com> <4A15600A.40906@ru.mvista.com> <200905222044.42688.bzolnier@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200905222044.42688.bzolnier@gmail.com> Sender: linux-m68k-owner@vger.kernel.org List-Id: linux-m68k@vger.kernel.org To: Bartlomiej Zolnierkiewicz Cc: linux-m68k@lists.linux-m68k.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Bartlomiej Zolnierkiewicz wrote: >>>> It may also be worth considering turning this method into >>>>test-and-clear, so that we can get the actual IDE interrupt state on >>>>the chips that implement this... >>> Probably might add the test_irq() method to be called on >>>!hwif->waiting_for_dma. Cleraing the status at once seems impractical... >> Yet this seems what ack_intr() method is doing already... >> What it does is testing IRQ status and "acknowledging" it (the semantics >>of "acknowledge" is not clear to me, yet it seems that it's clearing the >>interrupt latch in the drivers where it's implemented). And the call site of >>ack_intr() method corresponds to where test_irq() should have been called, >>so it seems we don't need yet another method and probably didn't even need >>clear_irq() method in the first place?.. > They have different goals -- the main purpose of ack_intr() (despite its name) > seems to be testing whether the IRQ is ours, It does clear some interrupt bit if it sees that IRQ is ours too, hence the name. > OTOH in clear_irq() we know that > already and we just want to clear the pending IRQ status. There seems to be duplication of functionality b/w ack_intr() and clear_irq() now... > So I'm not sure if unification is desirable... though some improvements are > definitely possibly there (less confusing naming at least)... >> Bart, could you clarify about how ack_intr() is supposed to work? > Good question, m68k list would be the best place to look for an answer.. Well, I seem to have been able to infer it from the code... MBR, Sergei