linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] pata_cmd640: implement sff_irq_check() method
@ 2010-10-08 14:56 Sergei Shtylyov
  2010-10-08 16:34 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2010-10-08 14:56 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_cmd640.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: linux-2.6/drivers/ata/pata_cmd640.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_cmd640.c
+++ linux-2.6/drivers/ata/pata_cmd640.c
@@ -161,6 +161,17 @@ static int cmd640_port_start(struct ata_
 	return 0;
 }
 
+static bool cmd640_sff_irq_check(struct ata_port *ap)
+{
+	struct pci_dev *pdev	= to_pci_dev(ap->host->dev);
+	int irq_reg		= ap->port_no ? ARTIM23 : CFR;
+	u8  irq_stat, irq_mask	= ap->port_no ? 0x10 : 0x04;
+
+	pci_read_config_byte(pdev, irq_reg, &irq_stat);
+
+	return irq_stat & irq_mask;
+}
+
 static struct scsi_host_template cmd640_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
@@ -169,6 +180,7 @@ static struct ata_port_operations cmd640
 	.inherits	= &ata_sff_port_ops,
 	/* In theory xfer_noirq is not needed once we kill the prefetcher */
 	.sff_data_xfer	= ata_sff_data_xfer_noirq,
+	.sff_irq_check	= cmd640_sff_irq_check,
 	.qc_issue	= cmd640_qc_issue,
 	.cable_detect	= ata_cable_40wire,
 	.set_piomode	= cmd640_set_piomode,

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

* Re: [PATCH 1/4] pata_cmd640: implement sff_irq_check() method
  2010-10-08 14:56 [PATCH 1/4] pata_cmd640: implement sff_irq_check() method Sergei Shtylyov
@ 2010-10-08 16:34 ` Alan Cox
  2010-10-09 12:10   ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2010-10-08 16:34 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: jgarzik, linux-ide

On Fri, 8 Oct 2010 18:56:39 +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.

Why is this needed and what setups did you test ?


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

* Re: [PATCH 1/4] pata_cmd640: implement sff_irq_check() method
  2010-10-08 16:34 ` Alan Cox
@ 2010-10-09 12:10   ` Sergei Shtylyov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2010-10-09 12:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: jgarzik, linux-ide

Hello.

On 08-10-2010 20:34, Alan Cox wrote:

>> Signed-off-by: Sergei Shtylyov<sshtylyov@ru.mvista.com>

>> ---
>> The patch is against the recent Linus' tree.

> Why is this needed

    See 
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27943620cbd960f710a385ff4a538e14ed3f1922 
for why this method was introduced.

> and what setups did you test ?

    None. And given the usage of the method (it's called only for unexpected 
interrupts now), it would be quite hard to test.

MBR, Sergei

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

end of thread, other threads:[~2010-10-09 12:12 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:56 [PATCH 1/4] pata_cmd640: implement sff_irq_check() method Sergei Shtylyov
2010-10-08 16:34 ` Alan Cox
2010-10-09 12:10   ` 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).