public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Wrong IRQ for USB on Sony Vaio (dmi_scan.c, pci-irq.c)
@ 2002-04-19 14:02 Jan Slupski
  2002-04-19 14:40 ` Dave Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jan Slupski @ 2002-04-19 14:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: alan


Hi,

I'm writing once more about problem with IRQ assignment 
for Sony Vaio Laptops.

Broken BIOS of these notebooks assigns IRQ 10 for USB,
even though it is actually wired to IRQ 9.

I use PCG-FX240 model of Sony Vaio, but I have proofs of other users, 
that exactly the same problem exists on models:
FX200, FX220, FX250, FX270, FX290, FX370, FX503, R505JS, R505JL
These models use Intel's 82801BA controller, and Phoenix bios.

I wrote the patch that fix this. It is written on example of
patch for HP Pavillion (taken from 2.4.19-pre7-ac1).

This patch was tested on FX240. 
It is build for 2.4.18-pre7-ac1.

Only problem is I don't have DMI Product names for all involved models.
That's why I left pretty general:
  MATCH(DMI_PRODUCT_NAME, "PCG-")

I can help find exact Product Names for all models listed above, but
still new models of Vaio laptops are released with this bug.
I think checking of PCI Vendor & Device number should be enough proof
of broken bios.

If you think it should be tested on all models listed above, I can ask
their owners to do this. (They are now using my previous, even more ugly hack)

Some more description, and logs can be found on my Sony Vaio site:
http://www.pm.waw.pl/~jslupski/vaio/
I can provide any additional data, if needed.

Jan


Patch is:


diff -ru linux/arch/i386/kernel/dmi_scan.c linux-2.4.19-pre7-ac1.2/arch/i386/kernel/dmi_scan.c
--- linux/arch/i386/kernel/dmi_scan.c	Fri Apr 19 15:15:19 2002
+++ linux-2.4.19-pre7-ac1.2/arch/i386/kernel/dmi_scan.c	Fri Apr 19 15:50:48 2002
@@ -392,6 +392,27 @@
 }
 
 /*
+ * Work around broken Sony Vaio which assign USB to
+ * IRQ 10 even though it is actually wired to IRQ 9
+ * Models involved (at least): FX200, FX220, FX240, 
+ * FX250, FX270, FX290, FX370, FX503, R505JS, R505JL
+ * Send comments to: Jan Slupski, jslupski@email.com
+ */
+static __init int fix_broken_sony_vaio_bios_irq10(struct dmi_blacklist *d)
+{
+#ifdef CONFIG_PCI
+	extern int broken_sony_vaio_bios_irq10;
+	if (broken_sony_vaio_bios_irq10 == 0)
+	{
+		broken_sony_vaio_bios_irq10 = 1;
+		printk(KERN_INFO "%s detected - fixing broken IRQ routing (if broken!)\n", d->ident);
+	}
+#endif
+	return 0;
+}
+
+
+/*
  * This bios swaps the APM minute reporting bytes over (Many sony laptops
  * have this problem).
  */
@@ -760,6 +781,12 @@
 			MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"),
 			MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736")
 			} },
+
+ 	{ fix_broken_sony_vaio_bios_irq10, "Sony Vaio Laptop", {
+			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			NO_MATCH, NO_MATCH,
+			} },
  
 
 	/*
diff -ru linux/arch/i386/kernel/pci-irq.c linux-2.4.19-pre7-ac1.2/arch/i386/kernel/pci-irq.c
--- linux/arch/i386/kernel/pci-irq.c	Fri Apr 19 15:15:19 2002
+++ linux-2.4.19-pre7-ac1.2/arch/i386/kernel/pci-irq.c	Fri Apr 19 15:50:55 2002
@@ -24,6 +24,8 @@
 
 int broken_hp_bios_irq9;
 
+int broken_sony_vaio_bios_irq10;
+
 static struct irq_routing_table *pirq_table;
 
 /*
@@ -601,6 +603,18 @@
 		r->set(pirq_router_dev, dev, pirq, 11);
 	}
 
+	/* Work around broken Sony Vaio Notebooks which assign USB to
+	 * IRQ 10 even though it is actually wired to IRQ 9 
+	 * Send comments to: Jan Slupski, jslupski@email.com
+	 */
+
+	if (broken_sony_vaio_bios_irq10 && pirq == 0x63 && dev->irq == 9 &&
+			dev->vendor == 0x8086 && dev->device == 0x2442){
+		dev->irq = 9;
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 9);
+		r->set(pirq_router_dev, dev, pirq, 9);
+	}
+
 	/*
 	 * Find the best IRQ to assign: use the one
 	 * reported by the device if possible.





   _  _  _  _  _____________________________________________
   | |_| |\ |  S L U P S K I              jslupski@email.com
 |_| | | | \|            http://www.pm.waw.pl/~jslupski/vaio


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <mailman.1019225640.7470.linux-kernel2news@redhat.com>]

end of thread, other threads:[~2002-04-20  0:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-19 14:02 [PATCH] Wrong IRQ for USB on Sony Vaio (dmi_scan.c, pci-irq.c) Jan Slupski
2002-04-19 14:40 ` Dave Jones
2002-04-19 14:43   ` Jan Slupski
2002-04-19 14:56     ` Dave Jones
2002-04-19 15:10       ` Dumitru Ciobarcianu
2002-04-19 16:01         ` Alan Cox
2002-04-19 17:05 ` Daniel Jacobowitz
2002-04-20  0:45 ` Bryan Rittmeyer
     [not found] <mailman.1019225640.7470.linux-kernel2news@redhat.com>
2002-04-19 15:56 ` Pete Zaitcev
2002-04-19 16:14   ` Jan Slupski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox