]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Mar 2021 12:37:33 +0000 (13:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Mar 2021 12:37:33 +0000 (13:37 +0100)
added patches:
risc-v-correct-enum-sbi_ext_rfence_fid.patch
scsi-lpfc-fix-some-error-codes-in-debugfs.patch
scsi-myrs-fix-a-double-free-in-myrs_cleanup.patch
scsi-ufs-ufs-mediatek-correct-operator.patch

queue-5.10/risc-v-correct-enum-sbi_ext_rfence_fid.patch [new file with mode: 0644]
queue-5.10/scsi-lpfc-fix-some-error-codes-in-debugfs.patch [new file with mode: 0644]
queue-5.10/scsi-myrs-fix-a-double-free-in-myrs_cleanup.patch [new file with mode: 0644]
queue-5.10/scsi-ufs-ufs-mediatek-correct-operator.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/risc-v-correct-enum-sbi_ext_rfence_fid.patch b/queue-5.10/risc-v-correct-enum-sbi_ext_rfence_fid.patch
new file mode 100644 (file)
index 0000000..4842b0b
--- /dev/null
@@ -0,0 +1,48 @@
+From 6dd4879f59b0a0679ed8c3ebaff3d79f37930778 Mon Sep 17 00:00:00 2001
+From: Heinrich Schuchardt <xypron.glpk@gmx.de>
+Date: Sat, 6 Mar 2021 06:48:01 +0100
+Subject: RISC-V: correct enum sbi_ext_rfence_fid
+
+From: Heinrich Schuchardt <xypron.glpk@gmx.de>
+
+commit 6dd4879f59b0a0679ed8c3ebaff3d79f37930778 upstream.
+
+The constants in enum sbi_ext_rfence_fid should match the SBI
+specification. See
+https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc#78-function-listing
+
+| Function Name               | FID | EID
+| sbi_remote_fence_i          |   0 | 0x52464E43
+| sbi_remote_sfence_vma       |   1 | 0x52464E43
+| sbi_remote_sfence_vma_asid  |   2 | 0x52464E43
+| sbi_remote_hfence_gvma_vmid |   3 | 0x52464E43
+| sbi_remote_hfence_gvma      |   4 | 0x52464E43
+| sbi_remote_hfence_vvma_asid |   5 | 0x52464E43
+| sbi_remote_hfence_vvma      |   6 | 0x52464E43
+
+Fixes: ecbacc2a3efd ("RISC-V: Add SBI v0.2 extension definitions")
+Reported-by: Sean Anderson <seanga2@gmail.com>
+Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
+Reviewed-by: Anup Patel <anup@brainfault.org>
+Reviewed-by: Atish Patra <atish.patra@wdc.com>
+Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/riscv/include/asm/sbi.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/riscv/include/asm/sbi.h
++++ b/arch/riscv/include/asm/sbi.h
+@@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid {
+       SBI_EXT_RFENCE_REMOTE_FENCE_I = 0,
+       SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
+       SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
+-      SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
+       SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,
+-      SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
++      SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
+       SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,
++      SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
+ };
+ enum sbi_ext_hsm_fid {
diff --git a/queue-5.10/scsi-lpfc-fix-some-error-codes-in-debugfs.patch b/queue-5.10/scsi-lpfc-fix-some-error-codes-in-debugfs.patch
new file mode 100644 (file)
index 0000000..135e006
--- /dev/null
@@ -0,0 +1,41 @@
+From 19f1bc7edf0f97186810e13a88f5b62069d89097 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Fri, 12 Mar 2021 10:42:11 +0300
+Subject: scsi: lpfc: Fix some error codes in debugfs
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 19f1bc7edf0f97186810e13a88f5b62069d89097 upstream.
+
+If copy_from_user() or kstrtoull() fail then the correct behavior is to
+return a negative error code.
+
+Link: https://lore.kernel.org/r/YEsbU/UxYypVrC7/@mwanda
+Fixes: f9bb2da11db8 ("[SCSI] lpfc 8.3.27: T10 additions for SLI4")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/lpfc/lpfc_debugfs.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/lpfc/lpfc_debugfs.c
++++ b/drivers/scsi/lpfc/lpfc_debugfs.c
+@@ -2423,7 +2423,7 @@ lpfc_debugfs_dif_err_write(struct file *
+       memset(dstbuf, 0, 33);
+       size = (nbytes < 32) ? nbytes : 32;
+       if (copy_from_user(dstbuf, buf, size))
+-              return 0;
++              return -EFAULT;
+       if (dent == phba->debug_InjErrLBA) {
+               if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') &&
+@@ -2432,7 +2432,7 @@ lpfc_debugfs_dif_err_write(struct file *
+       }
+       if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp)))
+-              return 0;
++              return -EINVAL;
+       if (dent == phba->debug_writeGuard)
+               phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp;
diff --git a/queue-5.10/scsi-myrs-fix-a-double-free-in-myrs_cleanup.patch b/queue-5.10/scsi-myrs-fix-a-double-free-in-myrs_cleanup.patch
new file mode 100644 (file)
index 0000000..50cf7e7
--- /dev/null
@@ -0,0 +1,37 @@
+From 2bb817712e2f77486d6ee17e7efaf91997a685f8 Mon Sep 17 00:00:00 2001
+From: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
+Date: Wed, 10 Mar 2021 22:30:05 -0800
+Subject: scsi: myrs: Fix a double free in myrs_cleanup()
+
+From: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
+
+commit 2bb817712e2f77486d6ee17e7efaf91997a685f8 upstream.
+
+In myrs_cleanup(), cs->mmio_base will be freed twice by iounmap().
+
+Link: https://lore.kernel.org/r/20210311063005.9963-1-lyl2019@mail.ustc.edu.cn
+Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
+Reviewed-by: Hannes Reinecke <hare@suse.de>
+Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/myrs.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/scsi/myrs.c
++++ b/drivers/scsi/myrs.c
+@@ -2274,12 +2274,12 @@ static void myrs_cleanup(struct myrs_hba
+       if (cs->mmio_base) {
+               cs->disable_intr(cs);
+               iounmap(cs->mmio_base);
++              cs->mmio_base = NULL;
+       }
+       if (cs->irq)
+               free_irq(cs->irq, cs);
+       if (cs->io_addr)
+               release_region(cs->io_addr, 0x80);
+-      iounmap(cs->mmio_base);
+       pci_set_drvdata(pdev, NULL);
+       pci_disable_device(pdev);
+       scsi_host_put(cs->host);
diff --git a/queue-5.10/scsi-ufs-ufs-mediatek-correct-operator.patch b/queue-5.10/scsi-ufs-ufs-mediatek-correct-operator.patch
new file mode 100644 (file)
index 0000000..580b657
--- /dev/null
@@ -0,0 +1,34 @@
+From 0fdc7d5d8f3719950478cca452cf7f0f1355be10 Mon Sep 17 00:00:00 2001
+From: dongjian <dongjian@yulong.com>
+Date: Tue, 16 Mar 2021 20:15:15 +0800
+Subject: scsi: ufs: ufs-mediatek: Correct operator & -> &&
+
+From: dongjian <dongjian@yulong.com>
+
+commit 0fdc7d5d8f3719950478cca452cf7f0f1355be10 upstream.
+
+The "lpm" and "->enabled" are all boolean. We should be using &&
+rather than the bit operator.
+
+Link: https://lore.kernel.org/r/1615896915-148864-1-git-send-email-dj0227@163.com
+Fixes: 488edafb1120 ("scsi: ufs-mediatek: Introduce low-power mode for device power supply")
+Reviewed-by: Avri Altman <avri.altman@wdc.com>
+Signed-off-by: dongjian <dongjian@yulong.com>
+Signed-off-by: Yue Hu <huyue2@yulong.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/ufs/ufs-mediatek.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/scsi/ufs/ufs-mediatek.c
++++ b/drivers/scsi/ufs/ufs-mediatek.c
+@@ -813,7 +813,7 @@ static void ufs_mtk_vreg_set_lpm(struct
+       if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
+               return;
+-      if (lpm & !hba->vreg_info.vcc->enabled)
++      if (lpm && !hba->vreg_info.vcc->enabled)
+               regulator_set_mode(hba->vreg_info.vccq2->reg,
+                                  REGULATOR_MODE_IDLE);
+       else if (!lpm)
index e2d606d78f89476267bcd466a60291cc63372925..7948125d4c292399b7b6f42144e481b7271127d3 100644 (file)
@@ -53,3 +53,7 @@ net-qrtr-fix-__netdev_alloc_skb-call.patch
 kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch
 cifs-fix-allocation-size-on-newly-created-files.patch
 riscv-correct-sparsemem-configuration.patch
+scsi-lpfc-fix-some-error-codes-in-debugfs.patch
+scsi-myrs-fix-a-double-free-in-myrs_cleanup.patch
+scsi-ufs-ufs-mediatek-correct-operator.patch
+risc-v-correct-enum-sbi_ext_rfence_fid.patch