From: David Daney <ddaney@caviumnetworks.com>
To: "Gleb O. Raiko" <raiko@niisi.msk.ru>, linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: Re: [PATCH] MIPS: Implement __read_mostly
Date: Fri, 15 Oct 2010 12:04:00 -0700 [thread overview]
Message-ID: <4CB8A5A0.9060801@caviumnetworks.com> (raw)
In-Reply-To: <4CB83A24.2050004@niisi.msk.ru>
On 10/15/2010 04:25 AM, Gleb O. Raiko wrote:
> On 14.10.2010 23:36, David Daney wrote:
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -69,7 +69,7 @@ static char __initdata
>> builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
>> * mips_io_port_base is the begin of the address space to which x86 style
>> * I/O ports are mapped.
>> */
>> -const unsigned long mips_io_port_base __read_mostly = -1;
>> +const unsigned long mips_io_port_base = -1;
>> EXPORT_SYMBOL(mips_io_port_base);
>
> While we're here could we eliminate mips_io_port_base for boards that
> don't need it.
>
That is a logically separate issue, so would be the subject of a
different patch. I don't personally plan on working on it, but would be
happy to review anything someone else came up with.
David Daney
> Now, it almost might be done by defining something like
> __swizzle_addr_[bwlq](port) ((port) - mips_io_port_base)
>
> Unfortunately, __swizzle_addr_[bwlq] is also used for memory acceeses
> too (in read/write[bwlq]), so definition above doesn't work.
>
> By providing two variants, e.g. __swizzle_io_addr_[bwlq] and
> __swizzle_mem_addr_[bwlq] we can eliminate unnecessary loads of
> mips_io_port_base.
>
> BTW, in recent kernels the trick with mips_io_port_base doesn't work
> well anyway. The solely purpose of the trick was to prevent loading of
> mips_io_port_base across function calls. Now drivers tend to use
> ioread/iowrite that don't use mips_io_port_base at all or use its own
> wrappers for in/out[bwlq] that _do_ load mips_io_port_base on every call.
>
> Gleb.
>
next prev parent reply other threads:[~2010-10-15 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 19:36 [PATCH] MIPS: Implement __read_mostly David Daney
2010-10-15 11:25 ` Gleb O. Raiko
2010-10-15 19:04 ` David Daney [this message]
2010-10-16 8:04 ` Geert Uytterhoeven
2010-10-16 8:05 ` Geert Uytterhoeven
2010-10-20 19:05 ` Ralf Baechle
2010-10-21 8:07 ` Geert Uytterhoeven
2011-01-17 23:55 ` Ralf Baechle
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=4CB8A5A0.9060801@caviumnetworks.com \
--to=ddaney@caviumnetworks.com \
--cc=linux-mips@linux-mips.org \
--cc=raiko@niisi.msk.ru \
--cc=ralf@linux-mips.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 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.