From: Sam Ravnborg <sam@ravnborg.org>
To: liqin.chen@sunplusct.com
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org
Subject: Re: [PATCH 4/13] score - New architecure port to SunplusCT S+CORE processor
Date: Fri, 27 Mar 2009 19:34:35 +0100 [thread overview]
Message-ID: <20090327183435.GA21149@uranus.ravnborg.org> (raw)
In-Reply-To: <OF7C8E38E6.732D64E1-ON48257586.0008A8A3-48257586.0008F44B@sunplusct.com>
Hi Chen Liqin.
I have browsed throug the code and it generally looks good, especially
for a first posting to lkml.
I will not repeat the advices from Arnd and others.
But only add to that that running your patches through checkpatch
and with a critical mind fix the errors/warnings.
Especially for arch code you cannot blindly assume checkpatch is always right!
A few comments below.
Sam
> diff -uprN -x linux-2.6-git.ori/Documentation/dontdiff
> linux-2.6-git.ori/arch/score/include/asm/pgtable-32.h
> linux-2.6-git.new/arch/score/include/asm/pgtable-32.h
> --- linux-2.6-git.ori/arch/score/include/asm/pgtable-32.h 1970-01-01
> 08:00:00.000000000 +0800
> +++ linux-2.6-git.new/arch/score/include/asm/pgtable-32.h 2009-03-23
> 17:47:05.000000000 +0800
> @@ -0,0 +1,122 @@
> +#ifndef _ASM_PGTABLE_32_H
> +#define _ASM_PGTABLE_32_H
> +
> +#include <linux/linkage.h>
> +#include <asm-generic/pgtable-nopmd.h>
> +#include <asm/page.h>
> +#include <asm/fixmap.h>
> +
> +/* PGDIR_SHIFT determines what a third-level page table entry can map */
> +#define PGDIR_SHIFT 22
> +#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
> +#define PGDIR_MASK (~(PGDIR_SIZE-1))
If you include <linux/const.h> then you can use:
#define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT)
This has the advantage that your headerfile is compatible with
assembler and you can use the symbol in your linker scrip too.
> +++ linux-2.6-git.new/arch/score/include/asm/scoreregs.h 2009-03-20
> 10:43:48.000000000 +0800
> @@ -0,0 +1,65 @@
> +#include <linux/linkage.h>
> +
> +#define IRQ_TIMER (7) /* IRQ number of SPG300 */
> +
> +/* TIMER register */
> +#define TIME0Base 0x96080000
> +#define rTIMER0C (*(volatile unsigned *)(TIME0Base+0x00))
> +#define rTIMER0CPPC (*(volatile unsigned *)(TIME0Base+0x04))
> +#define rTIMER0CPR (*(volatile unsigned *)(TIME0Base+0x08))
> +#define rTIMER0CPPR (*(volatile unsigned *)(TIME0Base+0x0C))
> +#define rTIMER0UC (*(volatile unsigned *)(TIME0Base+0x10))
The general opinion is that if you say volatile your are doing something
wrong. Explicit memory barriers is the right way to deal with things.
There are longer threads about that you should be able to google.
prev parent reply other threads:[~2009-03-27 18:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 1:36 [PATCH 4/13] score - New architecure port to SunplusCT S+CORE processor liqin.chen
2009-03-27 18:34 ` Sam Ravnborg [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=20090327183435.GA21149@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liqin.chen@sunplusct.com \
--cc=torvalds@linux-foundation.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