The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sven-Thorsten Dietrich <sdietrich@mvista.com>
Cc: Luca Falavigna <dktrkranz@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	mingo@elte.hu
Subject: Re: [PATCH] Real-Time Preemption V0.7.52-07: rt_init_MUTEX_LOCKED declaration
Date: Mon, 01 Aug 2005 15:26:45 -0400	[thread overview]
Message-ID: <1122924405.6759.37.camel@localhost.localdomain> (raw)
In-Reply-To: <1122923621.3024.55.camel@imap.mvista.com>

On Mon, 2005-08-01 at 12:13 -0700, Sven-Thorsten Dietrich wrote:
> On Mon, 2005-08-01 at 19:05 +0000, Luca Falavigna wrote:
> >
> > 
> > Another solution could be this (as shown in drivers/cpufreq/cpufreq.c):
> > -	init_MUTEX_LOCKED(&policy->lock);
> > +	init_MUTEX(&policy->lock);
> > +	down(&policy->lock);
> > -
> 
> If the semaphore is being used as a mutex, 
> then it could be converted to an RT-mutex.
> 
> That would nicely side-step the problem.
> 
> Note this won't work if you are counting with the sema.

Well it's not really a counter.  It's one of these situations where the
semaphore is locked on init, later someone else ups it on a trigger, and
then the most horrible, it gets down again on module exit! I'm not
really sure what it is doing. The only place that an up is called is on
the watchdog trigger.  I guess it's being used to not let you unload the
module if the watchdog hasn't gone off yet, or something to that effect.

-- Steve



  reply	other threads:[~2005-08-01 19:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-01 16:26 [PATCH] Real-Time Preemption V0.7.52-07: rt_init_MUTEX_LOCKED declaration Luca Falavigna
2005-08-01 18:57 ` Steven Rostedt
2005-08-01 19:05   ` Luca Falavigna
2005-08-01 19:13     ` Sven-Thorsten Dietrich
2005-08-01 19:26       ` Steven Rostedt [this message]
2005-08-01 21:03   ` Ingo Molnar
2005-08-01 21:24     ` Steven Rostedt
2005-08-01 21:28       ` Ingo Molnar
2005-08-01 20:50 ` Ingo Molnar

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=1122924405.6759.37.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=dktrkranz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sdietrich@mvista.com \
    /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