]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 18:12:05 +0000 (20:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 18:12:05 +0000 (20:12 +0200)
added patches:
mmc-block-disable-cmdq-on-the-ioctl-path.patch
mmc-vub3000-fix-control-request-direction.patch

queue-4.19/mmc-block-disable-cmdq-on-the-ioctl-path.patch [new file with mode: 0644]
queue-4.19/mmc-vub3000-fix-control-request-direction.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/mmc-block-disable-cmdq-on-the-ioctl-path.patch b/queue-4.19/mmc-block-disable-cmdq-on-the-ioctl-path.patch
new file mode 100644 (file)
index 0000000..37ec9f8
--- /dev/null
@@ -0,0 +1,59 @@
+From 70b52f09080565030a530a784f1c9948a7f48ca3 Mon Sep 17 00:00:00 2001
+From: Bean Huo <beanhuo@micron.com>
+Date: Tue, 4 May 2021 22:32:09 +0200
+Subject: mmc: block: Disable CMDQ on the ioctl path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Bean Huo <beanhuo@micron.com>
+
+commit 70b52f09080565030a530a784f1c9948a7f48ca3 upstream.
+
+According to the eMMC Spec:
+"When command queuing is enabled (CMDQ Mode En bit in CMDQ_MODE_EN
+field is set to ‘1’) class 11 commands are the only method through
+which data transfer tasks can be issued. Existing data transfer
+commands, namely CMD18/CMD17 and CMD25/CMD24, are not supported when
+command queuing is enabled."
+which means if CMDQ is enabled, the FFU commands will not be supported.
+To fix this issue, just simply disable CMDQ on the ioctl path, and
+re-enable CMDQ once ioctl request is completed.
+
+Tested-by: Michael Brunner <Michael.Brunner@kontron.com>
+Signed-off-by: Bean Huo <beanhuo@micron.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Fixes: 1e8e55b67030 (mmc: block: Add CQE support)
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20210504203209.361597-1-huobean@gmail.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/core/block.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/mmc/core/block.c
++++ b/drivers/mmc/core/block.c
+@@ -1054,6 +1054,12 @@ static void mmc_blk_issue_drv_op(struct
+       switch (mq_rq->drv_op) {
+       case MMC_DRV_OP_IOCTL:
++              if (card->ext_csd.cmdq_en) {
++                      ret = mmc_cmdq_disable(card);
++                      if (ret)
++                              break;
++              }
++              fallthrough;
+       case MMC_DRV_OP_IOCTL_RPMB:
+               idata = mq_rq->drv_op_data;
+               for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) {
+@@ -1064,6 +1070,8 @@ static void mmc_blk_issue_drv_op(struct
+               /* Always switch back to main area after RPMB access */
+               if (rpmb_ioctl)
+                       mmc_blk_part_switch(card, 0);
++              else if (card->reenable_cmdq && !card->ext_csd.cmdq_en)
++                      mmc_cmdq_enable(card);
+               break;
+       case MMC_DRV_OP_BOOT_WP:
+               ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP,
diff --git a/queue-4.19/mmc-vub3000-fix-control-request-direction.patch b/queue-4.19/mmc-vub3000-fix-control-request-direction.patch
new file mode 100644 (file)
index 0000000..1e5ed38
--- /dev/null
@@ -0,0 +1,38 @@
+From 3c0bb3107703d2c58f7a0a7a2060bb57bc120326 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Fri, 21 May 2021 15:30:26 +0200
+Subject: mmc: vub3000: fix control-request direction
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 3c0bb3107703d2c58f7a0a7a2060bb57bc120326 upstream.
+
+The direction of the pipe argument must match the request-type direction
+bit or control requests may fail depending on the host-controller-driver
+implementation.
+
+Fix the SET_ROM_WAIT_STATES request which erroneously used
+usb_rcvctrlpipe().
+
+Fixes: 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver")
+Cc: stable@vger.kernel.org      # 3.0
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Link: https://lore.kernel.org/r/20210521133026.17296-1-johan@kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/vub300.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/vub300.c
++++ b/drivers/mmc/host/vub300.c
+@@ -2289,7 +2289,7 @@ static int vub300_probe(struct usb_inter
+       if (retval < 0)
+               goto error5;
+       retval =
+-              usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
++              usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
+                               SET_ROM_WAIT_STATES,
+                               USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+                               firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
index bfe490b108352745c0d56290307dfb4910dfddd5..ad2c4d22173f2643f64b6c7713b5b143a4a30170 100644 (file)
@@ -222,3 +222,5 @@ vfio-pci-handle-concurrent-vma-faults.patch
 mm-huge_memory.c-don-t-discard-hugepage-if-other-pro.patch
 selftests-vm-pkeys-fix-alloc_random_pkey-to-make-it-.patch
 perf-llvm-return-enomem-when-asprintf-fails.patch
+mmc-block-disable-cmdq-on-the-ioctl-path.patch
+mmc-vub3000-fix-control-request-direction.patch