All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hounschell <markh@compro.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@osdl.org>,
	mingo@elte.hu, linux-kernel@vger.kernel.org, dwalker@mvista.com,
	tglx@linutronix.de
Subject: Re: 3c59x vortex_timer rt hack
Date: Fri, 12 May 2006 12:53:31 -0400	[thread overview]
Message-ID: <4464BD8B.8060503@compro.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0605121100080.3328@gandalf.stny.rr.com>

Steven Rostedt wrote:
> On Fri, 12 May 2006, Andrew Morton wrote:
> 
>> Steven Rostedt <rostedt@goodmis.org> wrote:
>>>  Use this patch instead.  It needs an irq disable.  But, believe it or not,
>>>  on SMP this is actually better.  If the irq is shared (as it is in Mark's
>>>  case), we don't stop the irq of other devices from being handled on
>>>  another CPU (unfortunately for Mark, he pinned all interrupts to one CPU).
>>>
>>>  Andrew,
>>>
>>>  should this be changed in mainline too?
>> I suppose so - we're taking the lock with spin_lock_bh(), but it can also
>> be taken by this CPU from the interrupt, so it'll deadlock.  But lo!  We've
>> done disable_irq(), so the interrupt won't be happening.
>>
>> So yes, doing spin_lock_irq() (irqrestore isn't needed in a timer handler)
>> instead of disable_irq() in vortex_timer() looks OK.
> 
> Ah, you're right, it's an over kill.
> 
> Ingo, here's the patch without irqsave
> 
> -- Steve
> 
> Index: linux-2.6.16-rt20/drivers/net/3c59x.c
> ===================================================================
> --- linux-2.6.16-rt20.orig/drivers/net/3c59x.c	2006-05-12 10:27:36.000000000 -0400
> +++ linux-2.6.16-rt20/drivers/net/3c59x.c	2006-05-12 11:03:39.000000000 -0400
> @@ -1897,7 +1897,7 @@ vortex_timer(unsigned long data)
> 
>  	if (vp->medialock)
>  		goto leave_media_alone;
> -	disable_irq(dev->irq);
> +	spin_lock_irq(&vp->lock);
>  	old_window = ioread16(ioaddr + EL3_CMD) >> 13;
>  	EL3WINDOW(4);
>  	media_status = ioread16(ioaddr + Wn4_Media);
> @@ -1919,7 +1919,6 @@ vortex_timer(unsigned long data)
>  		break;
>  	case XCVR_MII: case XCVR_NWAY:
>  		{
> -			spin_lock_bh(&vp->lock);
>  			mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
>  			if (!(mii_status & BMSR_LSTATUS)) {
>  				/* Re-read to get actual link status */
> @@ -1957,7 +1956,6 @@ vortex_timer(unsigned long data)
>  			} else {
>  				netif_carrier_off(dev);
>  			}
> -			spin_unlock_bh(&vp->lock);
>  		}
>  		break;
>  	  default:					/* Other media types handled by Tx timeouts. */
> @@ -2000,7 +1998,7 @@ vortex_timer(unsigned long data)
>  		/* AKPM: FIXME: Should reset Rx & Tx here.  P60 of 3c90xc.pdf */
>  	}
>  	EL3WINDOW(old_window);
> -	enable_irq(dev->irq);
> +	spin_unlock_irq(&vp->lock);
> 
>  leave_media_alone:
>  	if (vortex_debug > 2)
> 

I have tried this one and it seems OK. No BUGs or disconnections for
over an hour now and I'm beating it good.

Mark

  reply	other threads:[~2006-05-12 16:53 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09 12:23 rt20 patch question Mark Hounschell
2006-05-09 14:38 ` Daniel Walker
2006-05-09 14:58   ` Mark Hounschell
2006-05-09 15:53     ` Daniel Walker
2006-05-10 12:39     ` Steven Rostedt
2006-05-10 13:06       ` Mark Hounschell
2006-05-10 14:10         ` Steven Rostedt
2006-05-10 15:33           ` Mark Hounschell
2006-05-10 16:17             ` Steven Rostedt
2006-05-10 18:30               ` Mark Hounschell
2006-05-10 18:49                 ` Steven Rostedt
2006-05-10 19:28                   ` Mark Hounschell
2006-05-11 11:25                     ` Mark Hounschell
2006-05-11 12:01                       ` Steven Rostedt
2006-05-11 12:22                         ` Steven Rostedt
2006-05-11 13:02                           ` Mark Hounschell
2006-05-11 13:14                             ` Steven Rostedt
2006-05-11 13:26                               ` Mark Hounschell
2006-05-11 13:53                                 ` Steven Rostedt
2006-05-11 14:57                                   ` Mark Hounschell
2006-05-12  6:47                                     ` Steven Rostedt
2006-05-12  7:33                                       ` Sébastien Dugué
2006-05-12  8:18                                         ` Mark Hounschell
2006-05-12  9:08                                       ` Mark Hounschell
2006-05-12  9:20                                         ` Steven Rostedt
2006-05-10 20:33                 ` Steven Rostedt
2006-05-12  8:16                   ` Ingo Molnar
2006-05-12  8:45                     ` Steven Rostedt
2006-05-12  9:16                       ` Ingo Molnar
2006-05-12  9:21                       ` Ingo Molnar
2006-05-12 12:38                         ` Mark Hounschell
2006-05-12 13:18                           ` Steven Rostedt
2006-05-12 13:38                             ` Mark Hounschell
2006-05-12 13:43                             ` Mark Hounschell
2006-05-12 14:05                               ` Steven Rostedt
2006-05-12 14:36                                 ` Mark Hounschell
2006-05-12 14:51                                   ` Steven Rostedt
2006-05-12 13:16                         ` 3c59x vortex_timer rt hack (was: rt20 patch question) Steven Rostedt
2006-05-12 13:36                           ` Ingo Molnar
2006-05-12 13:46                             ` Steven Rostedt
2006-05-12 14:16                           ` Andrew Morton
2006-05-12 14:32                             ` Steven Rostedt
2006-05-12 14:39                               ` Steven Rostedt
2006-05-12 14:43                                 ` Ingo Molnar
2006-05-12 14:49                                 ` Andrew Morton
2006-05-12 15:04                                   ` Steven Rostedt
2006-05-12 16:53                                     ` Mark Hounschell [this message]
2006-05-12 15:22                                   ` Steven Rostedt
2006-05-12 15:23                                     ` Andrew Morton
2006-05-12 15:36                                       ` Steven Rostedt
2006-05-12 16:03                                         ` Andrew Morton
2006-05-12 16:11                                           ` Steven Rostedt
2006-05-12 16:27                                             ` Andrew Morton
2006-05-12 16:38                                               ` Steven Rostedt
2006-05-10 18:45             ` rt20 patch question Steven Rostedt

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=4464BD8B.8060503@compro.net \
    --to=markh@compro.net \
    --cc=akpm@osdl.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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.