linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cmd640: fix kernel oops in test_irq() method
@ 2010-05-08 18:07 Sergei Shtylyov
  2010-05-11  7:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2010-05-08 18:07 UTC (permalink / raw)
  To: davem; +Cc: linux-ide

When implementing the test_iqr() method, I forgot that this driver is not an
ordinary PCI driver and also needs to support VLB variant of the chip. Moreover,
'hwif->dev' should be NULL, potentially causing oops in pci_read_config_byte().

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

---
The patch is atop of ide-2.6.git tree...

 drivers/ide/cmd640.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: ide-2.6/drivers/ide/cmd640.c
===================================================================
--- ide-2.6.orig/drivers/ide/cmd640.c
+++ ide-2.6/drivers/ide/cmd640.c
@@ -633,12 +633,10 @@ static void __init cmd640_init_dev(ide_d
 
 static int cmd640_test_irq(ide_hwif_t *hwif)
 {
-	struct pci_dev *dev	= to_pci_dev(hwif->dev);
 	int irq_reg		= hwif->channel ? ARTTIM23 : CFR;
-	u8  irq_stat, irq_mask	= hwif->channel ? ARTTIM23_IDE23INTR :
+	u8  irq_mask		= hwif->channel ? ARTTIM23_IDE23INTR :
 						  CFR_IDE01INTR;
-
-	pci_read_config_byte(dev, irq_reg, &irq_stat);
+	u8  irq_stat		= get_cmd640_reg(irq_reg);
 
 	return (irq_stat & irq_mask) ? 1 : 0;
 }

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

* Re: [PATCH] cmd640: fix kernel oops in test_irq() method
  2010-05-08 18:07 [PATCH] cmd640: fix kernel oops in test_irq() method Sergei Shtylyov
@ 2010-05-11  7:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-05-11  7:09 UTC (permalink / raw)
  To: sshtylyov; +Cc: linux-ide

From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Sat, 8 May 2010 22:07:14 +0400

> When implementing the test_iqr() method, I forgot that this driver is not an
> ordinary PCI driver and also needs to support VLB variant of the chip. Moreover,
> 'hwif->dev' should be NULL, potentially causing oops in pci_read_config_byte().
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Applied, thanks a lot Sergei.

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

end of thread, other threads:[~2010-05-11  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-08 18:07 [PATCH] cmd640: fix kernel oops in test_irq() method Sergei Shtylyov
2010-05-11  7:09 ` David Miller

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