Re: dmesg: PCI interrupts are no longer routed automatically.........

From: linux-os (linux-os_at_chaos.analogic.com)
Date: 01/05/05

  • Next message: Jack O'Quin: "Re: [PATCH] [request for inclusion] Realtime LSM"
    Date:	Wed, 5 Jan 2005 13:15:30 -0500 (EST)
    To: Bjorn Helgaas <bjorn.helgaas@hp.com>
    
    

    On Wed, 5 Jan 2005, Bjorn Helgaas wrote:

    > On Wed, 2005-01-05 at 07:06 -0500, linux-os wrote:
    >> The temporary work-around is....
    >> pci_enable_device(pdev);
    >> save_irq = pdev->irq;
    >> pci_disable_device(pdev); // Turn back off.
    >>
    >> init_bars(....);
    >> request_irq(save_irq,...) // Put ISR in place
    >>
    >> pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x08);
    >> pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
    >> pci_set_dma_mask(pdev, 0x00000000ffffffffULL);
    >> pci_set_drvdata(pdev, NULL);
    >> pci_set_power_state(pdev, 0);
    >> pci_set_master(pdev);
    >> pci_set_mwi(pdev);
    >> pci_write_config_dword(pdev, PCI_COMMAND, PCI_CONFIG);
    >>
    >> .... configure chip-specific stuff, clear interrupts, etc.
    >> pci_enable_device(dev);
    >
    > So prior to 2.6.10, you did something like this?
    >
    > request_irq(pdev->irq, ...);
    > pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x08);
    > pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
    > ...
    > pci_enable_device(pdev);
    >

    Yes, exactly.

    > What sort of interrupts does the device generate before it's
    > enabled? I can't find anything in the PCI spec that actually
    > prohibits interrupts before the driver starts up the device,
    > but it does seem strange.
    >

    The problem is that the PLX-9656BA INTCSR is not in configuration
    space, but runtime registers off a BAR. The interrupt source
    can be from a PLD that hasn't even had its microcode loaded
    yet!

    FYI, the PLX or similar clone is the bus interface chip for many
    busmastering PCI boards.

    > You wouldn't want your ISR mucking around with a half-initialized
    > device, so does it have to check a "device_configured" flag
    > or something?
    >

    Yes. If the device isn't configured, the ISR reads all the INTCSR
    bits, then writes 0 to the register to prevent anything else.

    If the PLX had been reset, then the INTCSR bits would all
    be masked off. However, reset is really only guaranteed from
    power OFF on some motherboards, in particuar the ones with
    so-called "hot-swap" capabilites fail. There is a software
    reset that, in fact, even reloads its serial EEPROM. However,
    the BAR needs to be accessible for this to be used.

    So it would be wonderful if the correct IRQ could be made
    available before the chip could generate an interrupt.

    Cheers,
    Dick Johnson
    Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
      Notice : All mail here is now cached for review by Dictator Bush.
                      98.36% of all statistics are fiction.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Jack O'Quin: "Re: [PATCH] [request for inclusion] Realtime LSM"

    Relevant Pages

    • Re: [PATCH] QStor SATA/RAID driver for 2.6.9-rc3
      ... > What you need to do is to gather as much information as will reset the ... doing everything possible directly from within the interrupt handler. ... It will continue to use schedule_work to handle hotplug events. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Fix for spurious interrupts on e100 resume
      ... > reset command to the registers also clears the interrupt mask. ... reset" means "after a hardware reset " and not by poking ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Bill Gates slow burns over control-alt-delete -- funny video
      ... only generates the standard "INT 1" interrupt. ... section of the boot sequence after the RAM and hardware detection tests ... than a minimum time, then the CPU is reset ... the system can't bypass the NMI ...
      (comp.os.linux.misc)
    • Re: R: hc12,can i return from interrupt and jump elsewhere?
      ... then you can use a watchdog reset. ... reception of an interrupt event, ... .I'm trying to implement an USB protocol using a 9s12 microcontroller,that i ... It is raccomended that anytime an USB device receives a bus reset it has to ...
      (comp.arch.embedded)
    • Re: Universal grammar
      ... Paul> This is a software engineers vocabulary. ... Paul> reset and other h/w interrupts. ... Paul> between how a CPU reacts to signals on various interrupt ... Paul> hardware device interrupts cause the CPU interrupt whatever ...
      (sci.lang)