mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Juergen Beisert <juergen127@kreuzholzen.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Geode-GX1 processor in 2.6.21
Date: Mon, 30 Apr 2007 14:20:22 +0200	[thread overview]
Message-ID: <20070430122022.GA9896@rhlx01.hs-esslingen.de> (raw)
In-Reply-To: <200704301251.05697.juergen127@kreuzholzen.de>

Hi,

On Mon, Apr 30, 2007 at 12:51:05PM +0200, Juergen Beisert wrote:
> Hi all,
> 
> I do not understand it, but setting up some chipset features (tweaks) fail on 
> Geode GX1.
> 
> In arch/i386/kernel/cpu/cyrix.c function geode_configure() tries to enable 
> the "suspend on halt power saving feature". This is the line:
> 
> 	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
> 
> If this register is 0x00 before, it is still 0x00 after this line. If I change 
> the line into this:
> 
> 	ccr2 = getCx86(CX86_CCR2);
> 	ccr2 |= 0x88;
> 	setCx86(CX86_CCR2, ccr2);
> 
> register ccr2 is 0x88 after the setCx86 call and the power saving feature is 
> active (and BTW: the TSC is useless then, because it also stops when the CPU 
> runs into a HLT instruction).
> 
> setCx86 and getCx86 are macros defined in include/asm-i386/processor.h:
> 
> #define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
> 
> #define setCx86(reg, data) do { \
>          outb((reg), 0x22); \
>          outb((data), 0x23); \
> } while (0)
> 
> Maybe the compiler does the wrong thing if someone uses these macros in the 
> same instruction?

Sounds quite likely.
You should check objdump -d output of cyrix.o to verify whether the compiler
"illegally" reorders some I/O instructions in geode_configure().
Probably you need to add a barrier() or wmb() or similar to these macros.
Or should this be a (code-invisible) PCI posting issue? In that case you need
to add some dummy read operations.

Also, it would probably be good to convert these macros into inline functions
in this header.

Andreas Mohr

  reply	other threads:[~2007-04-30 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 10:51 Juergen Beisert
2007-04-30 12:20 ` Andreas Mohr [this message]
2007-04-30 13:16   ` Juergen Beisert
2007-04-30 15:02   ` Alan Cox
2007-04-30 12:13 Mikael Pettersson

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=20070430122022.GA9896@rhlx01.hs-esslingen.de \
    --to=andi@rhlx01.fht-esslingen.de \
    --cc=juergen127@kreuzholzen.de \
    --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

all inboxes | Powered by JetHome®