From: Andrew Morton <akpm@zip.com.au>
To: Jan Marek <jmarek@jcu.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problem in yenta.c, 2nd edition
Date: Fri, 02 Nov 2001 01:26:12 -0800 [thread overview]
Message-ID: <3BE266B4.85E3162@zip.com.au> (raw)
In-Reply-To: <20011102093935.H20754@hazard.jcu.cz>
Jan Marek wrote:
>
> Hallo l-k,
>
> the first: I'm very sorry for old post about PCMCIA: function
> yenta_config_init() is called the first time from yenta_open()
> and not from yenta_init(), as I think... It was my error...
>
> I explored yenta.c through printk() function and I found the last
> point, where kernel freeze: This point is here:
>
Presumably the controller is permanently requesting an
interrupt. So as soon as you enable the IRQ, you lock
up, taking infinite interrupts.
It's always seemed a bit fishy how we enable the IRQ before
initialising the socket controller.
Try moving the block of code which requests the IRQ down
so that it comes after the call to cardbus_register().
> --- function yenta_open_bh() from drivers/pcmcia/yenta.c
> /*
> * 'Bottom half' for the yenta_open routine. Allocate the interrupt line
> * and register the socket with the upper layers.
> */
> static void yenta_open_bh(void * data)
> {
> pci_socket_t * socket = (pci_socket_t *) data;
>
> /* It's OK to overwrite this now */
> socket->tq_task.routine = yenta_bh;
> printk("yenta_open_bh: socket->tq_task.routine\n");
>
>From here
> if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, (SA_SHIRQ | SA_INTERRUPT), socket->dev->name, socket)) {
> /* No IRQ or request_irq failed. Poll */
> printk("yenta_open_bh: in the if block\n");
> socket->cb_irq = 0; /* But zero is a valid IRQ number. */
> socket->poll_timer.function = yenta_interrupt_wrapper;
> socket->poll_timer.data = (unsigned long)socket;
> socket->poll_timer.expires = jiffies + HZ;
> printk("yenta_open_bh: before add_timer\n");
> add_timer(&socket->poll_timer);
> printk("yenta_open_bh: add_timer\n");
> }
to here
> printk("yenta_open_bh: after if(!socket->cb_irq...\n");
> /* Figure out what the dang thing can do for the PCMCIA layer... */
> yenta_get_socket_capabilities(socket, isa_interrupts);
> printk("yenta_open_bh: after yenta_get_socket_capabilities\n");
> printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
>
> /* Register it with the pcmcia layer.. */
> cardbus_register(socket);
> printk("yenta_open_bh: cardbus_register()\n");
move it down to here.
> MOD_DEC_USE_COUNT;
> }
-
prev parent reply other threads:[~2001-11-02 9:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-02 8:39 Problem in yenta.c, 2nd edition Jan Marek
2001-11-02 9:26 ` Andrew Morton [this message]
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=3BE266B4.85E3162@zip.com.au \
--to=akpm@zip.com.au \
--cc=jmarek@jcu.cz \
--cc=linux-kernel@vger.kernel.org \
/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