[PATCH] Tweak re-routing of PCI interrupts

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 06/06/03

  • Next message: Gordon Tetlow: "Re: geom_vol_ffs problems"
    Date: Fri, 06 Jun 2003 14:13:31 -0400 (EDT)
    To: current@FreeBSD.org, imp@FreeBSD.org
    
    

    I have a small tweak to the PCI code that re-routes PCI interrupts.
    Basically, it does two things, 1) make the comment less ia64-specific
    and 2) if the interrupt route returns an invalid IRQ (i.e. 255), then
    we don't change the intline. In other words, if we can't route the
    interrupt, we just assume that the firmware knows more than we do and
    go with the value it stuck in the register. 1) is a no-brainer, but
    I wonder what people think about 2). Patch below:

    Index: pci.c
    ===================================================================
    RCS file: /usr/cvs/src/sys/dev/pci/pci.c,v
    retrieving revision 1.216
    diff -u -r1.216 pci.c
    --- pci.c 4 Jun 2003 21:10:15 -0000 1.216
    +++ pci.c 6 Jun 2003 18:10:14 -0000
    @@ -782,7 +782,7 @@
            pcicfgregs *cfg = &dinfo->cfg;
            struct resource_list *rl = &dinfo->resources;
            struct pci_quirk *q;
    - int b, i, f, s;
    + int b, i, irq, f, s;
     
            b = cfg->bus;
            s = cfg->slot;
    @@ -800,14 +800,18 @@
            if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
     #if defined(__ia64__) || (defined(__i386__) && !defined(SMP))
                    /*
    - * Re-route interrupts on ia64 so that we can get the
    - * I/O SAPIC interrupt numbers (the BIOS leaves legacy
    - * PIC interrupt numbers in the intline registers).
    + * Try to re-route interrupts. Sometimes the BIOS or
    + * firmware may leave bogus values in these registers.
    + * If the re-route fails, then just stick with what we
    + * have.
                     */
    - cfg->intline = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin);
    + irq = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin);
    + if (PCI_INTERRUPT_VALID(irq))
    + cfg->intline = irq;
    + else
     #endif
    - resource_list_add(rl, SYS_RES_IRQ, 0, cfg->intline,
    - cfg->intline, 1);
    + irq = cfg->intline;
    + resource_list_add(rl, SYS_RES_IRQ, 0, irq, irq, 1);
            }
     }
     

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Gordon Tetlow: "Re: geom_vol_ffs problems"

    Relevant Pages

    • Re: [PATCH] Tweak re-routing of PCI interrupts
      ... :>: I have a small tweak to the PCI code that re-routes PCI interrupts. ... if we can't route the ... :> The part I don't like is that if we can't route an interrupt, ... Pre PCIBIOS machines you are SOL. ...
      (freebsd-current)
    • RE: [PATCH 2.4.31 1/1] scsi/megaraid2: add 64-bit application sup ?port
      ... +static inline int ... * Interrupt ackrowledgement sequence for IO mapped HBAs ... -static inline void ...
      (Linux-Kernel)
    • Re: [PATCH 06/12] xen pci platform device driver
      ... for initializing the grant table and xenbus in PV on HVM mode. ... interrupt or using the callback ... Both the callback handler and the Xen platform PCI interrupt handler ... static int gnttab_free_count; ...
      (Linux-Kernel)
    • [PATCH 1/1] mxser, remove it
      ... -static int calloutmajor = MXSERCUMAJOR; ... * This routine is called whenever a serial port is opened. ... * enables interrupts for a serial port, linking in its async structure into ... * async structure from the interrupt chain if necessary, ...
      (Linux-Kernel)
    • [PATCH] pass irq handling status down to low-level code
      ... In order for low-level code to know whether/how a hardware interrupt ... -fastcall unsigned int do_IRQ(struct pt_regs *regs) ... This branches to the correct hardware IRQ handler via ... -asmlinkage unsigned int do_IRQ ...
      (Linux-Kernel)