From: David Daney <ddaney.cavm@gmail.com>
To: Jonas Gorski <jogo@openwrt.org>
Cc: "Steven J. Hill" <Steven.Hill@imgtec.com>, linux-mips@linux-mips.org
Subject: Re: [PATCH v6] MIPS: micromips: Fix improper definition of ISA exception bit.
Date: Wed, 05 Jun 2013 14:27:30 -0700 [thread overview]
Message-ID: <51AFAD42.10603@gmail.com> (raw)
In-Reply-To: <CAOiHx=mFqC=GN0jmb9PXpt+JapfWoP3Pu5NM0sp=F_uAZuwUEA@mail.gmail.com>
On 06/05/2013 02:23 PM, Jonas Gorski wrote:
> On Wed, Jun 5, 2013 at 11:15 PM, Steven J. Hill <Steven.Hill@imgtec.com> wrote:
>> On 06/05/2013 03:53 PM, David Daney wrote:
>>>
>>>
>>> You can only manipulate this bit if you know microMIPS is supported. So
>>> I think you should either not touch it for the non-microMIPS case, or
>>> make the write conditional on the presence of microMIPS support in the
>>> CPU.
>>>
>> I decided to surround with SYS_SUPPORTS_MICROMIPS so the function could be
>> optimized out in v7 of the patch.
>
> Since this is (AFAICT) run after cpu_probe, and cpu probe sets
> MIPS_CPU_MICROMIPS in options[0] if config3 has MIPS_CONF3_ISA set
> (as seen in the context), couldn't you do just the following in
> cpu_trap:
>
> if (cpu_has_mmips) {
> unsigned int config3 = read_c0_config3();
>
> if (IS_ENABLED(CONFIG_CPU_MICROMIPS))
> write_c0_config3(config3 | MIPS_CONF3_ISA_OE);
> else
> write_c0_config3(config3 & ~MIPS_CONF3_ISA_OE);
> }
>
Yes, that would work. It even looks nicer.
David Daney
>
> Regards
> Jonas
>
>
next prev parent reply other threads:[~2013-06-05 21:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 19:49 [PATCH v6] MIPS: micromips: Fix improper definition of ISA exception bit Steven J. Hill
2013-06-05 20:01 ` Sergei Shtylyov
2013-06-05 21:07 ` David Daney
2013-06-05 21:30 ` Sergei Shtylyov
2013-06-05 20:53 ` David Daney
2013-06-05 21:15 ` Steven J. Hill
2013-06-05 21:15 ` Steven J. Hill
2013-06-05 21:23 ` Jonas Gorski
2013-06-05 21:27 ` David Daney [this message]
2013-06-05 21:36 ` Steven J. Hill
2013-06-05 21:36 ` Steven J. Hill
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=51AFAD42.10603@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=Steven.Hill@imgtec.com \
--cc=jogo@openwrt.org \
--cc=linux-mips@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox