1. 27 Mar, 2015 8 commits
    • Paul Burton's avatar
      MIPS: prevent FP context set via ptrace being discarded · ac9ad83b
      Paul Burton authored
      If a ptracee has not used the FPU and the ptracer sets its FP context
      using PTRACE_POKEUSR, PTRACE_SETFPREGS or PTRACE_SETREGSET then that
      context will be discarded upon either the ptracee using the FPU or a
      further write to the context via ptrace. Prevent this loss by recording
      that the task has "used" math once its FP context has been written to.
      The context initialisation code that was present for the PTRACE_POKEUSR
      case is reused for the other 2 cases to provide consistent behaviour
      for the different ptrace requests.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9166/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ac9ad83b
    • Paul Burton's avatar
      MIPS: Ensure FCSR cause bits are clear after invoking FPU emulator · ad70c13a
      Paul Burton authored
      When running the emulator to handle an instruction that raised an FP
      unimplemented operation exception, the FCSR cause bits were being
      cleared. This is done to ensure that the kernel does not take an FP
      exception when later restoring FP context to registers. However, this
      was not being done when the emulator is invoked in response to a
      coprocessor unusable exception. This happens in 2 cases:
      
        - There is no FPU present in the system. In this case things were
          OK, since the FP context is never restored to hardware registers
          and thus no FP exception may be raised when restoring FCSR.
      
        - The FPU could not be configured to the mode required by the task.
          In this case it would be possible for the emulator to set cause
          bits which are later restored to hardware if the task migrates
          to a CPU whose associated FPU does support its mode requirements,
          or if the tasks FP mode requirements change.
      
      Consistently clear the cause bits after invoking the emulator, by moving
      the clearing to process_fpemu_return and ensuring this is always called
      before the tasks FP context is restored. This will make it easier to
      catch further paths invoking the emulator in future, as will be
      introduced in further patches.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9165/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ad70c13a
    • Paul Burton's avatar
      MIPS: clear MSACSR cause bits when handling MSA FP exception · 091be550
      Paul Burton authored
      Much like for traditional scalar FP exceptions, the cause bits in the
      MSACSR register need to be cleared following an MSA FP exception.
      Without doing so the exception will simply be raised again whenever
      the kernel restores MSACSR from a tasks saved context, leading to
      undesirable spurious exceptions. Clear the cause bits from the
      handle_msa_fpe function, mirroring the way handle_fpe clears the
      cause bits in FCSR.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9164/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      091be550
    • Paul Burton's avatar
      MIPS: wrap cfcmsa & ctcmsa accesses for toolchains with MSA support · e1bebbab
      Paul Burton authored
      Uses of the cfcmsa & ctcmsa instructions were not being wrapped by a
      macro in the case where the toolchain supports MSA, since the arguments
      exactly match a typical use of the instructions. However using current
      toolchains this leads to errors such as:
      
        arch/mips/kernel/genex.S:437: Error: opcode not supported on this processor: mips32r2 (mips32r2) `cfcmsa $5,1'
      
      Thus uses of the instructions must be in the context of a ".set msa"
      directive, however doing that from the users of the instructions would
      be messy due to the possibility that the toolchain does not support
      MSA. Fix this by renaming the macros (prepending an underscore) in order
      to avoid recursion when attempting to emit the instructions, and provide
      implementations for the TOOLCHAIN_SUPPORTS_MSA case which ".set msa" as
      appropriate.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9163/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      e1bebbab
    • Paul Burton's avatar
      MIPS: remove MSA macro recursion · a3a49810
      Paul Burton authored
      Recursive macros made the code more concise & worked great for the
      case where the toolchain doesn't support MSA. However, with toolchains
      which do support MSA they lead to build failures such as:
      
        arch/mips/kernel/r4k_switch.S: Assembler messages:
        arch/mips/kernel/r4k_switch.S:148: Error: invalid operands `insert.w $w(0+1)[2],$1'
        arch/mips/kernel/r4k_switch.S:148: Error: invalid operands `insert.w $w(0+1)[3],$1'
        arch/mips/kernel/r4k_switch.S:148: Error: invalid operands `insert.w $w((0+1)+1)[2],$1'
        arch/mips/kernel/r4k_switch.S:148: Error: invalid operands `insert.w $w((0+1)+1)[3],$1'
        ...
      
      Drop the recursion from msa_init_all_upper invoking the msa_init_upper
      macro explicitly for each vector register.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9162/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      a3a49810
    • Paul Burton's avatar
      MIPS: assume at as source/dest of MSA copy/insert instructions · f23ce388
      Paul Burton authored
      Assuming at ($1) as the source or destination register of copy or
      insert instructions:
      
        - Simplifies the macros providing those instructions for toolchains
          without MSA support.
      
        - Avoids an unnecessary move instruction when at is used as the source
          or destination register anyway.
      
        - Is sufficient for the uses to be introduced in the kernel by a
          subsequent patch.
      
      Note that due to a patch ordering snafu on my part this also fixes the
      currently broken build with MSA support enabled. The build has been
      broken since commit c9017757 "MIPS: init upper 64b of vector
      registers when MSA is first used", which this patch should have
      preceeded.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9161/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      f23ce388
    • Paul Burton's avatar
      MIPS: Push .set mips64r* into the functions needing it · 631afc65
      Paul Burton authored
      The {save,restore}_fp_context{,32} functions require that the assembler
      allows the use of sdc instructions on any FP register, and this is
      acomplished by setting the arch to mips64r2 or mips64r6
      (using MIPS_ISA_ARCH_LEVEL_RAW).
      
      However this has the effect of enabling the assembler to use mips64
      instructions in the expansion of pseudo-instructions. This was done in
      the (now-reverted) commit eec43a22 "MIPS: Save/restore MSA context
      around signals" which led to my mistakenly believing that there was an
      assembler bug, when in reality the assembler was just emitting mips64
      instructions. Avoid the issue for future commits which will add code to
      r4k_fpu.S by pushing the .set MIPS_ISA_ARCH_LEVEL_RAW directives into
      the functions that require it, and remove the spurious assertion
      declaring the assembler bug.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      [james.hogan@imgtec.com: Rebase on v4.0-rc1 and reword commit message to
       reflect use of MIPS_ISA_ARCH_LEVEL_RAW]
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9612/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      631afc65
    • James Hogan's avatar
      MIPS: lose_fpu(): Disable FPU when MSA enabled · acaf6a97
      James Hogan authored
      The lose_fpu() function only disables the FPU in CP0_Status.CU1 if the
      FPU is in use and MSA isn't enabled.
      
      This isn't necessarily a problem because KSTK_STATUS(current), the
      version of CP0_Status stored on the kernel stack on entry from user
      mode, does always get updated and gets restored when returning to user
      mode, but I don't think it was intended, and it is inconsistent with the
      case of only the FPU being in use. Sometimes leaving the FPU enabled may
      also mask kernel bugs where FPU operations are executed when the FPU
      might not be enabled.
      
      So lets disable the FPU in the MSA case too.
      
      Fixes: 33c771ba ("MIPS: save/disable MSA in lose_fpu")
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9323/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      acaf6a97
  2. 08 Mar, 2015 7 commits
    • Linus Torvalds's avatar
      Linux 4.0-rc3 · 9eccca08
      Linus Torvalds authored
      9eccca08
    • Al Viro's avatar
      sunrpc: fix braino in ->poll() · 1711fd9a
      Al Viro authored
      POLL_OUT isn't what callers of ->poll() are expecting to see; it's
      actually __SI_POLL | 2 and it's a siginfo code, not a poll bitmap
      bit...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      Cc: Bruce Fields <bfields@fieldses.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1711fd9a
    • Linus Torvalds's avatar
      Merge tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 1163d504
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here's a round of USB fixes for 4.0-rc3.
      
        Nothing major, the usual gadget, xhci and usb-serial fixes and a few
        new device ids as well.
      
        All have been in linux-next successfully"
      
      * tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
        xhci: Workaround for PME stuck issues in Intel xhci
        xhci: fix reporting of 0-sized URBs in control endpoint
        usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards
        USB: ch341: set tty baud speed according to tty struct
        USB: serial: cp210x: Adding Seletek device id's
        USB: pl2303: disable break on shutdown
        USB: mxuport: fix null deref when used as a console
        USB: serial: clean up bus probe error handling
        USB: serial: fix port attribute-creation race
        USB: serial: fix tty-device error handling at probe
        USB: serial: fix potential use-after-free after failed probe
        USB: console: add dummy __module_get
        USB: ftdi_sio: add PIDs for Actisense USB devices
        Revert "USB: serial: make bulk_out_size a lower limit"
        cdc-acm: Add support for Denso cradle CU-321
        usb-storage: support for more than 8 LUNs
        uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539
        USB: usbfs: don't leak kernel data in siginfo
        xhci: Clear the host side toggle manually when endpoint is 'soft reset'
        xhci: Allocate correct amount of scratchpad buffers
        ...
      1163d504
    • Linus Torvalds's avatar
      Merge tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · bbbce516
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some tty and serial driver fixes for 4.0-rc3.
      
        Along with the atime fix that you know about, here are some other
        serial driver bugfixes as well.  Most notable is a wait_until_sent
        bugfix that was traced back to being around since before 2.6.12 that
        Johan has fixed up.
      
        All have been in linux-next successfully"
      
      * tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        TTY: fix tty_wait_until_sent maximum timeout
        TTY: fix tty_wait_until_sent on 64-bit machines
        USB: serial: fix infinite wait_until_sent timeout
        TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation
        net: irda: fix wait_until_sent poll timeout
        serial: uapi: Declare all userspace-visible io types
        serial: core: Fix iotype userspace breakage
        serial: sprd: Fix missing spin_unlock in sprd_handle_irq()
        console: Fix console name size mismatch
        tty: fix up atime/mtime mess, take four
        serial: 8250_dw: Fix get_mctrl behaviour
        serial:8250:8250_pci: delete unneeded quirk entries
        serial:8250:8250_pci: fix redundant entry report for WCH_CH352_2S
        Change email address for 8250_pci
        serial: 8250: Revert "tty: serial: 8250_core: read only RX if there is something in the FIFO"
        Revert "tty/serial: of_serial: add DT alias ID handling"
      bbbce516
    • Linus Torvalds's avatar
      Merge tag 'staging-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 47df986b
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are some IIO and staging driver fixes for 4.0-rc3.
      
        Details are in the shortlog, nothing major, mostly IIO fixes for
        reported issues.
      
        All have been in linux-next successfully"
      
      * tag 'staging-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (23 commits)
        staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel
        staging: comedi: vmk80xx: remove "firmware version" kernel messages
        staging: comedi: comedi_isadma: fix "stalled" detect in comedi_isadma_disable_on_sample()
        iio: ak8975: fix AK09911 dependencies
        iio: common: ssp_sensors: Protect PM-only functions to kill warning
        IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
        Revert "iio:humidity:si7020: fix pointer to i2c client"
        iio: light: gp2ap020a00f: Select REGMAP_I2C
        iio: light: jsa1212: Select REGMAP_I2C
        iio: ad5686: fix optional reference voltage declaration
        iio:adc:mcp3422 Fix incorrect scales table
        iio: mxs-lradc: fix iio channel map regression
        iio: imu: adis16400: Fix sign extension
        staging: iio: ad2s1200: Fix sign extension
        iio: mxs-lradc: only update the buffer when its conversions have finished
        iio: mxs-lradc: make ADC reads not unschedule touchscreen conversions
        iio: mxs-lradc: make ADC reads not disable touchscreen interrupts
        iio: mxs-lradc: separate touchscreen and buffer virtual channels
        iio: imu: inv_mpu6050: Prevent dereferencing NULL
        iio: iadc: wait_for_completion_timeout time in jiffies
        ...
      47df986b
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 29191c7f
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are two char/misc fixes for 4.0-rc3.
      
        One is a reported binder driver fix needed due to a change in the mm
        core that happened in 4.0-rc1.  Another is a mei driver fix that
        resolves a reported issue in that driver.
      
        Both have been in linux-next for a while"
      
      * tag 'char-misc-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        mei: make device disabled on stop unconditionally
        android: binder: fix binder mmap failures
      29191c7f
    • Linus Torvalds's avatar
      Merge tag 'cc-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · b0bc6572
      Linus Torvalds authored
      Pull "code of conflict" from Greg KH:
       "This file tries to set the rational basis for our code reviews, gives
        some advice on how to conduct them, and provides an excalation channel
        for any kernel developers if they so desire it"
      
      [ Let's see how this works ]
      
      * tag 'cc-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        Code of Conflict
      b0bc6572
  3. 07 Mar, 2015 25 commits