1. 09 Dec, 2017 7 commits
    • Thomas Richter's avatar
      perf test attr: Fix ignored test case result · 462b3549
      Thomas Richter authored
      [ Upstream commit 22905582
      
       ]
      
      Command perf test -v 16 (Setup struct perf_event_attr test) always
      reports success even if the test case fails.  It works correctly if you
      also specify -F (for don't fork).
      
         root@s35lp76 perf]# ./perf test -v 16
         15: Setup struct perf_event_attr               :
         --- start ---
         running './tests/attr/test-record-no-delay'
         [ perf record: Woken up 1 times to write data ]
         [ perf record: Captured and wrote 0.002 MB /tmp/tmp4E1h7R/perf.data
           (1 samples) ]
         expected task=0, got 1
         expected precise_ip=0, got 3
         expected wakeup_events=1, got 0
         FAILED './tests/attr/test-record-no-delay' - match failure
         test child finished with 0
         ---- end ----
         Setup struct perf_event_attr: Ok
      
      The reason for the wrong error reporting is the return value of the
      system() library call. It is called in run_dir() file tests/attr.c and
      returns the exit status, in above case 0xff00.
      
      This value is given as parameter to the exit() function which can only
      handle values 0-0xff.
      
      The child process terminates with exit value of 0 and the parent does
      not detect any error.
      
      This patch corrects the error reporting and prints the correct test
      result.
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20170913081209.39570-2-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-rdube6rfcjsr1nzue72c7lqn@git.kernel.org
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      462b3549
    • Jibin Xu's avatar
      sysrq : fix Show Regs call trace on ARM · 079e0745
      Jibin Xu authored
      [ Upstream commit b00bebbc
      
       ]
      
      When kernel configuration SMP,PREEMPT and DEBUG_PREEMPT are enabled,
      echo 1 >/proc/sys/kernel/sysrq
      echo p >/proc/sysrq-trigger
      kernel will print call trace as below:
      
      sysrq: SysRq : Show Regs
      BUG: using __this_cpu_read() in preemptible [00000000] code: sh/435
      caller is __this_cpu_preempt_check+0x18/0x20
      Call trace:
      [<ffffff8008088e80>] dump_backtrace+0x0/0x1d0
      [<ffffff8008089074>] show_stack+0x24/0x30
      [<ffffff8008447970>] dump_stack+0x90/0xb0
      [<ffffff8008463950>] check_preemption_disabled+0x100/0x108
      [<ffffff8008463998>] __this_cpu_preempt_check+0x18/0x20
      [<ffffff80084c9194>] sysrq_handle_showregs+0x1c/0x40
      [<ffffff80084c9c7c>] __handle_sysrq+0x12c/0x1a0
      [<ffffff80084ca140>] write_sysrq_trigger+0x60/0x70
      [<ffffff8008251e00>] proc_reg_write+0x90/0xd0
      [<ffffff80081f1788>] __vfs_write+0x48/0x90
      [<ffffff80081f241c>] vfs_write+0xa4/0x190
      [<ffffff80081f3354>] SyS_write+0x54/0xb0
      [<ffffff80080833f0>] el0_svc_naked+0x24/0x28
      
      This can be seen on a common board like an r-pi3.
      This happens because when echo p >/proc/sysrq-trigger,
      get_irq_regs() is called outside of IRQ context,
      if preemption is enabled in this situation,kernel will
      print the call trace. Since many prior discussions on
      the mailing lists have made it clear that get_irq_regs
      either just returns NULL or stale data when used outside
      of IRQ context,we simply avoid calling it outside of
      IRQ context.
      Signed-off-by: default avatarJibin Xu <jibin.xu@windriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      079e0745
    • Gustavo A. R. Silva's avatar
      EDAC, sb_edac: Fix missing break in switch · 4b72e3bb
      Gustavo A. R. Silva authored
      [ Upstream commit a8e9b186
      
       ]
      
      Add missing break statement in order to prevent the code from falling
      through.
      Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
      Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      Cc: linux-edac <linux-edac@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20171016174029.GA19757@embeddedor.com
      
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b72e3bb
    • Hiromitsu Yamasaki's avatar
      spi: sh-msiof: Fix DMA transfer size check · e95cdfbe
      Hiromitsu Yamasaki authored
      [ Upstream commit 36735783 ]
      
      DMA supports 32-bit words only,
      even if BITLEN1 of SITMDR2 register is 16bit.
      
      Fixes: b0d0ce8b
      
       ("spi: sh-msiof: Add DMA support")
      Signed-off-by: default avatarHiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
      Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Acked-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarDirk Behme <dirk.behme@de.bosch.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e95cdfbe
    • Lukas Wunner's avatar
      serial: 8250_fintek: Fix rs485 disablement on invalid ioctl() · 826b2a0b
      Lukas Wunner authored
      [ Upstream commit 3236a965 ]
      
      This driver's ->rs485_config callback checks if SER_RS485_RTS_ON_SEND
      and SER_RS485_RTS_AFTER_SEND have the same value.  If they do, it means
      the user has passed in invalid data with the TIOCSRS485 ioctl()
      since RTS must have a different polarity when sending and when not
      sending.  In this case, rs485 mode is not enabled (the RS485_URA bit
      is not set in the RS485 Enable Register) and this is supposed to be
      signaled back to the user by clearing the SER_RS485_ENABLED bit in
      struct serial_rs485 ... except a missing tilde character is preventing
      that from happening.
      
      Fixes: 28e3fb6c
      
       ("serial: Add support for Fintek F81216A LPC to 4 UART")
      Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Cc: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      826b2a0b
    • Rui Hua's avatar
      bcache: recover data from backing when data is clean · fa541bf0
      Rui Hua authored
      commit e393aa24 upstream.
      
      When we send a read request and hit the clean data in cache device, there
      is a situation called cache read race in bcache(see the commit in the tail
      of cache_look_up(), the following explaination just copy from there):
      The bucket we're reading from might be reused while our bio is in flight,
      and we could then end up reading the wrong data. We guard against this
      by checking (in bch_cache_read_endio()) if the pointer is stale again;
      if so, we treat it as an error (s->iop.error = -EINTR) and reread from
      the backing device (but we don't pass that error up anywhere)
      
      It should be noted that cache read race happened under normal
      circumstances, not the circumstance when SSD failed, it was counted
      and shown in  /sys/fs/bcache/XXX/internal/cache_read_races.
      
      Without this patch, when we use writeback mode, we will never reread from
      the backing device when cache read race happened, until the whole cache
      device is clean, because the condition
      (s->recoverable && (dc && !atomic_read(&dc->has_dirty))) is false in
      cached_dev_read_error(). In this situation, the s->iop.error(= -EINTR)
      will be passed up, at last, user will receive -EINTR when it's bio end,
      this is not suitable, and wield to up-application.
      
      In this patch, we use s->read_dirty_data to judge whether the read
      request hit dirty data in cache device, it is safe to reread data from
      the backing device when the read request hit clean data. This can not
      only handle cache read race, but also recover data when failed read
      request from cache device.
      
      [edited by mlyle to fix up whitespace, commit log title, comment
      spelling]
      
      Fixes: d59b2379
      
       ("bcache: only permit to recovery read error when cache device is clean")
      Signed-off-by: default avatarHua Rui <huarui.dev@gmail.com>
      Reviewed-by: default avatarMichael Lyle <mlyle@lyle.org>
      Reviewed-by: default avatarColy Li <colyli@suse.de>
      Signed-off-by: default avatarMichael Lyle <mlyle@lyle.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fa541bf0
    • Coly Li's avatar
      bcache: only permit to recovery read error when cache device is clean · aa129cb1
      Coly Li authored
      commit d59b2379
      
       upstream.
      
      When bcache does read I/Os, for example in writeback or writethrough mode,
      if a read request on cache device is failed, bcache will try to recovery
      the request by reading from cached device. If the data on cached device is
      not synced with cache device, then requester will get a stale data.
      
      For critical storage system like database, providing stale data from
      recovery may result an application level data corruption, which is
      unacceptible.
      
      With this patch, for a failed read request in writeback or writethrough
      mode, recovery a recoverable read request only happens when cache device
      is clean. That is to say, all data on cached device is up to update.
      
      For other cache modes in bcache, read request will never hit
      cached_dev_read_error(), they don't need this patch.
      
      Please note, because cache mode can be switched arbitrarily in run time, a
      writethrough mode might be switched from a writeback mode. Therefore
      checking dc->has_data in writethrough mode still makes sense.
      
      Changelog:
      V4: Fix parens error pointed by Michael Lyle.
      v3: By response from Kent Oversteet, he thinks recovering stale data is a
          bug to fix, and option to permit it is unnecessary. So this version
          the sysfs file is removed.
      v2: rename sysfs entry from allow_stale_data_on_failure  to
          allow_stale_data_on_failure, and fix the confusing commit log.
      v1: initial patch posted.
      
      [small change to patch comment spelling by mlyle]
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      Signed-off-by: default avatarMichael Lyle <mlyle@lyle.org>
      Reported-by: default avatarArne Wolf <awolf@lenovo.com>
      Reviewed-by: default avatarMichael Lyle <mlyle@lyle.org>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Cc: Nix <nix@esperi.org.uk>
      Cc: Kai Krakow <hurikhan77@gmail.com>
      Cc: Eric Wheeler <bcache@lists.ewheeler.net>
      Cc: Junhui Tang <tang.junhui@zte.com.cn>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa129cb1
  2. 05 Dec, 2017 13 commits
  3. 30 Nov, 2017 20 commits