RE: [PATCH] bug in VIA PCI IRQ routing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marcelo,

  Attached comes appropriate patch for 2.4
  
  Signed-off-by: Aleksey Gorelov <[email protected]>

Previously posted patch for 2.6 had been verified by Karsten Keil
<[email protected]>.

According to the VIA 82C586B datasheet (still available from
http://gkernel.sourceforge.net/specs/via/586b.pdf.bz2) this chip needs
a special PIRQ mapping. Again, according to appropriate datasheets, 
82C596, 82C686 & 8231 should continue utilize old scheme.

>-----Original Message-----
>From: Karsten Keil [mailto:[email protected]] 
>Sent: Tuesday, May 24, 2005 12:29 AM
>To: Aleksey Gorelov
>Cc: Ondrej Zary; [email protected]; Andrew Morton; 
>[email protected]
>Subject: Re: [PATCH] bug in VIA PCI IRQ routing
>
>Hi,
>
>On Mon, May 23, 2005 at 12:53:41PM -0700, Aleksey Gorelov wrote:
>> 
>> Karsten, 
>> 
>>   could you please verify if attached patch works for you ?
>
>Works and seems to be OK, according to the specs. So this
>patch should go into the kernel, also into 2.4 I think.
>These chipset is still used on small special purpose systems.
>
>--- linux-2.6.11.10/arch/i386/pci/irq.c	2005-05-16 
>10:50:30.000000000 -0700
>+++ new/arch/i386/pci/irq.c	2005-05-23 12:47:19.000000000 -0700
>@@ -227,6 +227,24 @@
> }
> 
> /*
>+ * The VIA pirq rules are nibble-based, like ALI,
>+ * but without the ugly irq number munging.
>+ * However, for 82C586, nibble map is different .
>+ */
>+static int pirq_via586_get(struct pci_dev *router, struct 
>pci_dev *dev, int pirq)
>+{
>+	static unsigned int pirqmap[4] = { 3, 2, 5, 1 };
>+	return read_config_nybble(router, 0x55, pirqmap[pirq-1]);
>+}
>+
>+static int pirq_via586_set(struct pci_dev *router, struct 
>pci_dev *dev, int pirq, int irq)
>+{
>+	static unsigned int pirqmap[4] = { 3, 2, 5, 1 };
>+	write_config_nybble(router, 0x55, pirqmap[pirq-1], irq);
>+	return 1;
>+}
>+
>+/*
>  * ITE 8330G pirq rules are nibble-based
>  * FIXME: pirqmap may be { 1, 0, 3, 2 },
>  * 	  2+3 are both mapped to irq 9 on my system
>@@ -509,6 +527,10 @@
> 	switch(device)
> 	{
> 		case PCI_DEVICE_ID_VIA_82C586_0:
>+			r->name = "VIA";
>+			r->get = pirq_via586_get;
>+			r->set = pirq_via586_set;
>+			return 1;
> 		case PCI_DEVICE_ID_VIA_82C596:
> 		case PCI_DEVICE_ID_VIA_82C686:
> 		case PCI_DEVICE_ID_VIA_8231:
>
>-- 
>Karsten Keil
>SuSE Labs
>ISDN development
>

Attachment: via24.patch
Description: via24.patch


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux