* [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method
@ 2010-10-08 14:57 Sergei Shtylyov
2010-10-08 16:35 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2010-10-08 14:57 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
drivers/ata/pata_pdc202xx_old.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: linux-2.6/drivers/ata/pata_pdc202xx_old.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_pdc202xx_old.c
+++ linux-2.6/drivers/ata/pata_pdc202xx_old.c
@@ -44,6 +44,27 @@ static void pdc202xx_exec_command(struct
ndelay(400);
}
+static bool pdc202xx_irq_check(struct ata_port *ap)
+{
+ struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+ unsigned long master = pci_resource_start(pdev, 4);
+ u8 sc1d = inb(master + 0x1d);
+
+ if (ap->port_no) {
+ /*
+ * bit 7: error, bit 6: interrupting,
+ * bit 5: FIFO full, bit 4: FIFO empty
+ */
+ return sc1d & 0x40;
+ } else {
+ /*
+ * bit 3: error, bit 2: interrupting,
+ * bit 1: FIFO full, bit 0: FIFO empty
+ */
+ return sc1d & 0x04;
+ }
+}
+
/**
* pdc202xx_configure_piomode - set chip PIO timing
* @ap: ATA interface
@@ -282,6 +303,7 @@ static struct ata_port_operations pdc202
.set_dmamode = pdc202xx_set_dmamode,
.sff_exec_command = pdc202xx_exec_command,
+ .sff_irq_check = pdc202xx_irq_check,
};
static struct ata_port_operations pdc2026x_port_ops = {
@@ -297,6 +319,7 @@ static struct ata_port_operations pdc202
.port_start = pdc2026x_port_start,
.sff_exec_command = pdc202xx_exec_command,
+ .sff_irq_check = pdc202xx_irq_check,
};
static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method
2010-10-08 14:57 [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method Sergei Shtylyov
@ 2010-10-08 16:35 ` Alan Cox
2010-10-09 12:13 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2010-10-08 16:35 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: jgarzik, linux-ide
On Fri, 8 Oct 2010 18:57:45 +0400
Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> ---
> The patch is against the recent Linus' tree.
Same question. I know the old code did all this poking around but with
neither driver does it appear to be necessary ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method
2010-10-08 16:35 ` Alan Cox
@ 2010-10-09 12:13 ` Sergei Shtylyov
0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2010-10-09 12:13 UTC (permalink / raw)
To: Alan Cox; +Cc: jgarzik, linux-ide
Hello.
On 08-10-2010 20:35, Alan Cox wrote:
>> Signed-off-by: Sergei Shtylyov<sshtylyov@ru.mvista.com>
>> ---
>> The patch is against the recent Linus' tree.
> Same question.
Answered under the pata_cmd640 patch.
> I know the old code did all this poking around but with
> neither driver does it appear to be necessary ?
The current IDE driver does this in its test_irq() method (to check for
IDE IRQs), though it wasn't ever necessary for the older driver which did this
in the dma_test_irq() method (and ignored the result anyway).
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-09 12:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 14:57 [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method Sergei Shtylyov
2010-10-08 16:35 ` Alan Cox
2010-10-09 12:13 ` Sergei Shtylyov
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).