1. 10 Jul, 2019 10 commits
    • Don Brace's avatar
      scsi: hpsa: correct ioaccel2 chaining · 8be5629b
      Don Brace authored
      [ Upstream commit 625d7d35
      
       ]
      
      - set ioaccel2_sg_element member 'chain_indicator' to IOACCEL2_LAST_SG for
        the last s/g element.
      
      - set ioaccel2_sg_element member 'chain_indicator' to IOACCEL2_CHAIN when
        chaining.
      Reviewed-by: default avatarBader Ali - Saleh <bader.alisaleh@microsemi.com>
      Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
      Reviewed-by: default avatarMatt Perricone <matt.perricone@microsemi.com>
      Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      8be5629b
    • Alexandre Belloni's avatar
      usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC · 26a6acde
      Alexandre Belloni authored
      [ Upstream commit fbc318af
      
       ]
      
      Gadget drivers may queue request in interrupt context. This would lead to
      a descriptor allocation in that context. In that case we would hit
      BUG_ON(in_interrupt()) in __get_vm_area_node.
      
      Also remove the unnecessary cast.
      Acked-by: default avatarSylvain Lemieux <slemieux.tyco@gmail.com>
      Tested-by: default avatarJames Grant <jamesg@zaltys.org>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      26a6acde
    • Young Xiao's avatar
      usb: gadget: fusb300_udc: Fix memory leak of fusb300->ep[i] · 9be058f5
      Young Xiao authored
      [ Upstream commit 62fd0e0a
      
       ]
      
      There is no deallocation of fusb300->ep[i] elements, allocated at
      fusb300_probe.
      
      The patch adds deallocation of fusb300->ep array elements.
      Signed-off-by: default avatarYoung Xiao <92siuyang@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9be058f5
    • Hsin-Yi Wang's avatar
      drm/mediatek: call mtk_dsi_stop() after mtk_drm_crtc_atomic_disable() · 3b60f98e
      Hsin-Yi Wang authored
      [ Upstream commit 2458d9d6 ]
      
      mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(), which
      needs ovl irq for drm_crtc_wait_one_vblank(), since after mtk_dsi_stop() is
      called, ovl irq will be disabled. If drm_crtc_wait_one_vblank() is called
      after last irq, it will timeout with this message: "vblank wait timed out
      on crtc 0". This happens sometimes when turning off the screen.
      
      In drm_atomic_helper.c#disable_outputs(),
      the calling sequence when turning off the screen is:
      
      1. mtk_dsi_encoder_disable()
           --> mtk_output_dsi_disable()
             --> mtk_dsi_stop();  /* sometimes make vblank timeout in
                                     atomic_disable */
             --> mtk_dsi_poweroff();
      2. mtk_drm_crtc_atomic_disable()
           --> drm_crtc_wait_one_vblank();
           ...
             --> mtk_dsi_ddp_stop()
               --> mtk_dsi_poweroff();
      
      mtk_dsi_poweroff() has reference count design, change to make
      mtk_dsi_stop() called in mtk_dsi_poweroff() when refcount is 0.
      
      Fixes: 0707632b
      
       ("drm/mediatek: update DSI sub driver flow for sending commands to panel")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3b60f98e
    • Hsin-Yi Wang's avatar
      drm/mediatek: clear num_pipes when unbind driver · 34e5e1c4
      Hsin-Yi Wang authored
      [ Upstream commit a4cd1d2b ]
      
      num_pipes is used for mutex created in mtk_drm_crtc_create(). If we
      don't clear num_pipes count, when rebinding driver, the count will
      be accumulated. From mtk_disp_mutex_get(), there can only be at most
      10 mutex id. Clear this number so it starts from 0 in every rebind.
      
      Fixes: 119f5173
      
       ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      34e5e1c4
    • Hsin-Yi Wang's avatar
      drm/mediatek: call drm_atomic_helper_shutdown() when unbinding driver · a8a86e9a
      Hsin-Yi Wang authored
      [ Upstream commit cf49b24f ]
      
      shutdown all CRTC when unbinding drm driver.
      
      Fixes: 119f5173
      
       ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      a8a86e9a
    • Hsin-Yi Wang's avatar
      drm/mediatek: unbind components in mtk_drm_unbind() · 79e095d2
      Hsin-Yi Wang authored
      [ Upstream commit f0fd8483 ]
      
      Unbinding components (i.e. mtk_dsi and mtk_disp_ovl/rdma/color) will
      trigger master(mtk_drm)'s .unbind(), and currently mtk_drm's unbind
      won't actually unbind components. During the next bind,
      mtk_drm_kms_init() is called, and the components are added back.
      
      .unbind() should call mtk_drm_kms_deinit() to unbind components.
      
      And since component_master_del() in .remove() will trigger .unbind(),
      which will also unregister device, it's fine to remove original functions
      called here.
      
      Fixes: 119f5173
      
       ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      79e095d2
    • Hsin-Yi Wang's avatar
      drm/mediatek: fix unbind functions · 319f4699
      Hsin-Yi Wang authored
      [ Upstream commit 8fd7a37b ]
      
      detatch panel in mtk_dsi_destroy_conn_enc(), since .bind will try to
      attach it again.
      
      Fixes: 2e54c14e
      
       ("drm/mediatek: Add DSI sub driver")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      319f4699
    • YueHaibing's avatar
      spi: bitbang: Fix NULL pointer dereference in spi_unregister_master · dbd94f49
      YueHaibing authored
      [ Upstream commit 5caaf29a
      
       ]
      
      If spi_register_master fails in spi_bitbang_start
      because device_add failure, We should return the
      error code other than 0, otherwise calling
      spi_bitbang_stop may trigger NULL pointer dereference
      like this:
      
      BUG: KASAN: null-ptr-deref in __list_del_entry_valid+0x45/0xd0
      Read of size 8 at addr 0000000000000000 by task syz-executor.0/3661
      
      CPU: 0 PID: 3661 Comm: syz-executor.0 Not tainted 5.1.0+ #28
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      Call Trace:
       dump_stack+0xa9/0x10e
       ? __list_del_entry_valid+0x45/0xd0
       ? __list_del_entry_valid+0x45/0xd0
       __kasan_report+0x171/0x18d
       ? __list_del_entry_valid+0x45/0xd0
       kasan_report+0xe/0x20
       __list_del_entry_valid+0x45/0xd0
       spi_unregister_controller+0x99/0x1b0
       spi_lm70llp_attach+0x3ae/0x4b0 [spi_lm70llp]
       ? 0xffffffffc1128000
       ? klist_next+0x131/0x1e0
       ? driver_detach+0x40/0x40 [parport]
       port_check+0x3b/0x50 [parport]
       bus_for_each_dev+0x115/0x180
       ? subsys_dev_iter_exit+0x20/0x20
       __parport_register_driver+0x1f0/0x210 [parport]
       ? 0xffffffffc1150000
       do_one_initcall+0xb9/0x3b5
       ? perf_trace_initcall_level+0x270/0x270
       ? kasan_unpoison_shadow+0x30/0x40
       ? kasan_unpoison_shadow+0x30/0x40
       do_init_module+0xe0/0x330
       load_module+0x38eb/0x4270
       ? module_frob_arch_sections+0x20/0x20
       ? kernel_read_file+0x188/0x3f0
       ? find_held_lock+0x6d/0xd0
       ? fput_many+0x1a/0xe0
       ? __do_sys_finit_module+0x162/0x190
       __do_sys_finit_module+0x162/0x190
       ? __ia32_sys_init_module+0x40/0x40
       ? __mutex_unlock_slowpath+0xb4/0x3f0
       ? wait_for_completion+0x240/0x240
       ? vfs_write+0x160/0x2a0
       ? lockdep_hardirqs_off+0xb5/0x100
       ? mark_held_locks+0x1a/0x90
       ? do_syscall_64+0x14/0x2a0
       do_syscall_64+0x72/0x2a0
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Fixes: 702a4879
      
       ("spi: bitbang: Let spi_bitbang_start() take a reference to master")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarAxel Lin <axel.lin@ingics.com>
      Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      dbd94f49
    • Guilherme G. Piccoli's avatar
      md/raid0: Do not bypass blocking queue entered for raid0 bios · 869eec89
      Guilherme G. Piccoli authored
      ```--------------------------------------------------------------
      This patch is not on mainline and is meant to 4.19 stable *only*.
      After the patch description there's a reasoning about that.
      ```
      
      --------------------------------------------------------------
      
      Commit cd4a4ae4 ("block: don't use blocking queue entered for
      recursive bio submits") introduced the flag BIO_QUEUE_ENTERED in order
      split bios bypass the blocking queue entering routine and use the live
      non-blocking version. It was a result of an extensive discussion in
      a linux-block thread[0], and the purpose of this change was to prevent
      a hung task waiting on a reference to drop.
      
      Happens that md raid0 split bios all the time, and more important,
      it changes their underlying device to the raid member. After the change
      introduced by this flag's usage, we experience various crashes if a raid0
      member is removed during a large write. This happens because the bio
      reaches the live queue entering function when the queue of the raid0
      member is dying.
      
      A simple reproducer of this behavior is presented below:
      a) Build kernel v4.19.56-stable with CONFIG_BLK_DEV_THROTTLING=y.
      
      b) Create a raid0 md array with 2 NVMe devices as members, and mount
      it with an ext4 filesystem.
      
      c) Run the following oneliner (supposing the raid0 is mounted in /mnt):
      (dd of=/mnt/tmp if=/dev/zero bs=1M count=999 &); sleep 0.3;
      echo 1 > /sys/block/nvme1n1/device/device/remove
      (whereas nvme1n1 is the 2nd array member)
      
      This will trigger the following warning/oops:
      
      ------------[ cut here ]------------
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000155
      PGD 0 P4D 0
      Oops: 0000 [#1] SMP PTI
      RIP: 0010:blk_throtl_bio+0x45/0x970
      [...]
      Call Trace:
       generic_make_request_checks+0x1bf/0x690
       generic_make_request+0x64/0x3f0
       raid0_make_request+0x184/0x620 [raid0]
       ? raid0_make_request+0x184/0x620 [raid0]
       md_handle_request+0x126/0x1a0
       md_make_request+0x7b/0x180
       generic_make_request+0x19e/0x3f0
       submit_bio+0x73/0x140
      [...]
      
      This patch changes raid0 driver to fallback to the "old" blocking queue
      entering procedure, by clearing the BIO_QUEUE_ENTERED from raid0 bios.
      This prevents the crashes and restores the regular behavior of raid0
      arrays when a member is removed during a large write.
      
      [0] lore.kernel.org/linux-block/343bbbf6-64eb-879e-d19e-96aebb037d47@I-love.SAKURA.ne.jp
      
      ----------------------------
      Why this is not on mainline?
      ----------------------------
      
      The patch was originally submitted upstream in linux-raid and
      linux-block mailing-lists - it was initially accepted by Song Liu,
      but Christoph Hellwig[1] observed that there was a clean-up series
      ready to be accepted from Ming Lei[2] that fixed the same issue.
      
      The accepted patches from Ming's series in upstream are: commit
      47cdee29 ("block: move blk_exit_queue into __blk_release_queue") and
      commit fe200864 ("block: don't protect generic_make_request_checks
      with blk_queue_enter"). Those patches basically do a clean-up in the
      block layer involving:
      
      1) Putting back blk_exit_queue() logic into __blk_release_queue(); that
      path was changed in the past and the logic from blk_exit_queue() was
      added to blk_cleanup_queue().
      
      2) Removing the guard/protection in generic_make_request_checks() with
      blk_queue_enter().
      
      The problem with Ming's series for -stable is that it relies in the
      legacy request IO path removal. So it's "backport-able" to v5.0+,
      but doing that for early versions (like 4.19) would incur in complex
      code changes. Hence, it was suggested by Christoph and Song Liu that
      this patch was submitted to stable only; otherwise merging it upstream
      would add code to fix a path removed in a subsequent commit.
      
      [1] lore.kernel.org/linux-block/20190521172258.GA32702@infradead.org
      [2] lore.kernel.org/linux-block/20190515030310.20393-1-ming.lei@redhat.com
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Ming Lei <ming.lei@redhat.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Fixes: cd4a4ae4
      
       ("block: don't use blocking queue entered for recursive bio submits")
      Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@canonical.com>
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      869eec89
  2. 03 Jul, 2019 23 commits
  3. 25 Jun, 2019 7 commits