linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] libata: irq_on/off restructuring (take #2)
@ 2007-07-07  6:57 Albert Lee
  2007-07-07  7:00 ` [PATCH 1/7] libata: remove irq_on from ata_bus_reset() and ata_std_postreset() Albert Lee
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Albert Lee @ 2007-07-07  6:57 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, Doug Maxey, Mark Lord, Tejun Heo, Linux IDE

(Revised per Tejun's advice.)
For ATA, there are two levels of mechanism available to turn irq on/off.
- device level: nIEN bit in the control register. This masks INTRQ from the device.
- host adapter level: some controllers can mask out per-port irq from the host adapter.

Currently various parts of libata deal with irq on/off.
  ex. tf_load() can alter the nIEN bit.
  ex. irq_on() also alters the device level nIEN bit.
  ex. freeze()/thaw() deal with the host adapter irq mask.

It seems these irq_on/off codes could be better structured.
Patches against the libata-dev tree for your review, thanks.

1/7: remove irq_on from ata_bus_reset() and ata_std_postreset()
2/7: sata_promise::pdc_freeze() semantic change
3/7: add freeze()/thaw() to old EH LLDDs
4/7: use freeze()/thaw() for polling PIO
5/7: integrate freeze/thaw with irq_on/off
6/7: tf_load() cleanup
7/7: remove ap->last_ctl


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [PATCH 2/7] sata_promise: pdc_freeze() semantic change
@ 2007-07-07 19:08 Mikael Pettersson
  2007-07-10 16:06 ` Tejun Heo
  0 siblings, 1 reply; 18+ messages in thread
From: Mikael Pettersson @ 2007-07-07 19:08 UTC (permalink / raw)
  To: albertl, jeff; +Cc: alan, dwm, htejun, linux-ide, mikpe, mlord

On Sat, 07 Jul 2007 15:02:49 +0800, Albert Lee wrote:
> After checking the current implementations of freeze()/thaw(), it seems only pdc_freeze()
>does more than simple irq masking. Remove the DMA stop code from pdc_freeze().
>
>Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
>---
>
>diff -Nrup 01_remove_leftover_irqon/drivers/ata/sata_promise.c 02_sata_pdc_freeze/drivers/ata/sata_promise.c
>--- 01_remove_leftover_irqon/drivers/ata/sata_promise.c	2007-07-07 09:58:55.000000000 +0800
>+++ 02_sata_pdc_freeze/drivers/ata/sata_promise.c	2007-07-07 10:39:22.000000000 +0800
>@@ -578,7 +578,6 @@ static void pdc_freeze(struct ata_port *
> 
> 	tmp = readl(mmio + PDC_CTLSTAT);
> 	tmp |= PDC_IRQ_DISABLE;
>-	tmp &= ~PDC_DMA_ENABLE;
> 	writel(tmp, mmio + PDC_CTLSTAT);
> 	readl(mmio + PDC_CTLSTAT); /* flush */
> }

pdc_freeze() halts in-flight DMAs because that's what libata
specifices. E.g., Documentation/DocBook/libata.tmpl writes:

>void (*freeze) (struct ata_port *ap);
>void (*thaw) (struct ata_port *ap);
>	</programlisting>
>
>	<para>
>ata_port_freeze() is called when HSM violations or some other
>condition disrupts normal operation of the port.  A frozen port
>is not allowed to perform any operation until the port is
>thawed, which usually follows a successful reset.
>	</para>
>
>	<para>
>The optional ->freeze() callback can be used for freezing the port
>hardware-wise (e.g. mask interrupt and stop DMA engine).  If a
>port cannot be frozen hardware-wise, the interrupt handler
>must ack and clear interrupts unconditionally while the port
>is frozen.
>	</para>
>	<para>
>The optional ->thaw() callback is called to perform the opposite of ->freeze():
>prepare the port for normal operation once again.  Unmask interrupts,
>start DMA engine, etc.

Similar wording exists in libata-eh.c above __ata_port_freeze().

Albert's patch is OK as far as sata_promise is concerned, but
I want to see an update of libata.tmpl and libata-eh.c to
indicate the new, weakened, specification of freeze/thaw before
I ACK this patch.

/Mikael

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

end of thread, other threads:[~2007-10-02 15:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-07  6:57 [PATCH 0/7] libata: irq_on/off restructuring (take #2) Albert Lee
2007-07-07  7:00 ` [PATCH 1/7] libata: remove irq_on from ata_bus_reset() and ata_std_postreset() Albert Lee
2007-07-12 20:12   ` Jeff Garzik
2007-07-07  7:02 ` [PATCH 2/7] sata_promise: pdc_freeze() semantic change Albert Lee
2007-10-02 15:28   ` Jeff Garzik
2007-07-07  7:05 ` [PATCH 3/7] libata: add freeze/thaw to old EH LLDDs Albert Lee
2007-07-07  7:09 ` [PATCH 4/7] libata: use freeze/thaw for polling PIO Albert Lee
2007-07-13  6:53   ` Tejun Heo
2007-07-07  7:12 ` [PATCH 5/7] libata: integrate freeze/thaw with irq_on/off Albert Lee
2007-07-13  6:51   ` Tejun Heo
2007-07-16  9:17     ` Albert Lee
2007-07-07  7:20 ` [PATCH 6/7] libata: remove nIEN handling from ata_tf_load() Albert Lee
2007-07-07  7:23 ` [PATCH 7/7] libata: remove ap->last_ctl Albert Lee
2007-07-13  6:58   ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2007-07-07 19:08 [PATCH 2/7] sata_promise: pdc_freeze() semantic change Mikael Pettersson
2007-07-10 16:06 ` Tejun Heo
2007-07-13  9:07   ` Tejun Heo
2007-07-16  9:19     ` Albert Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).