All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Steven J. Hill" <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, ddaney.cavm@gmail.com
Subject: Re: [PATCH v3] MIPS: micromips: Fix improper definition of ISA exception bit.
Date: Wed, 05 Jun 2013 15:07:55 +0400	[thread overview]
Message-ID: <51AF1C0B.6090904@cogentembedded.com> (raw)
In-Reply-To: <1370372979-20634-1-git-send-email-Steven.Hill@imgtec.com>

Hello.

On 04-06-2013 23:09, Steven J. Hill wrote:

> The ISA exception bit selects whether exceptions are taken in classic
> MIPS or microMIPS mode. This bit is Config3.ISAOnExc and is bit 16. It
> It was improperly defined as bits 16 and 17. Fortunately, bit 17 is
> read-only and did not effect microMIPS operation. However, detecting
> a classic or microMIPS kernel when examining the /proc/cpuinfo file,
> the result always showed a microMIPS kernel.

> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
> ---
>   arch/mips/include/asm/mipsregs.h |    2 +-
>   arch/mips/kernel/cpu-probe.c     |    7 ++-----
>   arch/mips/mti-malta/malta-init.c |    7 +++++++
>   arch/mips/mti-sead3/sead3-init.c |    7 +++++++
>   4 files changed, 17 insertions(+), 6 deletions(-)

[...]
> diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
> index ff8caff..3598f1d 100644
> --- a/arch/mips/mti-malta/malta-init.c
> +++ b/arch/mips/mti-malta/malta-init.c
> @@ -106,6 +106,13 @@ extern struct plat_smp_ops msmtc_smp_ops;
>
>   void __init prom_init(void)
>   {
> +#ifdef CONFIG_CPU_MICROMIPS
> +	unsigned int config3 = read_c0_config3();
> +
> +	if (config3 & MIPS_CONF3_ISA)
> +		write_c0_config3(config3 | MIPS_CONF3_ISA_OE);
> +#endif
> +
>   	mips_display_message("LINUX");
>
>   	/*
> diff --git a/arch/mips/mti-sead3/sead3-init.c b/arch/mips/mti-sead3/sead3-init.c
> index bfbd17b..e68bfd3 100644
> --- a/arch/mips/mti-sead3/sead3-init.c
> +++ b/arch/mips/mti-sead3/sead3-init.c
> @@ -130,6 +130,13 @@ static void __init mips_ejtag_setup(void)
>
>   void __init prom_init(void)
>   {
> +#ifdef CONFIG_CPU_MICROMIPS
> +	unsigned int config3 = read_c0_config3();
> +
> +	if (config3 & MIPS_CONF3_ISA)
> +		write_c0_config3(config3 | MIPS_CONF3_ISA_OE);
> +#endif
> +

    I see it's repeated twice and enclosed in #ifdef... Couldn't you
factor it out in some sort of inline function and put into some header:

#ifdef CONFIG_CPU_MICROMIPS
static inline void mips_set_config3_isa_oe(void)
{
	unsigned int config3 = read_c0_config3();

	if (config3 & MIPS_CONF3_ISA)
		write_c0_config3(config3 | MIPS_CONF3_ISA_OE);
}
#else
static inline void mips_set_config3_isa_oe(void) {}
#endif

WBR, Sergei

  reply	other threads:[~2013-06-05 11:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 19:09 [PATCH v3] MIPS: micromips: Fix improper definition of ISA exception bit Steven J. Hill
2013-06-05 11:07 ` Sergei Shtylyov [this message]
2013-06-05 16:36   ` David Daney
2013-06-05 17:01     ` Sergei Shtylyov

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=51AF1C0B.6090904@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=Steven.Hill@imgtec.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --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.