1. 28 5月, 2016 20 次提交
  2. 17 5月, 2016 7 次提交
  3. 14 5月, 2016 5 次提交
  4. 13 5月, 2016 8 次提交
    • J
      MIPS: pistachio: Determine SoC revision during boot · ae07ea85
      James Hartley 提交于
      Now that there are different revisions of the Pistachio SoC
      in circulation, add this information to the boot log to make
      it easier for users to determine which hardware they have.
      Signed-off-by: NJames Hartley <james.hartley@imgtec.com>
      Signed-off-by: NIonela Voinescu <ionela.voinescu@imgtec.com>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Jonas Gorski <jogo@openwrt.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/13130/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ae07ea85
    • F
      MIPS: BMIPS: Adjust mips-hpt-frequency for BCM7435 · 80fa40ac
      Florian Fainelli 提交于
      The CPU actually runs at 1405Mhz which gives us a 175625000 Hz MIPS timer
      frequency (CPU frequency / 8).
      
      Fixes: e4c7d009 ("MIPS: BMIPS: Add BCM7435 dtsi")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: john@phrozen.org
      Cc: cernekee@gmail.com
      Cc: jaedon.shin@gmail.com
      Patchwork: https://patchwork.linux-mips.org/patch/13132/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      80fa40ac
    • S
      mips: mt7620: fallback to SDRAM when syscfg0 does not have a valid value for the memory type · 86ce9a34
      Sashka Nochkin 提交于
      Mediatek MT7620 SoC has syscfg0 bits where it sets the type of memory being used.
      However, sometimes those bits are not set properly (reading "11"). In this case, the SoC assumes SDRAM.
      The patch below reflects that.
      Signed-off-by: NSashka Nochkin <linux-mips@durdom.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13135/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      86ce9a34
    • P
      MIPS: Prevent "restoration" of MSA context in non-MSA kernels · 6533af4d
      Paul Burton 提交于
      If a kernel doesn't support MSA context (ie. CONFIG_CPU_HAS_MSA=n) then
      it will only keep 64 bits per FP register in thread context, and the
      calls to set_fpr64 in restore_msa_extcontext will overrun the end of the
      FP register context into the FCSR & MSACSR values. GCC 6.x has become
      smart enough to detect this & complain like so:
      
          arch/mips/kernel/signal.c: In function 'protected_restore_fp_context':
          ./arch/mips/include/asm/processor.h:114:17: error: array subscript is above array bounds [-Werror=array-bounds]
            fpr->val##width[FPR_IDX(width, idx)] = val;   \
            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
          ./arch/mips/include/asm/processor.h:118:1: note: in expansion of macro 'BUILD_FPR_ACCESS'
           BUILD_FPR_ACCESS(64)
      
      The only way to trigger this code to run would be for a program to set
      up an artificial extended MSA context structure following a sigframe &
      execute sigreturn. Whilst this doesn't allow a program to write to any
      state that it couldn't already, it makes little sense to allow this
      "restoration" of MSA context in a system that doesn't support MSA.
      
      Fix this by killing a program with SIGSYS if it tries something as crazy
      as "restoring" fake MSA context in this way, also fixing the build error
      & allowing for most of restore_msa_extcontext to be optimised out of
      kernels without support for MSA.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Reported-by: NMichal Toman <michal.toman@imgtec.com>
      Fixes: bf82cb30 ("MIPS: Save MSA extended context around signals")
      Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Michal Toman <michal.toman@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable <stable@vger.kernel.org> # v4.3+
      Patchwork: https://patchwork.linux-mips.org/patch/13164/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6533af4d
    • J
      MIPS: cevt-r4k: Dynamically calculate min_delta_ns · 1fa40555
      James Hogan 提交于
      Calculate the MIPS clockevent device's min_delta_ns dynamically based on
      the time it takes to perform the mips_next_event() sequence.
      
      Virtualisation in particular makes the current fixed min_delta of 0x300
      inappropriate under some circumstances, as the CP0_Count and CP0_Compare
      registers may be being emulated by the hypervisor, and the frequency may
      not correspond directly to the CPU frequency.
      
      We actually use twice the median of multiple 75th percentiles of
      multiple measurements of how long the mips_next_event() sequence takes,
      in order to fairly efficiently eliminate outliers due to unexpected
      hypervisor latency (which would need handling with retries when it
      occurs during normal operation anyway).
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/13176/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1fa40555
    • J
      MIPS: malta-time: Take seconds into account · 24e1df66
      James Hogan 提交于
      When estimating the clock frequency based on the RTC, take seconds into
      account in case the Update In Progress (UIP) bit wasn't seen. This can
      happen in virtual machines (which may get pre-empted by the hypervisor
      at inopportune times) with QEMU emulating the RTC (and in fact not
      setting the UIP bit for very long), especially on slow hosts such as
      FPGA systems and hardware emulators. This results in several seconds
      actually having elapsed before seeing the UIP bit instead of just one
      second, and exaggerated timer frequencies.
      
      While updating the comments, they're also fixed to match the code in
      that the rising edge of the update flag is detected first, not the
      falling edge.
      
      The rising edge gives a more precise point to read the counters in a
      virtualised system than the falling edge, resulting in a more accurate
      frequency.
      
      It does however mean that we have to also wait for the falling edge
      before doing the read of the RTC seconds register, otherwise it seems to
      be possible in slow hardware emulation to stray into the interval when
      the RTC time is undefined during the update (at least 244uS after the
      rising edge of the update flag). This can result in both seconds values
      reading the same, and it wrapping to 60 seconds, vastly underestimating
      the frequency.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13174/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      24e1df66
    • J
      MIPS: malta-time: Start GIC count before syncing to RTC · aab4673b
      James Hogan 提交于
      The sampling of the GIC counter on Malta after observing a rising edge
      of the RTC update flag differs slightly between the first and second
      sample, with the first sample also calling gic_start_count(). The two
      samples should really be taken as similarly as possible to get the most
      accurate figure, so move the gic_start_count() call before detecting the
      rising edge.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13173/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      aab4673b
    • P
      MIPS: Force CPUs to lose FP context during mode switches · 6b832257
      Paul Burton 提交于
      Commit 9791554b ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options
      for MIPS") added support for the PR_SET_FP_MODE prctl, which allows a
      userland program to modify its FP mode at runtime. This is most notably
      required if dynamic linking leads to the FP mode requirement changing at
      runtime from that indicated in the initial executable's ELF header. In
      order to avoid overhead in the general FP context restore code, it aimed
      to have threads in the process become unable to enable the FPU during a
      mode switch & have the thread calling the prctl syscall wait for all
      other threads in the process to be context switched at least once. Once
      that happens we can know that no thread in the process whose mode will
      be switched has live FP context, and it's safe to perform the mode
      switch. However in the (rare) case of modeswitches occurring in
      multithreaded programs this can lead to indeterminate delays for the
      thread invoking the prctl syscall, and the code monitoring for those
      context switches was woefully inadequate for all but the simplest cases.
      
      Fix this by broadcasting an IPI if other CPUs may have live FP context
      for an affected thread, with a handler causing those CPUs to relinquish
      their FPU ownership. Threads will then be allowed to continue running
      but will stall on the wait_on_atomic_t in enable_restore_fp_context if
      they attempt to use FP again whilst the mode switch is still in
      progress. The end result is less fragile poking at scheduler context
      switch counts & a more expedient completion of the mode switch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: 9791554b ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS")
      Reviewed-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: stable <stable@vger.kernel.org> # v4.0+
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/13145/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6b832257