* sata_promise.c:pdc_irq_clear() buglet?
@ 2008-05-11 21:21 Mikael Pettersson
2008-05-11 21:31 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2008-05-11 21:21 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide
Jeff,
In the 2.6.8 kernel you added sata_promise.c:pdc_irq_clear()
which looks as follows:
>static void pdc_irq_clear(struct ata_port *ap)
>{
> struct ata_host *host = ap->host;
> void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
>
> readl(mmio + PDC_INT_SEQMASK);
>}
I have two issues with this code:
1. It reads from the SEQMASK register, which is global for
all ports. Hence, calling pdc_irq_clear() on one port
potentially affects all ports.
2. Promise's drivers (both 1st and 2nd generation chip drivers)
instead read the port's ATA Command/Status register when
they want to clear any pending IRQs.
Did you write the code this way on purpose, or did you just
accidentally use the wrong mechanism?
If you have no objections, I intend to change this to read
Command/Status instead.
/Mikael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sata_promise.c:pdc_irq_clear() buglet?
2008-05-11 21:21 sata_promise.c:pdc_irq_clear() buglet? Mikael Pettersson
@ 2008-05-11 21:31 ` Jeff Garzik
2008-05-11 23:24 ` Mikael Pettersson
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2008-05-11 21:31 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: linux-ide
Mikael Pettersson wrote:
> Jeff,
>
> In the 2.6.8 kernel you added sata_promise.c:pdc_irq_clear()
> which looks as follows:
>
>> static void pdc_irq_clear(struct ata_port *ap)
>> {
>> struct ata_host *host = ap->host;
>> void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
>>
>> readl(mmio + PDC_INT_SEQMASK);
>> }
>
> I have two issues with this code:
> 1. It reads from the SEQMASK register, which is global for
> all ports. Hence, calling pdc_irq_clear() on one port
> potentially affects all ports.
> 2. Promise's drivers (both 1st and 2nd generation chip drivers)
> instead read the port's ATA Command/Status register when
> they want to clear any pending IRQs.
>
> Did you write the code this way on purpose, or did you just
> accidentally use the wrong mechanism?
>
> If you have no objections, I intend to change this to read
> Command/Status instead.
For sata_promise, at the time it was written, irq_clear was largely a
sledgehammer for SFF situations that didn't automatically resolve
themselves through normal operation. Given the amount of SFF code that
is _not_ enabled when using sata_promise is in use, ->irq_clear() is
largely a relic for PIO data xfer situations.
Feel free to replace if you think is appropriate...
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sata_promise.c:pdc_irq_clear() buglet?
2008-05-11 21:31 ` Jeff Garzik
@ 2008-05-11 23:24 ` Mikael Pettersson
0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2008-05-11 23:24 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Mikael Pettersson, linux-ide
Jeff Garzik writes:
> Mikael Pettersson wrote:
> > Jeff,
> >
> > In the 2.6.8 kernel you added sata_promise.c:pdc_irq_clear()
> > which looks as follows:
> >
> >> static void pdc_irq_clear(struct ata_port *ap)
> >> {
> >> struct ata_host *host = ap->host;
> >> void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
> >>
> >> readl(mmio + PDC_INT_SEQMASK);
> >> }
> >
> > I have two issues with this code:
> > 1. It reads from the SEQMASK register, which is global for
> > all ports. Hence, calling pdc_irq_clear() on one port
> > potentially affects all ports.
> > 2. Promise's drivers (both 1st and 2nd generation chip drivers)
> > instead read the port's ATA Command/Status register when
> > they want to clear any pending IRQs.
> >
> > Did you write the code this way on purpose, or did you just
> > accidentally use the wrong mechanism?
> >
> > If you have no objections, I intend to change this to read
> > Command/Status instead.
>
> For sata_promise, at the time it was written, irq_clear was largely a
> sledgehammer for SFF situations that didn't automatically resolve
> themselves through normal operation. Given the amount of SFF code that
> is _not_ enabled when using sata_promise is in use, ->irq_clear() is
> largely a relic for PIO data xfer situations.
>
> Feel free to replace if you think is appropriate...
Thanks, will do after I've tested it.
/Mikael
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-11 23:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-11 21:21 sata_promise.c:pdc_irq_clear() buglet? Mikael Pettersson
2008-05-11 21:31 ` Jeff Garzik
2008-05-11 23:24 ` Mikael Pettersson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.