Re: [PATCH v6] MIPS: micromips: Fix improper definition of ISA exception bit.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/05/2013 02:23 PM, Jonas Gorski wrote:
On Wed, Jun 5, 2013 at 11:15 PM, Steven J. Hill <Steven.Hill@xxxxxxxxxx> 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





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux