All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Collins <bcollins@debian.org>
To: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: Linus Torvalds <torvalds@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] late spinlock initialization in ieee1394/ohci
Date: Fri, 26 Aug 2005 13:37:52 -0700	[thread overview]
Message-ID: <20050826203752.GF18327@swissdisk.com> (raw)
In-Reply-To: <20050825221314.GY9322@parcelfarce.linux.theplanet.co.uk>

Thanks Al. I'll commit this to our tree. Linus, feel free to apply this to
your tree.

Signed-off-by: Ben Collins <bcollins@debian.org>

On Thu, Aug 25, 2005 at 11:13:14PM +0100, Al Viro wrote:
> spinlock used in irq handler should be initialized before registering
> irq, even if we know that our device has interrupts disabled; handler
> is registered shared and taking spinlock is done unconditionally.  As
> it is, we can and do get oopsen on boot for some configuration, depending
> on irq routing - I've got a reproducer.
> 
> Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
> ----
> diff -urN RC13-rc7-base/drivers/ieee1394/ohci1394.c current/drivers/ieee1394/ohci1394.c
> --- RC13-rc7-base/drivers/ieee1394/ohci1394.c	2005-08-24 01:56:37.000000000 -0400
> +++ current/drivers/ieee1394/ohci1394.c	2005-08-25 18:02:49.000000000 -0400
> @@ -478,7 +478,6 @@
>  	int num_ports, i;
>  
>  	spin_lock_init(&ohci->phy_reg_lock);
> -	spin_lock_init(&ohci->event_lock);
>  
>  	/* Put some defaults to these undefined bus options */
>  	buf = reg_read(ohci, OHCI1394_BusOptions);
> @@ -3402,7 +3401,14 @@
>  	/* We hopefully don't have to pre-allocate IT DMA like we did
>  	 * for IR DMA above. Allocate it on-demand and mark inactive. */
>  	ohci->it_legacy_context.ohci = NULL;
> +	spin_lock_init(&ohci->event_lock);
>  
> +	/*
> +	 * interrupts are disabled, all right, but... due to SA_SHIRQ we
> +	 * might get called anyway.  We'll see no event, of course, but
> +	 * we need to get to that "no event", so enough should be initialized
> +	 * by that point.
> +	 */
>  	if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ,
>  			 OHCI1394_DRIVER_NAME, ohci))
>  		FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);

-- 
Ubuntu     - http://www.ubuntu.com/
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
SwissDisk  - http://www.swissdisk.com/

      reply	other threads:[~2005-08-26 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-25 22:13 [PATCH] late spinlock initialization in ieee1394/ohci Al Viro
2005-08-26 20:37 ` Ben Collins [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=20050826203752.GF18327@swissdisk.com \
    --to=bcollins@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.