From: Kristoffer E. <kri...@gm...> - 2007-11-19 19:44:40
|
On Mon, 19 Nov 2007 09:49:41 +0100 Dominik Brodowski <li...@do...> wrote: > Hi, > > On Mon, Nov 19, 2007 at 01:19:00AM -0800, Kristoffer Ericson wrote: > > > Actually, why do you bother? The PCMCIA subsystem is capable of working with > > > shared IRQs... > > > > > So I should have same interrupt for both? Isn't it important to know > > where the IRQ came from? Thats what puzzles me. > > Well, each IRQ handler needs to check whether it is indeed the one which was > called. So, inside hd6441_interrupt() you'd need to do the following > > cscr = inb(cscr_reg); > if !(cscr & HD64461_PCCCSCR_IRQ) > return IRQ_NONE; > > to avoid handling ("IRQ_HANDLED") an interrupt which wasn't caused by this > device. > Oki, sounds logical. But do I need to setup io_irq "IRQ's" or does PCMCIA code register one for me? From what I've read so far I believe I need to register the "slot IRQ" and handler, while pcmcia setups the pcmcia_card handler. Correct? > > > > int hd64461_init_socket(int sock, int irq, int io_irq, unsigned long mem_base,unsigned long io_offset) > > > > { > > > > sp->irq = irq; > > > ... > > > > sp->socket.pci_irq = io_irq; > > > ... > > > > if ((request_irq(irq, hd64461_interrupt, IRQF_DISABLED, "hd64461_ss-irq", sp)) < 0) { > > > > > > I think this should be io_irq here -- the "socket" IRQ which is demuxed to 79 > > > is io_irq; and the "card" one stays at 78. (Better use these terms than > > > "pcmcia" interrupt -- which is ambiguous). > > > > > Oki, so basicly IRQ 78 for socket IRQ? I'll changed the > > IRQF_DISABLED -> IRQF_SHARED then. > > Yes, you have two alternatives: either fix up the demux by requesting io_irq > here, or not bothering about demux and using IRQF_SHARED. Considering how much trouble the demux is giving me, I would much rather go for IRQF_SHARED. > > > It does, thx! Btw, do you have any good suggestion on which drivers to look > > at for good reference? > > Not really, but pd6729.c may be a good place to look at, for Komuro knows > really much about the PCMCIA subsystem. Oki, I'll take a look at that. > > Dominik |