public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* ->ack_intr in m68k IDE drivers  [was: Re: [PATCH 2/5] ide: ->ide_dma_clear_irq() -> ->clear_irq()]
       [not found]   ` <4A15600A.40906@ru.mvista.com>
@ 2009-05-22 18:44     ` Bartlomiej Zolnierkiewicz
       [not found]     ` <200905222044.42688.bzolnier@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-05-22 18:44 UTC (permalink / raw)
  To: Sergei Shtylyov, linux-m68k; +Cc: linux-ide, linux-kernel

On Thursday 21 May 2009 16:07:06 Sergei Shtylyov wrote:
> Hello, I wrote:
> 
> >>> * Rename ->ide_dma_clear_irq method to ->clear_irq
> >>>   and move it from ide_hwif_t to struct ide_port_ops.
> 
> >>> * Move ->waiting_for_dma check inside ->clear_irq method.
> 
> >>> * Move ->dma_base check inside ->clear_irq method.
> 
> >>> piix.c:
> >>> * Add ich_port_ops and remove init_hwif_ich() wrapper.
> 
> >>> There should be no functional changes caused by this patch.
> 
> [...]
> 
> >>   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, OTOH in clear_irq() we know that
already and we just want to clear the pending IRQ status.

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..

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ->ack_intr in m68k IDE drivers  [was: Re: [PATCH 2/5] ide: ->ide_dma_clear_irq() -> ->clear_irq()]
       [not found]     ` <200905222044.42688.bzolnier@gmail.com>
@ 2009-05-22 19:19       ` Sergei Shtylyov
  2009-05-22 19:19       ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2009-05-22 19:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-m68k, linux-ide, linux-kernel

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 same.

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ->ack_intr in m68k IDE drivers  [was: Re: [PATCH 2/5] ide: ->ide_dma_clear_irq() -> ->clear_irq()]
       [not found]     ` <200905222044.42688.bzolnier@gmail.com>
  2009-05-22 19:19       ` Sergei Shtylyov
@ 2009-05-22 19:19       ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2009-05-22 19:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-m68k, linux-ide, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-22 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200808192031.40288.bzolnier@gmail.com>
     [not found] ` <48CEDD89.5060107@ru.mvista.com>
     [not found]   ` <4A15600A.40906@ru.mvista.com>
2009-05-22 18:44     ` ->ack_intr in m68k IDE drivers [was: Re: [PATCH 2/5] ide: ->ide_dma_clear_irq() -> ->clear_irq()] Bartlomiej Zolnierkiewicz
     [not found]     ` <200905222044.42688.bzolnier@gmail.com>
2009-05-22 19:19       ` Sergei Shtylyov
2009-05-22 19:19       ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox