From: Greg Kroah-Hartman Date: Mon, 19 Mar 2018 17:11:20 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.15.12~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ded4e7003d5ba9c84154ae532e09dd2c7afa2542;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: scsi-qla2xxx-fix-extraneous-ref-on-sp-s-after-adapter-break.patch usb-dwc3-fix-gdbgfifospace_type-values.patch usb-gadget-bdc-64-bit-pointer-capability-check.patch usb-gadget-udc-add-missing-platform_device_put-on-error-in-bdc_pci_probe.patch --- diff --git a/queue-4.9/scsi-qla2xxx-fix-extraneous-ref-on-sp-s-after-adapter-break.patch b/queue-4.9/scsi-qla2xxx-fix-extraneous-ref-on-sp-s-after-adapter-break.patch new file mode 100644 index 00000000000..507bd7915fb --- /dev/null +++ b/queue-4.9/scsi-qla2xxx-fix-extraneous-ref-on-sp-s-after-adapter-break.patch @@ -0,0 +1,50 @@ +From 4cd3b6ebff8510b2139d64024411207090cfe0a9 Mon Sep 17 00:00:00 2001 +From: Bill Kuzeja +Date: Thu, 25 May 2017 15:26:31 -0400 +Subject: scsi: qla2xxx: Fix extraneous ref on sp's after adapter break + +From: Bill Kuzeja + +commit 4cd3b6ebff8510b2139d64024411207090cfe0a9 upstream. + +Hung task timeouts can result if a qlogic board breaks unexpectedly +while running I/O. These tasks become hung because command srb reference +counts are not going to zero, hence the affected srbs and commands do +not get freed. This fix accounts for this extra reference in the srbs in +the case of a board failure. + +Fixes: a465537ad1a4 ("qla2xxx: Disable the adapter and skip error recovery in case of register disconnect") +Signed-off-by: Bill Kuzeja +Acked-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/qla2xxx/qla_os.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -1443,7 +1443,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha) + void + qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) + { +- int que, cnt; ++ int que, cnt, status; + unsigned long flags; + srb_t *sp; + struct qla_hw_data *ha = vha->hw; +@@ -1473,8 +1473,12 @@ qla2x00_abort_all_cmds(scsi_qla_host_t * + */ + sp_get(sp); + spin_unlock_irqrestore(&ha->hardware_lock, flags); +- qla2xxx_eh_abort(GET_CMD_SP(sp)); ++ status = qla2xxx_eh_abort(GET_CMD_SP(sp)); + spin_lock_irqsave(&ha->hardware_lock, flags); ++ /* Get rid of extra reference if immediate exit ++ * from ql2xxx_eh_abort */ ++ if (status == FAILED && (qla2x00_isp_reg_stat(ha))) ++ atomic_dec(&sp->ref_count); + } + req->outstanding_cmds[cnt] = NULL; + sp->done(vha, sp, res); diff --git a/queue-4.9/series b/queue-4.9/series index acaa716bf94..a535dba6ddc 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -235,3 +235,7 @@ scsi-sg-fix-static-checker-warning-in-sg_is_valid_dxfer.patch scsi-sg-only-check-for-dxfer_len-greater-than-256m.patch btrfs-alloc_chunk-fix-dup-stripe-size-handling.patch btrfs-fix-use-after-free-when-cleaning-up-fs_devs-with-a-single-stale-device.patch +scsi-qla2xxx-fix-extraneous-ref-on-sp-s-after-adapter-break.patch +usb-gadget-udc-add-missing-platform_device_put-on-error-in-bdc_pci_probe.patch +usb-dwc3-fix-gdbgfifospace_type-values.patch +usb-gadget-bdc-64-bit-pointer-capability-check.patch diff --git a/queue-4.9/usb-dwc3-fix-gdbgfifospace_type-values.patch b/queue-4.9/usb-dwc3-fix-gdbgfifospace_type-values.patch new file mode 100644 index 00000000000..4d63a532821 --- /dev/null +++ b/queue-4.9/usb-dwc3-fix-gdbgfifospace_type-values.patch @@ -0,0 +1,48 @@ +From b16ea8b9492e99e03b1269fe93ebdbf8e4eabf8a Mon Sep 17 00:00:00 2001 +From: Thinh Nguyen +Date: Fri, 2 Feb 2018 13:21:35 -0800 +Subject: usb: dwc3: Fix GDBGFIFOSPACE_TYPE values + +From: Thinh Nguyen + +commit b16ea8b9492e99e03b1269fe93ebdbf8e4eabf8a upstream. + +The FIFO/Queue type values are incorrect. Correct them according to +DWC_usb3 programming guide section 1.2.27 (or DWC_usb31 section 1.2.25). + +Additionally, this patch includes ProtocolStatusQ and AuxEventQ types. + +Fixes: cf6d867d3b57 ("usb: dwc3: core: add fifo space helper") +Signed-off-by: Thinh Nguyen +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/core.h | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -159,13 +159,15 @@ + #define DWC3_GDBGFIFOSPACE_TYPE(n) (((n) << 5) & 0x1e0) + #define DWC3_GDBGFIFOSPACE_SPACE_AVAILABLE(n) (((n) >> 16) & 0xffff) + +-#define DWC3_TXFIFOQ 1 +-#define DWC3_RXFIFOQ 3 +-#define DWC3_TXREQQ 5 +-#define DWC3_RXREQQ 7 +-#define DWC3_RXINFOQ 9 +-#define DWC3_DESCFETCHQ 13 +-#define DWC3_EVENTQ 15 ++#define DWC3_TXFIFOQ 0 ++#define DWC3_RXFIFOQ 1 ++#define DWC3_TXREQQ 2 ++#define DWC3_RXREQQ 3 ++#define DWC3_RXINFOQ 4 ++#define DWC3_PSTATQ 5 ++#define DWC3_DESCFETCHQ 6 ++#define DWC3_EVENTQ 7 ++#define DWC3_AUXEVENTQ 8 + + /* Global RX Threshold Configuration Register */ + #define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 19) diff --git a/queue-4.9/usb-gadget-bdc-64-bit-pointer-capability-check.patch b/queue-4.9/usb-gadget-bdc-64-bit-pointer-capability-check.patch new file mode 100644 index 00000000000..e5bbad8d064 --- /dev/null +++ b/queue-4.9/usb-gadget-bdc-64-bit-pointer-capability-check.patch @@ -0,0 +1,37 @@ +From c8e4e5bdb62a5ac6f860ebcaaf7b467b62f453f1 Mon Sep 17 00:00:00 2001 +From: Srinath Mannam +Date: Thu, 15 Jun 2017 14:39:22 +0530 +Subject: usb: gadget: bdc: 64-bit pointer capability check + +From: Srinath Mannam + +commit c8e4e5bdb62a5ac6f860ebcaaf7b467b62f453f1 upstream. + +Corrected the register to check the 64-bit pointer +capability state. 64-bit pointer implementation capability +was checking in wrong register, which causes the BDC +enumeration failure in 64-bit memory address. + +Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for +Broadcom USB3.0 device controller IP BDC") + +Reviewed-by: Florian Fainelli +Signed-off-by: Srinath Mannam +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/udc/bdc/bdc_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/udc/bdc/bdc_core.c ++++ b/drivers/usb/gadget/udc/bdc/bdc_core.c +@@ -475,7 +475,7 @@ static int bdc_probe(struct platform_dev + bdc->dev = dev; + dev_dbg(bdc->dev, "bdc->regs: %p irq=%d\n", bdc->regs, bdc->irq); + +- temp = bdc_readl(bdc->regs, BDC_BDCSC); ++ temp = bdc_readl(bdc->regs, BDC_BDCCAP1); + if ((temp & BDC_P64) && + !dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) { + dev_dbg(bdc->dev, "Using 64-bit address\n"); diff --git a/queue-4.9/usb-gadget-udc-add-missing-platform_device_put-on-error-in-bdc_pci_probe.patch b/queue-4.9/usb-gadget-udc-add-missing-platform_device_put-on-error-in-bdc_pci_probe.patch new file mode 100644 index 00000000000..ff48129c36a --- /dev/null +++ b/queue-4.9/usb-gadget-udc-add-missing-platform_device_put-on-error-in-bdc_pci_probe.patch @@ -0,0 +1,31 @@ +From 8874ae5f15f3feef3b4a415b9aed51edcf449aa1 Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Tue, 23 Jan 2018 09:35:14 +0000 +Subject: USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe() + +From: Wei Yongjun + +commit 8874ae5f15f3feef3b4a415b9aed51edcf449aa1 upstream. + +Add the missing platform_device_put() before return from bdc_pci_probe() +in the platform_device_add_resources() error handling case. + +Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") +Signed-off-by: Wei Yongjun +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/udc/bdc/bdc_pci.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/gadget/udc/bdc/bdc_pci.c ++++ b/drivers/usb/gadget/udc/bdc/bdc_pci.c +@@ -82,6 +82,7 @@ static int bdc_pci_probe(struct pci_dev + if (ret) { + dev_err(&pci->dev, + "couldn't add resources to bdc device\n"); ++ platform_device_put(bdc); + return ret; + } +