linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kronos <kronos@people.it>
To: John Zielinski <grim@undead.cc>
Cc: linux-fbdev-devel@lists.sourceforge.net,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: radeon_pm.c locking problem
Date: Fri, 2 Jul 2004 20:52:41 +0200	[thread overview]
Message-ID: <20040702185241.GA25832@dreamland.darkstar.lan> (raw)
In-Reply-To: <40E59B82.7000807@undead.cc>

Il Fri, Jul 02, 2004 at 01:29:38PM -0400, John Zielinski ha scritto: 
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> There's a post in the lkml from a Stanford researcher working on a tool 
> to sniff out locking problems.  In his post he gave an example from the 
> radeon_pm.c file.  Just want to make sure the appropriate people noticed 
> the post.  It's subject is "[BUGS] [CHECKER] 99 synchronization bugs and 
> a lock summary database".

Hum, it seems a real bug because OUTPLL is a macro. The following line
(radeon_pm.c:323, but there are more of them):

OUTPLL(pllPIXCLKS_CNTL, INPLL(pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK);

is expanded in:

do {
        unsigned long flags;
        spin_lock_irqsave(&rinfo->reg_lock, flags);
        __OUTPLL(pllPIXCLKS_CNTL, INPLL(pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK);
        spin_unlock_irqrestore(&rinfo->reg_lock, flags);
} while(0)

and INPLL will try to reacquire the lock ->reg_lock. We could either use
__INPLL (which does not take the lock) or make OUTPLL an inline function
(in this way INPLL is called before entering the function).

Ben?

Luca
-- 
Home: http://kronoz.cjb.net
#include <stdio.h> 
int main(void) {printf("\t\t\b\b\b\b\b\b");
printf("\t\t\b\b\b\b\b\b");return 0;}


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

  reply	other threads:[~2004-07-02 18:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-02 17:29 radeon_pm.c locking problem John Zielinski
2004-07-02 18:52 ` Kronos [this message]
2004-07-05 13:44   ` Benjamin Herrenschmidt
2004-07-05 16:41     ` Kronos
2004-07-05 21:24       ` David Eger
2004-07-05 22:03         ` Benjamin Herrenschmidt
2004-07-02 20:14 ` David Eger

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=20040702185241.GA25832@dreamland.darkstar.lan \
    --to=kronos@people.it \
    --cc=benh@kernel.crashing.org \
    --cc=grim@undead.cc \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).