public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Aleksey Gorelov <Aleksey_Gorelov@Phoenix.com>
Cc: linux-kernel@vger.kernel.org, mj@ucw.cz, alan@redhat.com
Subject: [PATCH] Re: VIA PCI IRQ router bug fix
Date: Thu, 03 Jul 2003 19:52:10 -0400	[thread overview]
Message-ID: <3F04C1AA.80107@pobox.com> (raw)
In-Reply-To: <5F106036E3D97448B673ED7AA8B2B6B36C352C@scl-exch2k.phoenix.com>

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

Aleksey Gorelov wrote:
> Hi.
> 
>   I found & fixed a problem with #PIRQD line setup for VIA PCI IRQ
> router. Kernel was not able to receive any interrupts from network card,
> which PCI slot IRQ pin A was routed to PIRQ line D of VIA PCI IRQ
> router. According to VIA specs, PIRQ D routing is out of standard
> 'nibble' scheme.
>   I tested patch with 2.4.20 kernel, it can be applied to 2.4.22-pre2 as
> well.
>   Thanks to my employer (Phoenix Technologies) who kindly allowed me to
> make this patch public.

Thanks much!  Please continue to encourage your employer to contribute 
to open source.  Posting patches like this means that all Linux via 
users have a more stable system to use.


> --- linux-2.4.20/arch/i386/kernel/pci-irq_old.c	2002-11-28 15:53:09.000000000 -0800
> +++ linux-2.4.20/arch/i386/kernel/pci-irq.c	2003-05-21 17:27:40.000000000 -0700
> @@ -198,12 +198,27 @@
>   */
>  static int pirq_via_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
>  {
> -	return read_config_nybble(router, 0x55, pirq);
> +    u8 x;
> +
> +    if ( pirq == 4 ) {
> +        pci_read_config_byte(router, 0x57, &x);
> +        return (x >> 4);
> +    } else {
> +        return read_config_nybble(router, 0x55, pirq);
> +    }
>  }

If you don't mind, I would prefer the attached patch, which is a little 
bit less verbose.

I will make sure this fix is merged into 2.4 and 2.5, if noone beats me 
to it.

	Jeff



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 767 bytes --]

===== arch/i386/pci/irq.c 1.25 vs edited =====
--- 1.25/arch/i386/pci/irq.c	Thu Jun 19 17:58:11 2003
+++ edited/arch/i386/pci/irq.c	Thu Jul  3 19:49:14 2003
@@ -196,15 +196,16 @@
 /*
  * The VIA pirq rules are nibble-based, like ALI,
  * but without the ugly irq number munging.
+ * However, PIRQD is in the upper instead of lower 4 bits.
  */
 static int pirq_via_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
 {
-	return read_config_nybble(router, 0x55, pirq);
+	return read_config_nybble(router, 0x55, pirq == 4 ? 5 : pirq);
 }
 
 static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
 {
-	write_config_nybble(router, 0x55, pirq, irq);
+	write_config_nybble(router, 0x55, pirq == 4 ? 5 : pirq, irq);
 	return 1;
 }
 

  reply	other threads:[~2003-07-03 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-03 19:19 VIA PCI IRQ router bug fix Aleksey Gorelov
2003-07-03 23:52 ` Jeff Garzik [this message]
2003-07-04  7:31   ` [PATCH] " Arjan van de Ven
2003-07-04 13:44     ` Jeff Garzik
2003-07-04 15:12     ` Davide Libenzi
  -- strict thread matches above, loose matches on Subject: below --
2003-07-04  0:13 Aleksey Gorelov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F04C1AA.80107@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=Aleksey_Gorelov@Phoenix.com \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox