1. 15 Mar, 2017 31 commits
  2. 12 Mar, 2017 9 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.4.53 · 49616e71
      Greg Kroah-Hartman authored
      49616e71
    • James Smart's avatar
      scsi: lpfc: Correct WQ creation for pagesize · 9cee6946
      James Smart authored
      commit 8ea73db4 upstream.
      
      Correct WQ creation for pagesize
      
      The driver was calculating the adapter command pagesize indicator from
      the system pagesize. However, the buffers the driver allocates are only
      one size (SLI4_PAGE_SIZE), so no calculation was necessary.
      Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Cc: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9cee6946
    • Ralf Baechle's avatar
      MIPS: IP22: Fix build error due to binutils 2.25 uselessnes. · 1d316060
      Ralf Baechle authored
      commit ae2f5e5e upstream.
      
      Fix the following build error with binutils 2.25.
      
        CC      arch/mips/mm/sc-ip22.o
      {standard input}: Assembler messages:
      {standard input}:132: Error: number (0x9000000080000000) larger than 32 bits
      {standard input}:159: Error: number (0x9000000080000000) larger than 32 bits
      {standard input}:200: Error: number (0x9000000080000000) larger than 32 bits
      scripts/Makefile.build:293: recipe for target 'arch/mips/mm/sc-ip22.o' failed
      make[1]: *** [arch/mips/mm/sc-ip22.o] Error 1
      
      MIPS has used .set mips3 to temporarily switch the assembler to 64 bit
      mode in 64 bit kernels virtually forever.  Binutils 2.25 broke this
      behavious partially by happily accepting 64 bit instructions in .set mips3
      mode but puking on 64 bit constants when generating 32 bit ELF.  Binutils
      2.26 restored the old behaviour again.
      
      Fix build with binutils 2.25 by open coding the offending
      
      	dli $1, 0x9000000080000000
      
      as
      
      	li	$1, 0x9000
      	dsll	$1, $1, 48
      
      which is ugly be the only thing that will build on all binutils vintages.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d316060
    • Ralf Baechle's avatar
    • Ravi Bangoria's avatar
      powerpc/xmon: Fix data-breakpoint · 15959b72
      Ravi Bangoria authored
      commit c21a493a upstream.
      
      Currently xmon data-breakpoint feature is broken.
      
      Whenever there is a watchpoint match occurs, hw_breakpoint_handler will
      be called by do_break via notifier chains mechanism. If watchpoint is
      registered by xmon, hw_breakpoint_handler won't find any associated
      perf_event and returns immediately with NOTIFY_STOP. Similarly, do_break
      also returns without notifying to xmon.
      
      Solve this by returning NOTIFY_DONE when hw_breakpoint_handler does not
      find any perf_event associated with matched watchpoint, rather than
      NOTIFY_STOP, which tells the core code to continue calling the other
      breakpoint handlers including the xmon one.
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      15959b72
    • Magnus Lilja's avatar
      dmaengine: ipu: Make sure the interrupt routine checks all interrupts. · afee78f0
      Magnus Lilja authored
      commit adee40b2 upstream.
      
      Commit 3d8cc000 ("dmaengine: ipu: Consolidate duplicated irq handlers")
      consolidated the two interrupts routines into one, but the remaining
      interrupt routine only checks the status of the error interrupts, not the
      normal interrupts.
      
      This patch fixes that problem (tested on i.MX31 PDK board).
      
      Fixes: 3d8cc000 ("dmaengine: ipu: Consolidate duplicated irq handlers")
      Cc: Vinod Koul <vinod.koul@intel.com>
      Signed-off-by: default avatarMagnus Lilja <lilja.magnus@gmail.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      afee78f0
    • Rafał Miłecki's avatar
      bcma: use (get|put)_device when probing/removing device driver · 79a7ff14
      Rafał Miłecki authored
      commit a971df0b upstream.
      
      This allows tracking device state and e.g. makes devm work as expected.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79a7ff14
    • colyli@suse.de's avatar
      md linear: fix a race between linear_add() and linear_congested() · 5a1f03f1
      colyli@suse.de authored
      commit 03a9e24e upstream.
      
      Recently I receive a bug report that on Linux v3.0 based kerenl, hot add
      disk to a md linear device causes kernel crash at linear_congested(). From
      the crash image analysis, I find in linear_congested(), mddev->raid_disks
      contains value N, but conf->disks[] only has N-1 pointers available. Then
      a NULL pointer deference crashes the kernel.
      
      There is a race between linear_add() and linear_congested(), RCU stuffs
      used in these two functions cannot avoid the race. Since Linuv v4.0
      RCU code is replaced by introducing mddev_suspend().  After checking the
      upstream code, it seems linear_congested() is not called in
      generic_make_request() code patch, so mddev_suspend() cannot provent it
      from being called. The possible race still exists.
      
      Here I explain how the race still exists in current code.  For a machine
      has many CPUs, on one CPU, linear_add() is called to add a hard disk to a
      md linear device; at the same time on other CPU, linear_congested() is
      called to detect whether this md linear device is congested before issuing
      an I/O request onto it.
      
      Now I use a possible code execution time sequence to demo how the possible
      race happens,
      
      seq    linear_add()                linear_congested()
       0                                 conf=mddev->private
       1   oldconf=mddev->private
       2   mddev->raid_disks++
       3                              for (i=0; i<mddev->raid_disks;i++)
       4                                bdev_get_queue(conf->disks[i].rdev->bdev)
       5   mddev->private=newconf
      
      In linear_add() mddev->raid_disks is increased in time seq 2, and on
      another CPU in linear_congested() the for-loop iterates conf->disks[i] by
      the increased mddev->raid_disks in time seq 3,4. But conf with one more
      element (which is a pointer to struct dev_info type) to conf->disks[] is
      not updated yet, accessing its structure member in time seq 4 will cause a
      NULL pointer deference fault.
      
      To fix this race, there are 2 parts of modification in the patch,
       1) Add 'int raid_disks' in struct linear_conf, as a copy of
          mddev->raid_disks. It is initialized in linear_conf(), always being
          consistent with pointers number of 'struct dev_info disks[]'. When
          iterating conf->disks[] in linear_congested(), use conf->raid_disks to
          replace mddev->raid_disks in the for-loop, then NULL pointer deference
          will not happen again.
       2) RCU stuffs are back again, and use kfree_rcu() in linear_add() to
          free oldconf memory. Because oldconf may be referenced as mddev->private
          in linear_congested(), kfree_rcu() makes sure that its memory will not
          be released until no one uses it any more.
      Also some code comments are added in this patch, to make this modification
      to be easier understandable.
      
      This patch can be applied for kernels since v4.0 after commit:
      3be260cc ("md/linear: remove rcu protections in favour of
      suspend/resume"). But this bug is reported on Linux v3.0 based kernel, for
      people who maintain kernels before Linux v4.0, they need to do some back
      back port to this patch.
      
      Changelog:
       - V3: add 'int raid_disks' in struct linear_conf, and use kfree_rcu() to
             replace rcu_call() in linear_add().
       - v2: add RCU stuffs by suggestion from Shaohua and Neil.
       - v1: initial effort.
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Neil Brown <neilb@suse.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5a1f03f1
    • Maxime Ripard's avatar
      rtc: sun6i: Switch to the external oscillator · 037cd237
      Maxime Ripard authored
      commit fb61bb82 upstream.
      
      The RTC is clocked from either an internal, imprecise, oscillator or an
      external one, which is usually much more accurate.
      
      The difference perceived between the time elapsed and the time reported by
      the RTC is in a 10% scale, which prevents the RTC from being useful at all.
      
      Fortunately, the external oscillator is reported to be mandatory in the
      Allwinner datasheet, so we can just switch to it.
      
      Fixes: 9765d2d9 ("rtc: sun6i: Add sun6i RTC driver")
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      037cd237