From: Sasha Levin Date: Mon, 24 Jun 2019 00:33:19 +0000 (-0400) Subject: fixes for 4.19 X-Git-Tag: v5.1.15~17^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17d1857f13225cdf48e2e0785c080a2dd1efd1a5;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/arc-fix-build-warnings.patch b/queue-4.19/arc-fix-build-warnings.patch new file mode 100644 index 00000000000..533d671b3f6 --- /dev/null +++ b/queue-4.19/arc-fix-build-warnings.patch @@ -0,0 +1,99 @@ +From 76fd388b617f229b83595e16a80d28fa1c0a091a Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Tue, 7 May 2019 10:45:24 -0700 +Subject: ARC: fix build warnings + +[ Upstream commit 89c92142f75eb80064f5b9f1111484b1b4d81790 ] + +| arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] +| arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] + +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/include/asm/cmpxchg.h | 14 ++++++++++---- + arch/arc/mm/tlb.c | 13 ++++++++----- + 2 files changed, 18 insertions(+), 9 deletions(-) + +diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h +index d819de1c5d10..3ea4112c8302 100644 +--- a/arch/arc/include/asm/cmpxchg.h ++++ b/arch/arc/include/asm/cmpxchg.h +@@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new) + + #endif /* CONFIG_ARC_HAS_LLSC */ + +-#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \ +- (unsigned long)(o), (unsigned long)(n))) ++#define cmpxchg(ptr, o, n) ({ \ ++ (typeof(*(ptr)))__cmpxchg((ptr), \ ++ (unsigned long)(o), \ ++ (unsigned long)(n)); \ ++}) + + /* + * atomic_cmpxchg is same as cmpxchg +@@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr, + return __xchg_bad_pointer(); + } + +-#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \ +- sizeof(*(ptr)))) ++#define xchg(ptr, with) ({ \ ++ (typeof(*(ptr)))__xchg((unsigned long)(with), \ ++ (ptr), \ ++ sizeof(*(ptr))); \ ++}) + + #endif /* CONFIG_ARC_PLAT_EZNPS */ + +diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c +index 4097764fea23..fa18c00b0cfd 100644 +--- a/arch/arc/mm/tlb.c ++++ b/arch/arc/mm/tlb.c +@@ -911,9 +911,11 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + struct pt_regs *regs) + { + struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; +- unsigned int pd0[mmu->ways]; + unsigned long flags; +- int set; ++ int set, n_ways = mmu->ways; ++ ++ n_ways = min(n_ways, 4); ++ BUG_ON(mmu->ways > 4); + + local_irq_save(flags); + +@@ -921,9 +923,10 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + for (set = 0; set < mmu->sets; set++) { + + int is_valid, way; ++ unsigned int pd0[4]; + + /* read out all the ways of current set */ +- for (way = 0, is_valid = 0; way < mmu->ways; way++) { ++ for (way = 0, is_valid = 0; way < n_ways; way++) { + write_aux_reg(ARC_REG_TLBINDEX, + SET_WAY_TO_IDX(mmu, set, way)); + write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead); +@@ -937,14 +940,14 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + continue; + + /* Scan the set for duplicate ways: needs a nested loop */ +- for (way = 0; way < mmu->ways - 1; way++) { ++ for (way = 0; way < n_ways - 1; way++) { + + int n; + + if (!pd0[way]) + continue; + +- for (n = way + 1; n < mmu->ways; n++) { ++ for (n = way + 1; n < n_ways; n++) { + if (pd0[way] != pd0[n]) + continue; + +-- +2.20.1 + diff --git a/queue-4.19/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch b/queue-4.19/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch new file mode 100644 index 00000000000..31e33226f3d --- /dev/null +++ b/queue-4.19/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch @@ -0,0 +1,39 @@ +From f26a18617037e802b90cdd84bbd013e72119c385 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Mon, 20 May 2019 15:43:13 +0200 +Subject: ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node + +[ Upstream commit 4c70850aeb2e40016722cd1abd43c679666d3ca0 ] + +Add the binding for RX/TX fifo size of GMAC node. + +Cc: Joao Pinto +Cc: Rob Herring +Cc: Mark Rutland +Cc: Vineet Gupta +Tested-by: Eugeniy Paltsev +Acked-by: Alexey Brodkin +Signed-off-by: Jose Abreu +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/boot/dts/hsdk.dts | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts +index f67f614ccb0e..d131c54acd3e 100644 +--- a/arch/arc/boot/dts/hsdk.dts ++++ b/arch/arc/boot/dts/hsdk.dts +@@ -184,6 +184,9 @@ + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ + dma-coherent; + ++ tx-fifo-depth = <4096>; ++ rx-fifo-depth = <4096>; ++ + mdio { + #address-cells = <1>; + #size-cells = <0>; +-- +2.20.1 + diff --git a/queue-4.19/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch b/queue-4.19/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch new file mode 100644 index 00000000000..6cb00f6a645 --- /dev/null +++ b/queue-4.19/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch @@ -0,0 +1,39 @@ +From 924640e5e2712f7f2ee9a00b2f816dcbc2a5bc50 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Mon, 20 May 2019 15:43:12 +0200 +Subject: ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC + node + +[ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ] + +GMAC controller on HSDK boards supports 256 Hash Table size so we need to +add the multicast filter bins property. This allows for the Hash filter +to work properly using stmmac driver. + +Cc: Joao Pinto +Cc: Rob Herring +Cc: Mark Rutland +Cc: Eugeniy Paltsev +Acked-by: Alexey Brodkin +Signed-off-by: Jose Abreu +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/boot/dts/hsdk.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts +index ef149f59929a..f67f614ccb0e 100644 +--- a/arch/arc/boot/dts/hsdk.dts ++++ b/arch/arc/boot/dts/hsdk.dts +@@ -175,6 +175,7 @@ + interrupt-names = "macirq"; + phy-mode = "rgmii"; + snps,pbl = <32>; ++ snps,multicast-filter-bins = <256>; + clocks = <&gmacclk>; + clock-names = "stmmaceth"; + phy-handle = <&phy0>; +-- +2.20.1 + diff --git a/queue-4.19/arm64-silence-gcc-warnings-about-arch-abi-drift.patch b/queue-4.19/arm64-silence-gcc-warnings-about-arch-abi-drift.patch new file mode 100644 index 00000000000..582cf5d2d40 --- /dev/null +++ b/queue-4.19/arm64-silence-gcc-warnings-about-arch-abi-drift.patch @@ -0,0 +1,46 @@ +From a45502ee0e7c8417dcd8d57fecc279abf4e9cedb Mon Sep 17 00:00:00 2001 +From: Dave Martin +Date: Thu, 6 Jun 2019 11:33:43 +0100 +Subject: arm64: Silence gcc warnings about arch ABI drift + +[ Upstream commit ebcc5928c5d925b1c8d968d9c89cdb0d0186db17 ] + +Since GCC 9, the compiler warns about evolution of the +platform-specific ABI, in particular relating for the marshaling of +certain structures involving bitfields. + +The kernel is a standalone binary, and of course nobody would be +so stupid as to expose structs containing bitfields as function +arguments in ABI. (Passing a pointer to such a struct, however +inadvisable, should be unaffected by this change. perf and various +drivers rely on that.) + +So these warnings do more harm than good: turn them off. + +We may miss warnings about future ABI drift, but that's too bad. +Future ABI breaks of this class will have to be debugged and fixed +the traditional way unless the compiler evolves finer-grained +diagnostics. + +Signed-off-by: Dave Martin +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile +index 35649ee8ad56..c12ff63265a9 100644 +--- a/arch/arm64/Makefile ++++ b/arch/arm64/Makefile +@@ -51,6 +51,7 @@ endif + + KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) + KBUILD_CFLAGS += -fno-asynchronous-unwind-tables ++KBUILD_CFLAGS += -Wno-psabi + KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) + + KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) +-- +2.20.1 + diff --git a/queue-4.19/dmaengine-dw-axi-dmac-fix-null-dereference-when-poin.patch b/queue-4.19/dmaengine-dw-axi-dmac-fix-null-dereference-when-poin.patch new file mode 100644 index 00000000000..fecb5210839 --- /dev/null +++ b/queue-4.19/dmaengine-dw-axi-dmac-fix-null-dereference-when-poin.patch @@ -0,0 +1,40 @@ +From 900132521b483b738bd1b55a5b760d8a38bcf274 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Wed, 8 May 2019 23:33:29 +0100 +Subject: dmaengine: dw-axi-dmac: fix null dereference when pointer first is + null + +[ Upstream commit 0788611c9a0925c607de536b2449de5ed98ef8df ] + +In the unlikely event that axi_desc_get returns a null desc in the +very first iteration of the while-loop the error exit path ends +up calling axi_desc_put on a null pointer 'first' and this causes +a null pointer dereference. Fix this by adding a null check on +pointer 'first' before calling axi_desc_put. + +Addresses-Coverity: ("Explicit null dereference") +Fixes: 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver") +Signed-off-by: Colin Ian King +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +index c4eb55e3011c..c05ef7f1d7b6 100644 +--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c ++++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +@@ -512,7 +512,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan *dchan, dma_addr_t dst_adr, + return vchan_tx_prep(&chan->vc, &first->vd, flags); + + err_desc_get: +- axi_desc_put(first); ++ if (first) ++ axi_desc_put(first); + return NULL; + } + +-- +2.20.1 + diff --git a/queue-4.19/dmaengine-sprd-fix-block-length-overflow.patch b/queue-4.19/dmaengine-sprd-fix-block-length-overflow.patch new file mode 100644 index 00000000000..8af5dc93b20 --- /dev/null +++ b/queue-4.19/dmaengine-sprd-fix-block-length-overflow.patch @@ -0,0 +1,38 @@ +From 12781d819224f6ef6af69ad5462b2591cd5cbcd7 Mon Sep 17 00:00:00 2001 +From: Eric Long +Date: Mon, 6 May 2019 15:28:31 +0800 +Subject: dmaengine: sprd: Fix block length overflow + +[ Upstream commit 89d03b3c126d683f7b2cd5b07178493993d12448 ] + +The maximum value of block length is 0xffff, so if the configured transfer length +is more than 0xffff, that will cause block length overflow to lead a configuration +error. + +Thus we can set block length as the maximum burst length to avoid this issue, since +the maximum burst length will not be a big value which is more than 0xffff. + +Signed-off-by: Eric Long +Signed-off-by: Baolin Wang +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/sprd-dma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c +index 55df0d41355b..1ed1c7efa288 100644 +--- a/drivers/dma/sprd-dma.c ++++ b/drivers/dma/sprd-dma.c +@@ -663,7 +663,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, + temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK; + hw->frg_len = temp; + +- hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK; ++ hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK; + hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK; + + temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET; +-- +2.20.1 + diff --git a/queue-4.19/drm-arm-hdlcd-actually-validate-crtc-modes.patch b/queue-4.19/drm-arm-hdlcd-actually-validate-crtc-modes.patch new file mode 100644 index 00000000000..8d3582b2c0e --- /dev/null +++ b/queue-4.19/drm-arm-hdlcd-actually-validate-crtc-modes.patch @@ -0,0 +1,63 @@ +From a9ee64c271b81f53864f21495e5f297518a537ed Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Fri, 17 May 2019 17:37:21 +0100 +Subject: drm/arm/hdlcd: Actually validate CRTC modes + +[ Upstream commit b96151edced4edb6a18aa89a5fa02c7066efff45 ] + +Rather than allowing any old mode through, then subsequently refusing +unmatchable clock rates in atomic_check when it's too late to back out +and pick a different mode, let's do that validation up-front where it +will cause unsupported modes to be correctly pruned in the first place. + +This also eliminates an issue whereby a perceived clock rate of 0 would +cause atomic disable to fail and prevent the module from being unloaded. + +Signed-off-by: Robin Murphy +Signed-off-by: Liviu Dudau +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/hdlcd_crtc.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c +index e4d67b70244d..d5c1a0b1f01a 100644 +--- a/drivers/gpu/drm/arm/hdlcd_crtc.c ++++ b/drivers/gpu/drm/arm/hdlcd_crtc.c +@@ -186,20 +186,19 @@ static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc, + clk_disable_unprepare(hdlcd->clk); + } + +-static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, +- struct drm_crtc_state *state) ++static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, ++ const struct drm_display_mode *mode) + { + struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); +- struct drm_display_mode *mode = &state->adjusted_mode; + long rate, clk_rate = mode->clock * 1000; + + rate = clk_round_rate(hdlcd->clk, clk_rate); + if (rate != clk_rate) { + /* clock required by mode not supported by hardware */ +- return -EINVAL; ++ return MODE_NOCLOCK; + } + +- return 0; ++ return MODE_OK; + } + + static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, +@@ -220,7 +219,7 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, + } + + static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { +- .atomic_check = hdlcd_crtc_atomic_check, ++ .mode_valid = hdlcd_crtc_mode_valid, + .atomic_begin = hdlcd_crtc_atomic_begin, + .atomic_enable = hdlcd_crtc_atomic_enable, + .atomic_disable = hdlcd_crtc_atomic_disable, +-- +2.20.1 + diff --git a/queue-4.19/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch b/queue-4.19/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch new file mode 100644 index 00000000000..f00c21c7cbf --- /dev/null +++ b/queue-4.19/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch @@ -0,0 +1,39 @@ +From cfeb8cbe4b0c0332c4498bf76ff1f3b5a238d0ce Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Fri, 17 May 2019 17:37:22 +0100 +Subject: drm/arm/hdlcd: Allow a bit of clock tolerance + +[ Upstream commit 1c810739097fdeb31b393b67a0a1e3d7ffdd9f63 ] + +On the Arm Juno platform, the HDLCD pixel clock is constrained to 250KHz +resolution in order to avoid the tiny System Control Processor spending +aeons trying to calculate exact PLL coefficients. This means that modes +like my oddball 1600x1200 with 130.89MHz clock get rejected since the +rate cannot be matched exactly. In practice, though, this mode works +quite happily with the clock at 131MHz, so let's relax the check to +allow a little bit of slop. + +Signed-off-by: Robin Murphy +Signed-off-by: Liviu Dudau +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/hdlcd_crtc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c +index d5c1a0b1f01a..e69d996eabad 100644 +--- a/drivers/gpu/drm/arm/hdlcd_crtc.c ++++ b/drivers/gpu/drm/arm/hdlcd_crtc.c +@@ -193,7 +193,8 @@ static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, + long rate, clk_rate = mode->clock * 1000; + + rate = clk_round_rate(hdlcd->clk, clk_rate); +- if (rate != clk_rate) { ++ /* 0.1% seems a close enough tolerance for the TDA19988 on Juno */ ++ if (abs(rate - clk_rate) * 1000 > clk_rate) { + /* clock required by mode not supported by hardware */ + return MODE_NOCLOCK; + } +-- +2.20.1 + diff --git a/queue-4.19/drm-arm-mali-dp-add-a-loop-around-the-second-set-cva.patch b/queue-4.19/drm-arm-mali-dp-add-a-loop-around-the-second-set-cva.patch new file mode 100644 index 00000000000..45f5c3ee448 --- /dev/null +++ b/queue-4.19/drm-arm-mali-dp-add-a-loop-around-the-second-set-cva.patch @@ -0,0 +1,54 @@ +From 70f38a7dc17d3d0e188c74c339890b6e8f9300e7 Mon Sep 17 00:00:00 2001 +From: Wen He +Date: Wed, 8 May 2019 10:58:18 +0000 +Subject: drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 + times + +[ Upstream commit 6a88e0c14813d00f8520d0e16cd4136c6cf8b4d4 ] + +This patch trying to fix monitor freeze issue caused by drm error +'flip_done timed out' on LS1028A platform. this set try is make a loop +around the second setting CVAL and try like 5 times before giveing up. + +Signed-off-by: Wen He +Signed-off-by: Liviu Dudau +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/malidp_drv.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c +index 94d6dabec2dc..1ab511e33243 100644 +--- a/drivers/gpu/drm/arm/malidp_drv.c ++++ b/drivers/gpu/drm/arm/malidp_drv.c +@@ -190,6 +190,7 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) + { + struct drm_device *drm = state->dev; + struct malidp_drm *malidp = drm->dev_private; ++ int loop = 5; + + malidp->event = malidp->crtc.state->event; + malidp->crtc.state->event = NULL; +@@ -204,8 +205,18 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) + drm_crtc_vblank_get(&malidp->crtc); + + /* only set config_valid if the CRTC is enabled */ +- if (malidp_set_and_wait_config_valid(drm) < 0) ++ if (malidp_set_and_wait_config_valid(drm) < 0) { ++ /* ++ * make a loop around the second CVAL setting and ++ * try 5 times before giving up. ++ */ ++ while (loop--) { ++ if (!malidp_set_and_wait_config_valid(drm)) ++ break; ++ } + DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n"); ++ } ++ + } else if (malidp->event) { + /* CRTC inactive means vblank IRQ is disabled, send event directly */ + spin_lock_irq(&drm->event_lock); +-- +2.20.1 + diff --git a/queue-4.19/fpga-dfl-add-lockdep-classes-for-pdata-lock.patch b/queue-4.19/fpga-dfl-add-lockdep-classes-for-pdata-lock.patch new file mode 100644 index 00000000000..a1e86351da8 --- /dev/null +++ b/queue-4.19/fpga-dfl-add-lockdep-classes-for-pdata-lock.patch @@ -0,0 +1,139 @@ +From 2b317186bfc96c9183e3cbde1589186b46cad0a1 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Thu, 9 May 2019 16:08:28 -0500 +Subject: fpga: dfl: Add lockdep classes for pdata->lock + +[ Upstream commit dfe3de8d397bf878b31864d4e489d41118ec475f ] + +struct dfl_feature_platform_data (and it's mutex) is used +by both fme and port devices, and when lockdep is enabled it +complains about nesting between these locks. Tell lockdep about +the difference so it can track each class separately. + +Here's the lockdep complaint: +[ 409.680668] WARNING: possible recursive locking detected +[ 409.685983] 5.1.0-rc3.fpga+ #1 Tainted: G E +[ 409.691469] -------------------------------------------- +[ 409.696779] fpgaconf/9348 is trying to acquire lock: +[ 409.701746] 00000000a443fe2e (&pdata->lock){+.+.}, at: port_enable_set+0x24/0x60 [dfl_afu] +[ 409.710006] +[ 409.710006] but task is already holding lock: +[ 409.715837] 0000000063b78782 (&pdata->lock){+.+.}, at: fme_pr_ioctl+0x21d/0x330 [dfl_fme] +[ 409.724012] +[ 409.724012] other info that might help us debug this: +[ 409.730535] Possible unsafe locking scenario: +[ 409.730535] +[ 409.736457] CPU0 +[ 409.738910] ---- +[ 409.741360] lock(&pdata->lock); +[ 409.744679] lock(&pdata->lock); +[ 409.747999] +[ 409.747999] *** DEADLOCK *** +[ 409.747999] +[ 409.753920] May be due to missing lock nesting notation +[ 409.753920] +[ 409.760704] 4 locks held by fpgaconf/9348: +[ 409.764805] #0: 0000000063b78782 (&pdata->lock){+.+.}, at: fme_pr_ioctl+0x21d/0x330 [dfl_fme] +[ 409.773408] #1: 00000000213c8a66 (®ion->mutex){+.+.}, at: fpga_region_program_fpga+0x24/0x200 [fpga_region] +[ 409.783489] #2: 00000000fe63afb9 (&mgr->ref_mutex){+.+.}, at: fpga_mgr_lock+0x15/0x40 [fpga_mgr] +[ 409.792354] #3: 000000000b2285c5 (&bridge->mutex){+.+.}, at: __fpga_bridge_get+0x26/0xa0 [fpga_bridge] +[ 409.801740] +[ 409.801740] stack backtrace: +[ 409.806102] CPU: 45 PID: 9348 Comm: fpgaconf Kdump: loaded Tainted: G E 5.1.0-rc3.fpga+ #1 +[ 409.815658] Hardware name: Intel Corporation S2600BT/S2600BT, BIOS SE5C620.86B.01.00.0763.022420181017 02/24/2018 +[ 409.825911] Call Trace: +[ 409.828369] dump_stack+0x5e/0x8b +[ 409.831686] __lock_acquire+0xf3d/0x10e0 +[ 409.835612] ? find_held_lock+0x3c/0xa0 +[ 409.839451] lock_acquire+0xbc/0x1d0 +[ 409.843030] ? port_enable_set+0x24/0x60 [dfl_afu] +[ 409.847823] ? port_enable_set+0x24/0x60 [dfl_afu] +[ 409.852616] __mutex_lock+0x86/0x970 +[ 409.856195] ? port_enable_set+0x24/0x60 [dfl_afu] +[ 409.860989] ? port_enable_set+0x24/0x60 [dfl_afu] +[ 409.865777] ? __mutex_unlock_slowpath+0x4b/0x290 +[ 409.870486] port_enable_set+0x24/0x60 [dfl_afu] +[ 409.875106] fpga_bridges_disable+0x36/0x50 [fpga_bridge] +[ 409.880502] fpga_region_program_fpga+0xea/0x200 [fpga_region] +[ 409.886338] fme_pr_ioctl+0x13e/0x330 [dfl_fme] +[ 409.890870] fme_ioctl+0x66/0xe0 [dfl_fme] +[ 409.894973] do_vfs_ioctl+0xa9/0x720 +[ 409.898548] ? lockdep_hardirqs_on+0xf0/0x1a0 +[ 409.902907] ksys_ioctl+0x60/0x90 +[ 409.906225] __x64_sys_ioctl+0x16/0x20 +[ 409.909981] do_syscall_64+0x5a/0x220 +[ 409.913644] entry_SYSCALL_64_after_hwframe+0x49/0xbe +[ 409.918698] RIP: 0033:0x7f9d31b9b8d7 +[ 409.922276] Code: 44 00 00 48 8b 05 b9 15 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 89 15 2d 00 f7 d8 64 89 01 48 +[ 409.941020] RSP: 002b:00007ffe4cae0d68 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 +[ 409.948588] RAX: ffffffffffffffda RBX: 00007f9d32ade6a0 RCX: 00007f9d31b9b8d7 +[ 409.955719] RDX: 00007ffe4cae0df0 RSI: 000000000000b680 RDI: 0000000000000003 +[ 409.962852] RBP: 0000000000000003 R08: 00007f9d2b70a177 R09: 00007ffe4cae0e40 +[ 409.969984] R10: 00007ffe4cae0160 R11: 0000000000000202 R12: 00007ffe4cae0df0 +[ 409.977115] R13: 000000000000b680 R14: 0000000000000000 R15: 00007ffe4cae0f60 + +Signed-off-by: Scott Wood +Acked-by: Wu Hao +Acked-by: Alan Tull +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/fpga/dfl.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c +index a9b521bccb06..ab361ec78df4 100644 +--- a/drivers/fpga/dfl.c ++++ b/drivers/fpga/dfl.c +@@ -40,6 +40,13 @@ enum dfl_fpga_devt_type { + DFL_FPGA_DEVT_MAX, + }; + ++static struct lock_class_key dfl_pdata_keys[DFL_ID_MAX]; ++ ++static const char *dfl_pdata_key_strings[DFL_ID_MAX] = { ++ "dfl-fme-pdata", ++ "dfl-port-pdata", ++}; ++ + /** + * dfl_dev_info - dfl feature device information. + * @name: name string of the feature platform device. +@@ -443,11 +450,16 @@ static int build_info_commit_dev(struct build_feature_devs_info *binfo) + struct platform_device *fdev = binfo->feature_dev; + struct dfl_feature_platform_data *pdata; + struct dfl_feature_info *finfo, *p; ++ enum dfl_id_type type; + int ret, index = 0; + + if (!fdev) + return 0; + ++ type = feature_dev_id_type(fdev); ++ if (WARN_ON_ONCE(type >= DFL_ID_MAX)) ++ return -EINVAL; ++ + /* + * we do not need to care for the memory which is associated with + * the platform device. After calling platform_device_unregister(), +@@ -463,6 +475,8 @@ static int build_info_commit_dev(struct build_feature_devs_info *binfo) + pdata->num = binfo->feature_num; + pdata->dfl_cdev = binfo->cdev; + mutex_init(&pdata->lock); ++ lockdep_set_class_and_name(&pdata->lock, &dfl_pdata_keys[type], ++ dfl_pdata_key_strings[type]); + + /* + * the count should be initialized to 0 to make sure +@@ -497,7 +511,7 @@ static int build_info_commit_dev(struct build_feature_devs_info *binfo) + + ret = platform_device_add(binfo->feature_dev); + if (!ret) { +- if (feature_dev_id_type(binfo->feature_dev) == PORT_ID) ++ if (type == PORT_ID) + dfl_fpga_cdev_add_port_dev(binfo->cdev, + binfo->feature_dev); + else +-- +2.20.1 + diff --git a/queue-4.19/fpga-dfl-afu-pass-the-correct-device-to-dma_mapping_.patch b/queue-4.19/fpga-dfl-afu-pass-the-correct-device-to-dma_mapping_.patch new file mode 100644 index 00000000000..0c0981860e9 --- /dev/null +++ b/queue-4.19/fpga-dfl-afu-pass-the-correct-device-to-dma_mapping_.patch @@ -0,0 +1,37 @@ +From 99cc3c69699fcb34df10b70e15d312ef2526f5b6 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Thu, 9 May 2019 16:08:27 -0500 +Subject: fpga: dfl: afu: Pass the correct device to dma_mapping_error() + +[ Upstream commit 13069847a475b60069918dc9971f5adb42811ce3 ] + +dma_mapping_error() was being called on a different device struct than +what was passed to map/unmap. Besides rendering the error checking +ineffective, it caused a debug splat with CONFIG_DMA_API_DEBUG. + +Signed-off-by: Scott Wood +Acked-by: Wu Hao +Acked-by: Moritz Fischer +Acked-by: Alan Tull +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/fpga/dfl-afu-dma-region.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c +index 0e81d33af856..c9a613dc9eb7 100644 +--- a/drivers/fpga/dfl-afu-dma-region.c ++++ b/drivers/fpga/dfl-afu-dma-region.c +@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, + region->pages[0], 0, + region->length, + DMA_BIDIRECTIONAL); +- if (dma_mapping_error(&pdata->dev->dev, region->iova)) { ++ if (dma_mapping_error(dfl_fpga_pdata_to_parent(pdata), region->iova)) { + dev_err(&pdata->dev->dev, "failed to map for dma\n"); + ret = -EFAULT; + goto unpin_pages; +-- +2.20.1 + diff --git a/queue-4.19/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch b/queue-4.19/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch new file mode 100644 index 00000000000..6aed48af885 --- /dev/null +++ b/queue-4.19/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch @@ -0,0 +1,62 @@ +From 62b96284e7cb2d5fcf256da9b1ee4a63b52c72d3 Mon Sep 17 00:00:00 2001 +From: Eduardo Valentin +Date: Wed, 29 May 2019 19:56:04 -0700 +Subject: hwmon: (core) add thermal sensors only if dev->of_node is present + +[ Upstream commit c41dd48e21fae3e55b3670ccf2eb562fc1f6a67d ] + +Drivers may register to hwmon and request for also registering +with the thermal subsystem (HWMON_C_REGISTER_TZ). However, +some of these driver, e.g. marvell phy, may be probed from +Device Tree or being dynamically allocated, and in the later +case, it will not have a dev->of_node entry. + +Registering with hwmon without the dev->of_node may result in +different outcomes depending on the device tree, which may +be a bit misleading. If the device tree blob has no 'thermal-zones' +node, the *hwmon_device_register*() family functions are going +to gracefully succeed, because of-thermal, +*thermal_zone_of_sensor_register() return -ENODEV in this case, +and the hwmon error path handles this error code as success to +cover for the case where CONFIG_THERMAL_OF is not set. +However, if the device tree blob has the 'thermal-zones' +entry, the *hwmon_device_register*() will always fail on callers +with no dev->of_node, propagating -EINVAL. + +If dev->of_node is not present, calling of-thermal does not +make sense. For this reason, this patch checks first if the +device has a of_node before going over the process of registering +with the thermal subsystem of-thermal interface. And in this case, +when a caller of *hwmon_device_register*() with HWMON_C_REGISTER_TZ +and no dev->of_node will still register with hwmon, but not with +the thermal subsystem. If all the hwmon part bits are in place, +the registration will succeed. + +Fixes: d560168b5d0f ("hwmon: (core) New hwmon registration API") +Cc: Jean Delvare +Cc: Guenter Roeck +Cc: linux-hwmon@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Eduardo Valentin +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/hwmon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c +index fcdbac4a56e3..6b3559f58b67 100644 +--- a/drivers/hwmon/hwmon.c ++++ b/drivers/hwmon/hwmon.c +@@ -619,7 +619,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, + if (err) + goto free_hwmon; + +- if (dev && chip && chip->ops->read && ++ if (dev && dev->of_node && chip && chip->ops->read && + chip->info[0]->type == hwmon_chip && + (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { + const struct hwmon_channel_info **info = chip->info; +-- +2.20.1 + diff --git a/queue-4.19/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch b/queue-4.19/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch new file mode 100644 index 00000000000..e86360c3def --- /dev/null +++ b/queue-4.19/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch @@ -0,0 +1,101 @@ +From eb0aaacbf621972ec65fe852c466f3fe0f73b213 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Wed, 5 Jun 2019 13:49:00 -0600 +Subject: hwmon: (pmbus/core) Treat parameters as paged if on multiple pages + +[ Upstream commit 4a60570dce658e3f8885bbcf852430b99f65aca5 ] + +Some chips have attributes which exist on more than one page but the +attribute is not presently marked as paged. This causes the attributes +to be generated with the same label, which makes it impossible for +userspace to tell them apart. + +Marking all such attributes as paged would result in the page suffix +being added regardless of whether they were present on more than one +page or not, which might break existing setups. Therefore, we add a +second check which treats the attribute as paged, even if not marked as +such, if it is present on multiple pages. + +Fixes: b4ce237b7f7d ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers") +Signed-off-by: Robert Hancock +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/pmbus/pmbus_core.c | 34 ++++++++++++++++++++++++++++---- + 1 file changed, 30 insertions(+), 4 deletions(-) + +diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c +index 2e2b5851139c..cd24b375df1e 100644 +--- a/drivers/hwmon/pmbus/pmbus_core.c ++++ b/drivers/hwmon/pmbus/pmbus_core.c +@@ -1230,7 +1230,8 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + const struct pmbus_driver_info *info, + const char *name, + int index, int page, +- const struct pmbus_sensor_attr *attr) ++ const struct pmbus_sensor_attr *attr, ++ bool paged) + { + struct pmbus_sensor *base; + bool upper = !!(attr->gbit & 0xff00); /* need to check STATUS_WORD */ +@@ -1238,7 +1239,7 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + + if (attr->label) { + ret = pmbus_add_label(data, name, index, attr->label, +- attr->paged ? page + 1 : 0); ++ paged ? page + 1 : 0); + if (ret) + return ret; + } +@@ -1271,6 +1272,30 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + return 0; + } + ++static bool pmbus_sensor_is_paged(const struct pmbus_driver_info *info, ++ const struct pmbus_sensor_attr *attr) ++{ ++ int p; ++ ++ if (attr->paged) ++ return true; ++ ++ /* ++ * Some attributes may be present on more than one page despite ++ * not being marked with the paged attribute. If that is the case, ++ * then treat the sensor as being paged and add the page suffix to the ++ * attribute name. ++ * We don't just add the paged attribute to all such attributes, in ++ * order to maintain the un-suffixed labels in the case where the ++ * attribute is only on page 0. ++ */ ++ for (p = 1; p < info->pages; p++) { ++ if (info->func[p] & attr->func) ++ return true; ++ } ++ return false; ++} ++ + static int pmbus_add_sensor_attrs(struct i2c_client *client, + struct pmbus_data *data, + const char *name, +@@ -1284,14 +1309,15 @@ static int pmbus_add_sensor_attrs(struct i2c_client *client, + index = 1; + for (i = 0; i < nattrs; i++) { + int page, pages; ++ bool paged = pmbus_sensor_is_paged(info, attrs); + +- pages = attrs->paged ? info->pages : 1; ++ pages = paged ? info->pages : 1; + for (page = 0; page < pages; page++) { + if (!(info->func[page] & attrs->func)) + continue; + ret = pmbus_add_sensor_attrs_one(client, data, info, + name, index, page, +- attrs); ++ attrs, paged); + if (ret) + return ret; + index++; +-- +2.20.1 + diff --git a/queue-4.19/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch b/queue-4.19/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch new file mode 100644 index 00000000000..bdf9057a3e4 --- /dev/null +++ b/queue-4.19/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch @@ -0,0 +1,38 @@ +From 71a94aac51194bac1e9f9595cb94c89cbb81964d Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:45 -0400 +Subject: IB/hfi1: Insure freeze_work work_struct is canceled on shutdown + +[ Upstream commit 6d517353c70bb0818b691ca003afdcb5ee5ea44e ] + +By code inspection, the freeze_work is never canceled. + +Fix by adding a cancel_work_sync in the shutdown path to insure it is no +longer running. + +Fixes: 7724105686e7 ("IB/hfi1: add driver files") +Reviewed-by: Michael J. Ruhl +Reviewed-by: Dennis Dalessandro +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/chip.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c +index b12c8ff8ed66..d8eb4dc04d69 100644 +--- a/drivers/infiniband/hw/hfi1/chip.c ++++ b/drivers/infiniband/hw/hfi1/chip.c +@@ -9849,6 +9849,7 @@ void hfi1_quiet_serdes(struct hfi1_pportdata *ppd) + + /* disable the port */ + clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); ++ cancel_work_sync(&ppd->freeze_work); + } + + static inline int init_cpu_counters(struct hfi1_devdata *dd) +-- +2.20.1 + diff --git a/queue-4.19/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch b/queue-4.19/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch new file mode 100644 index 00000000000..d9e4b1215cf --- /dev/null +++ b/queue-4.19/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch @@ -0,0 +1,41 @@ +From 55878a234aca3d92db568618f43d7859b1155f2a Mon Sep 17 00:00:00 2001 +From: Kamenee Arumugam +Date: Fri, 24 May 2019 11:45:04 -0400 +Subject: IB/hfi1: Validate page aligned for a given virtual address + +[ Upstream commit 97736f36dbebf2cda2799db3b54717ba5b388255 ] + +User applications can register memory regions for TID buffers that are not +aligned on page boundaries. Hfi1 is expected to pin those pages in memory +and cache the pages with mmu_rb. The rb tree will fail to insert pages +that are not aligned correctly. + +Validate whether a given virtual address is page aligned before pinning. + +Fixes: 7e7a436ecb6e ("staging/hfi1: Add TID entry program function body") +Reviewed-by: Michael J. Ruhl +Signed-off-by: Kamenee Arumugam +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/user_exp_rcv.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c +index dbe7d14a5c76..4e986ca4dd35 100644 +--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c ++++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c +@@ -324,6 +324,9 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, + u32 *tidlist = NULL; + struct tid_user_buf *tidbuf; + ++ if (!PAGE_ALIGNED(tinfo->vaddr)) ++ return -EINVAL; ++ + tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); + if (!tidbuf) + return -ENOMEM; +-- +2.20.1 + diff --git a/queue-4.19/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch b/queue-4.19/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch new file mode 100644 index 00000000000..893dc226714 --- /dev/null +++ b/queue-4.19/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch @@ -0,0 +1,66 @@ +From 6735b3625cbe314364ea3d3c7439ca616a2dcdc4 Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:51 -0400 +Subject: IB/{qib, hfi1, rdmavt}: Correct ibv_devinfo max_mr value + +[ Upstream commit 35164f5259a47ea756fa1deb3e463ac2a4f10dc9 ] + +The command 'ibv_devinfo -v' reports 0 for max_mr. + +Fix by assigning the query values after the mr lkey_table has been built +rather than early on in the driver. + +Fixes: 7b1e2099adc8 ("IB/rdmavt: Move memory registration into rdmavt") +Reviewed-by: Josh Collier +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/verbs.c | 2 -- + drivers/infiniband/hw/qib/qib_verbs.c | 2 -- + drivers/infiniband/sw/rdmavt/mr.c | 2 ++ + 3 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c +index 48692adbe811..27d9c4cefdc7 100644 +--- a/drivers/infiniband/hw/hfi1/verbs.c ++++ b/drivers/infiniband/hw/hfi1/verbs.c +@@ -1418,8 +1418,6 @@ static void hfi1_fill_device_attr(struct hfi1_devdata *dd) + rdi->dparms.props.max_cq = hfi1_max_cqs; + rdi->dparms.props.max_ah = hfi1_max_ahs; + rdi->dparms.props.max_cqe = hfi1_max_cqes; +- rdi->dparms.props.max_mr = rdi->lkey_table.max; +- rdi->dparms.props.max_fmr = rdi->lkey_table.max; + rdi->dparms.props.max_map_per_fmr = 32767; + rdi->dparms.props.max_pd = hfi1_max_pds; + rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC; +diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c +index 41babbc0db58..803c3544c75b 100644 +--- a/drivers/infiniband/hw/qib/qib_verbs.c ++++ b/drivers/infiniband/hw/qib/qib_verbs.c +@@ -1495,8 +1495,6 @@ static void qib_fill_device_attr(struct qib_devdata *dd) + rdi->dparms.props.max_cq = ib_qib_max_cqs; + rdi->dparms.props.max_cqe = ib_qib_max_cqes; + rdi->dparms.props.max_ah = ib_qib_max_ahs; +- rdi->dparms.props.max_mr = rdi->lkey_table.max; +- rdi->dparms.props.max_fmr = rdi->lkey_table.max; + rdi->dparms.props.max_map_per_fmr = 32767; + rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC; + rdi->dparms.props.max_qp_init_rd_atom = 255; +diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c +index 5819c9d6ffdc..39d101df229d 100644 +--- a/drivers/infiniband/sw/rdmavt/mr.c ++++ b/drivers/infiniband/sw/rdmavt/mr.c +@@ -96,6 +96,8 @@ int rvt_driver_mr_init(struct rvt_dev_info *rdi) + for (i = 0; i < rdi->lkey_table.max; i++) + RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL); + ++ rdi->dparms.props.max_mr = rdi->lkey_table.max; ++ rdi->dparms.props.max_fmr = rdi->lkey_table.max; + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.19/ib-rdmavt-fix-alloc_qpn-warn_on.patch b/queue-4.19/ib-rdmavt-fix-alloc_qpn-warn_on.patch new file mode 100644 index 00000000000..01090359d8c --- /dev/null +++ b/queue-4.19/ib-rdmavt-fix-alloc_qpn-warn_on.patch @@ -0,0 +1,57 @@ +From e16d372a431ae058b7fb69fec4a5fe5f59e8e79a Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:38 -0400 +Subject: IB/rdmavt: Fix alloc_qpn() WARN_ON() + +[ Upstream commit 2abae62a26a265129b364d8c1ef3be55e2c01309 ] + +The qpn allocation logic has a WARN_ON() that intends to detect the use of +an index that will introduce bits in the lower order bits of the QOS bits +in the QPN. + +Unfortunately, it has the following bugs: +- it misfires when wrapping QPN allocation for non-QOS +- it doesn't correctly detect low order QOS bits (despite the comment) + +The WARN_ON() should not be applied to non-QOS (qos_shift == 1). + +Additionally, it SHOULD test the qpn bits per the table below: + +2 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, 0, 0, sc0], qp bit 1 always 0* +3-4 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, 0, sc1, sc0], qp bits [21] always 0 +5-8 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, sc2, sc1, sc0] qp bits [321] always 0 + +Fix by qualifying the warning for qos_shift > 1 and producing the correct +mask to insure the above bits are zero without generating a superfluous +warning. + +Fixes: 501edc42446e ("IB/rdmavt: Correct warning during QPN allocation") +Reviewed-by: Kaike Wan +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/sw/rdmavt/qp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c +index 5ce403c6cddb..7d03680afd91 100644 +--- a/drivers/infiniband/sw/rdmavt/qp.c ++++ b/drivers/infiniband/sw/rdmavt/qp.c +@@ -412,7 +412,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt, + offset = qpt->incr | ((offset & 1) ^ 1); + } + /* there can be no set bits in low-order QoS bits */ +- WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1)); ++ WARN_ON(rdi->dparms.qos_shift > 1 && ++ offset & ((BIT(rdi->dparms.qos_shift - 1) - 1) << 1)); + qpn = mk_qpn(qpt, map, offset); + } + +-- +2.20.1 + diff --git a/queue-4.19/kselftest-cgroup-fix-incorrect-test_core-skip.patch b/queue-4.19/kselftest-cgroup-fix-incorrect-test_core-skip.patch new file mode 100644 index 00000000000..8511f0474af --- /dev/null +++ b/queue-4.19/kselftest-cgroup-fix-incorrect-test_core-skip.patch @@ -0,0 +1,49 @@ +From 15c3c9990892954be4d8ac6a6618003f59d1d8c0 Mon Sep 17 00:00:00 2001 +From: Alex Shi +Date: Mon, 27 May 2019 14:28:07 +0800 +Subject: kselftest/cgroup: fix incorrect test_core skip + +[ Upstream commit f97f3f8839eb9de5843066d80819884f7722c8c5 ] + +The test_core will skip the +test_cgcore_no_internal_process_constraint_on_threads test case if the +'cpu' controller missing in root's subtree_control. In fact we need to +set the 'cpu' in subtree_control, to make the testing meaningful. + +./test_core +... +ok 4 # skip test_cgcore_no_internal_process_constraint_on_threads +... + +Signed-off-by: Alex Shi +Cc: Shuah Khan +Cc: Tejun Heo +Cc: Roman Gushchin +Cc: Claudio Zumbo +Cc: Claudio +Cc: linux-kselftest@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Reviewed-by: Roman Gushchin +Acked-by: Tejun Heo +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/cgroup/test_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c +index d78f1c5366d3..79053a4f4783 100644 +--- a/tools/testing/selftests/cgroup/test_core.c ++++ b/tools/testing/selftests/cgroup/test_core.c +@@ -198,7 +198,7 @@ static int test_cgcore_no_internal_process_constraint_on_threads(const char *roo + char *parent = NULL, *child = NULL; + + if (cg_read_strstr(root, "cgroup.controllers", "cpu") || +- cg_read_strstr(root, "cgroup.subtree_control", "cpu")) { ++ cg_write(root, "cgroup.subtree_control", "+cpu")) { + ret = KSFT_SKIP; + goto cleanup; + } +-- +2.20.1 + diff --git a/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch b/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch new file mode 100644 index 00000000000..81adae6a634 --- /dev/null +++ b/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch @@ -0,0 +1,62 @@ +From 625ced192cfb00939cffd3c7840249ab79bd49b4 Mon Sep 17 00:00:00 2001 +From: Alex Shi +Date: Mon, 27 May 2019 14:28:05 +0800 +Subject: kselftest/cgroup: fix unexpected testing failure on test_memcontrol + +[ Upstream commit f6131f28057d4fd8922599339e701a2504e0f23d ] + +The cgroup testing relies on the root cgroup's subtree_control setting, +If the 'memory' controller isn't set, all test cases will be failed +as following: + +$ sudo ./test_memcontrol +not ok 1 test_memcg_subtree_control +not ok 2 test_memcg_current +ok 3 # skip test_memcg_min +not ok 4 test_memcg_low +not ok 5 test_memcg_high +not ok 6 test_memcg_max +not ok 7 test_memcg_oom_events +ok 8 # skip test_memcg_swap_max +not ok 9 test_memcg_sock +not ok 10 test_memcg_oom_group_leaf_events +not ok 11 test_memcg_oom_group_parent_events +not ok 12 test_memcg_oom_group_score_events + +To correct this unexpected failure, this patch write the 'memory' to +subtree_control of root to get a right result. + +Signed-off-by: Alex Shi +Cc: Shuah Khan +Cc: Roman Gushchin +Cc: Tejun Heo +Cc: Mike Rapoport +Cc: Jay Kamat +Cc: linux-kselftest@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Reviewed-by: Roman Gushchin +Acked-by: Tejun Heo +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/cgroup/test_memcontrol.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c +index 6f339882a6ca..c19a97dd02d4 100644 +--- a/tools/testing/selftests/cgroup/test_memcontrol.c ++++ b/tools/testing/selftests/cgroup/test_memcontrol.c +@@ -1205,6 +1205,10 @@ int main(int argc, char **argv) + if (cg_read_strstr(root, "cgroup.controllers", "memory")) + ksft_exit_skip("memory controller isn't available\n"); + ++ if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) ++ if (cg_write(root, "cgroup.subtree_control", "+memory")) ++ ksft_exit_skip("Failed to set memory controller\n"); ++ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + switch (tests[i].fn(root)) { + case KSFT_PASS: +-- +2.20.1 + diff --git a/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch-1010 b/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch-1010 new file mode 100644 index 00000000000..bc6b1c03257 --- /dev/null +++ b/queue-4.19/kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch-1010 @@ -0,0 +1,55 @@ +From 874245456c48f0e62252fe6a998acc22cb496ed5 Mon Sep 17 00:00:00 2001 +From: Alex Shi +Date: Mon, 27 May 2019 14:28:06 +0800 +Subject: kselftest/cgroup: fix unexpected testing failure on test_core + +[ Upstream commit 00e38a5d753d7788852f81703db804a60a84c26e ] + +The cgroup testing relys on the root cgroup's subtree_control setting, +If the 'memory' controller isn't set, some test cases will be failed +as following: + +$sudo ./test_core +not ok 1 test_cgcore_internal_process_constraint +ok 2 test_cgcore_top_down_constraint_enable +not ok 3 test_cgcore_top_down_constraint_disable +... + +To correct this unexpected failure, this patch write the 'memory' to +subtree_control of root to get a right result. + +Signed-off-by: Alex Shi +Cc: Shuah Khan +Cc: Tejun Heo +Cc: Roman Gushchin +Cc: Claudio Zumbo +Cc: Claudio +Cc: linux-kselftest@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Reviewed-by: Roman Gushchin +Acked-by: Tejun Heo +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/cgroup/test_core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c +index be59f9c34ea2..d78f1c5366d3 100644 +--- a/tools/testing/selftests/cgroup/test_core.c ++++ b/tools/testing/selftests/cgroup/test_core.c +@@ -376,6 +376,11 @@ int main(int argc, char *argv[]) + + if (cg_find_unified_root(root, sizeof(root))) + ksft_exit_skip("cgroup v2 isn't mounted\n"); ++ ++ if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) ++ if (cg_write(root, "cgroup.subtree_control", "+memory")) ++ ksft_exit_skip("Failed to set memory controller\n"); ++ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + switch (tests[i].fn(root)) { + case KSFT_PASS: +-- +2.20.1 + diff --git a/queue-4.19/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch b/queue-4.19/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch new file mode 100644 index 00000000000..da17307c315 --- /dev/null +++ b/queue-4.19/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch @@ -0,0 +1,34 @@ +From 304dd1384c82bf1b8f8002b044b16f9a70d07dc2 Mon Sep 17 00:00:00 2001 +From: Gen Zhang +Date: Fri, 31 May 2019 09:24:18 +0800 +Subject: mdesc: fix a missing-check bug in get_vdev_port_node_info() + +[ Upstream commit 80caf43549e7e41a695c6d1e11066286538b336f ] + +In get_vdev_port_node_info(), 'node_info->vdev_port.name' is allcoated +by kstrdup_const(), and it returns NULL when fails. So +'node_info->vdev_port.name' should be checked. + +Signed-off-by: Gen Zhang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/sparc/kernel/mdesc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c +index 39a2503fa3e1..51028abe5e90 100644 +--- a/arch/sparc/kernel/mdesc.c ++++ b/arch/sparc/kernel/mdesc.c +@@ -357,6 +357,8 @@ static int get_vdev_port_node_info(struct mdesc_handle *md, u64 node, + + node_info->vdev_port.id = *idp; + node_info->vdev_port.name = kstrdup_const(name, GFP_KERNEL); ++ if (!node_info->vdev_port.name) ++ return -1; + node_info->vdev_port.parent_cfg_hdl = *parent_cfg_hdlp; + + return 0; +-- +2.20.1 + diff --git a/queue-4.19/mips-uprobes-remove-set-but-not-used-variable-epc.patch b/queue-4.19/mips-uprobes-remove-set-but-not-used-variable-epc.patch new file mode 100644 index 00000000000..f1030ca66da --- /dev/null +++ b/queue-4.19/mips-uprobes-remove-set-but-not-used-variable-epc.patch @@ -0,0 +1,43 @@ +From acfbfd60dd15ba6b2c8bb1a6b884749e3cc822d4 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Sat, 25 May 2019 20:20:24 +0800 +Subject: MIPS: uprobes: remove set but not used variable 'epc' + +[ Upstream commit f532beeeff0c0a3586cc15538bc52d249eb19e7c ] + +Fixes gcc '-Wunused-but-set-variable' warning: + +arch/mips/kernel/uprobes.c: In function 'arch_uprobe_pre_xol': +arch/mips/kernel/uprobes.c:115:17: warning: variable 'epc' set but not used [-Wunused-but-set-variable] + +It's never used since introduction in +commit 40e084a506eb ("MIPS: Add uprobes support.") + +Signed-off-by: YueHaibing +Signed-off-by: Paul Burton +Cc: +Cc: +Cc: +Cc: +Signed-off-by: Sasha Levin +--- + arch/mips/kernel/uprobes.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c +index 4aaff3b3175c..6dbe4eab0a0e 100644 +--- a/arch/mips/kernel/uprobes.c ++++ b/arch/mips/kernel/uprobes.c +@@ -112,9 +112,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs) + */ + aup->resume_epc = regs->cp0_epc + 4; + if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) { +- unsigned long epc; +- +- epc = regs->cp0_epc; + __compute_return_epc_for_insn(regs, + (union mips_instruction) aup->insn[0]); + aup->resume_epc = regs->cp0_epc; +-- +2.20.1 + diff --git a/queue-4.19/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch b/queue-4.19/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch new file mode 100644 index 00000000000..6de9862d3b4 --- /dev/null +++ b/queue-4.19/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch @@ -0,0 +1,48 @@ +From bd60e5249141217c8dac5996b79f1afc26884e04 Mon Sep 17 00:00:00 2001 +From: Nikita Yushchenko +Date: Fri, 31 May 2019 10:35:14 +0300 +Subject: net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0 + +[ Upstream commit 62394708f3e01c9f2be6be74eb6305bae1ed924f ] + +When non-bridged, non-vlan'ed mv88e6xxx port is moving down, error +message is logged: + +failed to kill vid 0081/0 for device eth_cu_1000_4 + +This is caused by call from __vlan_vid_del() with vin set to zero, over +call chain this results into _mv88e6xxx_port_vlan_del() called with +vid=0, and mv88e6xxx_vtu_get() called from there returns -EINVAL. + +On symmetric path moving port up, call goes through +mv88e6xxx_port_vlan_prepare() that calls mv88e6xxx_port_check_hw_vlan() +that returns -EOPNOTSUPP for zero vid. + +This patch changes mv88e6xxx_vtu_get() to also return -EOPNOTSUPP for +zero vid, then this error code is explicitly cleared in +dsa_slave_vlan_rx_kill_vid() and error message is no longer logged. + +Signed-off-by: Nikita Yushchenko +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c +index dfaad1c2c2b8..411cfb806459 100644 +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -1484,7 +1484,7 @@ static int mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid, + int err; + + if (!vid) +- return -EINVAL; ++ return -EOPNOTSUPP; + + entry->vid = vid - 1; + entry->valid = false; +-- +2.20.1 + diff --git a/queue-4.19/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch b/queue-4.19/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch new file mode 100644 index 00000000000..ac8b895205b --- /dev/null +++ b/queue-4.19/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch @@ -0,0 +1,70 @@ +From 08934eceae437cf1477492d2522b1a6d542dc6ed Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Sat, 1 Jun 2019 08:16:26 +0800 +Subject: net: ethernet: mediatek: Use hw_feature to judge if HWLRO is + supported + +[ Upstream commit 9e4f56f1a7f3287718d0083b5cb85298dc05a5fd ] + +Should hw_feature as hardware capability flags to check if hardware LRO +got support. + +Signed-off-by: Mark Lee +Signed-off-by: Sean Wang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 6e6abdc399de..0c70fb345f83 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -2304,13 +2304,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + + switch (cmd->cmd) { + case ETHTOOL_GRXRINGS: +- if (dev->features & NETIF_F_LRO) { ++ if (dev->hw_features & NETIF_F_LRO) { + cmd->data = MTK_MAX_RX_RING_NUM; + ret = 0; + } + break; + case ETHTOOL_GRXCLSRLCNT: +- if (dev->features & NETIF_F_LRO) { ++ if (dev->hw_features & NETIF_F_LRO) { + struct mtk_mac *mac = netdev_priv(dev); + + cmd->rule_cnt = mac->hwlro_ip_cnt; +@@ -2318,11 +2318,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + } + break; + case ETHTOOL_GRXCLSRULE: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_get_fdir_entry(dev, cmd); + break; + case ETHTOOL_GRXCLSRLALL: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_get_fdir_all(dev, cmd, + rule_locs); + break; +@@ -2339,11 +2339,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) + + switch (cmd->cmd) { + case ETHTOOL_SRXCLSRLINS: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_add_ipaddr(dev, cmd); + break; + case ETHTOOL_SRXCLSRLDEL: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_del_ipaddr(dev, cmd); + break; + default: +-- +2.20.1 + diff --git a/queue-4.19/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch b/queue-4.19/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch new file mode 100644 index 00000000000..c8d231a1b7f --- /dev/null +++ b/queue-4.19/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch @@ -0,0 +1,43 @@ +From 2f2df67bbf6947dc8076672492f0ece7935929d5 Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Sat, 1 Jun 2019 08:16:27 +0800 +Subject: net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW + RX_2BYTE_OFFSET is enabled + +[ Upstream commit 880c2d4b2fdfd580ebcd6bb7240a8027a1d34751 ] + +Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN +equals to 2. + +Signed-off-by: Mark Lee +Signed-off-by: Sean Wang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 0c70fb345f83..1d55f014725e 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1784,6 +1784,7 @@ static void mtk_poll_controller(struct net_device *dev) + + static int mtk_start_dma(struct mtk_eth *eth) + { ++ u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; + int err; + + err = mtk_dma_init(eth); +@@ -1800,7 +1801,7 @@ static int mtk_start_dma(struct mtk_eth *eth) + MTK_QDMA_GLO_CFG); + + mtk_w32(eth, +- MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | ++ MTK_RX_DMA_EN | rx_2b_offset | + MTK_RX_BT_32DWORDS | MTK_MULTI_EN, + MTK_PDMA_GLO_CFG); + +-- +2.20.1 + diff --git a/queue-4.19/net-hns-fix-loopback-test-failed-at-copper-ports.patch b/queue-4.19/net-hns-fix-loopback-test-failed-at-copper-ports.patch new file mode 100644 index 00000000000..187b1a5effb --- /dev/null +++ b/queue-4.19/net-hns-fix-loopback-test-failed-at-copper-ports.patch @@ -0,0 +1,45 @@ +From 6d1a02f4a105145f49604afa4b38dcd83183b1ed Mon Sep 17 00:00:00 2001 +From: Yonglong Liu +Date: Fri, 31 May 2019 16:59:50 +0800 +Subject: net: hns: Fix loopback test failed at copper ports + +[ Upstream commit 2e1f164861e500f4e068a9d909bbd3fcc7841483 ] + +When doing a loopback test at copper ports, the serdes loopback +and the phy loopback will fail, because of the adjust link had +not finished, and phy not ready. + +Adds sleep between adjust link and test process to fix it. + +Signed-off-by: Yonglong Liu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +index e2710ff48fb0..1fa0cd527ead 100644 +--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c ++++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +@@ -339,6 +339,7 @@ static int __lb_setup(struct net_device *ndev, + static int __lb_up(struct net_device *ndev, + enum hnae_loop loop_mode) + { ++#define NIC_LB_TEST_WAIT_PHY_LINK_TIME 300 + struct hns_nic_priv *priv = netdev_priv(ndev); + struct hnae_handle *h = priv->ae_handle; + int speed, duplex; +@@ -365,6 +366,9 @@ static int __lb_up(struct net_device *ndev, + + h->dev->ops->adjust_link(h, speed, duplex); + ++ /* wait adjust link done and phy ready */ ++ msleep(NIC_LB_TEST_WAIT_PHY_LINK_TIME); ++ + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.19/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch b/queue-4.19/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch new file mode 100644 index 00000000000..cc3d0cc63aa --- /dev/null +++ b/queue-4.19/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch @@ -0,0 +1,45 @@ +From fd229152455d516eff6f05d5cba929eb66e68db1 Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Tue, 4 Jun 2019 06:07:34 +0000 +Subject: net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is + set + +[ Upstream commit ceae266bf0ae6564ac16d086bf749a096fa90ded ] + +There's some NICs, such as hinic, with NETIF_F_IP_CSUM and NETIF_F_TSO +on but NETIF_F_HW_CSUM off. And ipvlan device features will be +NETIF_F_TSO on with NETIF_F_IP_CSUM and NETIF_F_IP_CSUM both off as +IPVLAN_FEATURES only care about NETIF_F_HW_CSUM. So TSO will be +disabled in netdev_fix_features. +For example: +Features for enp129s0f0: +rx-checksumming: on +tx-checksumming: on + tx-checksum-ipv4: on + tx-checksum-ip-generic: off [fixed] + tx-checksum-ipv6: on + +Fixes: a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK") +Signed-off-by: Miaohe Lin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ipvlan/ipvlan_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c +index 68b8007da82b..0115a2868933 100644 +--- a/drivers/net/ipvlan/ipvlan_main.c ++++ b/drivers/net/ipvlan/ipvlan_main.c +@@ -178,7 +178,7 @@ static void ipvlan_port_destroy(struct net_device *dev) + } + + #define IPVLAN_FEATURES \ +- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ ++ (NETIF_F_SG | NETIF_F_CSUM_MASK | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ + NETIF_F_GSO | NETIF_F_TSO | NETIF_F_GSO_ROBUST | \ + NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) +-- +2.20.1 + diff --git a/queue-4.19/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch b/queue-4.19/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch new file mode 100644 index 00000000000..1ef5355ab7c --- /dev/null +++ b/queue-4.19/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch @@ -0,0 +1,37 @@ +From 2c601cfe5eb581026081cf86d67b83f766710983 Mon Sep 17 00:00:00 2001 +From: Jaesoo Lee +Date: Mon, 3 Jun 2019 16:42:28 -0700 +Subject: nvme: Fix u32 overflow in the number of namespace list calculation + +[ Upstream commit c8e8c77b3bdbade6e26e8e76595f141ede12b692 ] + +The Number of Namespaces (nn) field in the identify controller data structure is +defined as u32 and the maximum allowed value in NVMe specification is +0xFFFFFFFEUL. This change fixes the possible overflow of the DIV_ROUND_UP() +operation used in nvme_scan_ns_list() by casting the nn to u64. + +Signed-off-by: Jaesoo Lee +Reviewed-by: Christoph Hellwig +Signed-off-by: Sagi Grimberg +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index a867a139bb35..d8869d978c34 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -3228,7 +3228,8 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn) + { + struct nvme_ns *ns; + __le32 *ns_list; +- unsigned i, j, nsid, prev = 0, num_lists = DIV_ROUND_UP(nn, 1024); ++ unsigned i, j, nsid, prev = 0; ++ unsigned num_lists = DIV_ROUND_UP_ULL((u64)nn, 1024); + int ret = 0; + + ns_list = kzalloc(NVME_IDENTIFY_DATA_SIZE, GFP_KERNEL); +-- +2.20.1 + diff --git a/queue-4.19/nvmet-fix-data_len-to-0-for-bdev-backed-write_zeroes.patch b/queue-4.19/nvmet-fix-data_len-to-0-for-bdev-backed-write_zeroes.patch new file mode 100644 index 00000000000..0d91aebdbc9 --- /dev/null +++ b/queue-4.19/nvmet-fix-data_len-to-0-for-bdev-backed-write_zeroes.patch @@ -0,0 +1,54 @@ +From 6c2803088723c0458483f9ddbdd9df29814c83c4 Mon Sep 17 00:00:00 2001 +From: Minwoo Im +Date: Sun, 2 Jun 2019 12:43:39 +0900 +Subject: nvmet: fix data_len to 0 for bdev-backed write_zeroes + +[ Upstream commit 3562f5d9f21e7779ae442a45197fed6cb247fd22 ] + +The WRITE ZEROES command has no data transfer so that we need to +initialize the struct (nvmet_req *req)->data_len to 0x0. While +(nvmet_req *req)->transfer_len is initialized in nvmet_req_init(), +data_len will be initialized by nowhere which might cause the failure +with status code NVME_SC_SGL_INVALID_DATA | NVME_SC_DNR randomly. It's +because nvmet_req_execute() checks like: + + if (unlikely(req->data_len != req->transfer_len)) { + req->error_loc = offsetof(struct nvme_common_command, dptr); + nvmet_req_complete(req, NVME_SC_SGL_INVALID_DATA | NVME_SC_DNR); + } else + req->execute(req); + +This patch fixes req->data_len not to be a randomly assigned by +initializing it to 0x0 when preparing the command in +nvmet_bdev_parse_io_cmd(). + +nvmet_file_parse_io_cmd() which is for file-backed I/O has already +initialized the data_len field to 0x0, though. + +Cc: Christoph Hellwig +Cc: Sagi Grimberg +Cc: Chaitanya Kulkarni +Signed-off-by: Minwoo Im +Reviewed-by: Chaitanya Kulkarni +Reviewed-by: Christoph Hellwig +Signed-off-by: Sagi Grimberg +Signed-off-by: Sasha Levin +--- + drivers/nvme/target/io-cmd-bdev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c +index 7bc9f6240432..1096dd01ca22 100644 +--- a/drivers/nvme/target/io-cmd-bdev.c ++++ b/drivers/nvme/target/io-cmd-bdev.c +@@ -239,6 +239,7 @@ u16 nvmet_bdev_parse_io_cmd(struct nvmet_req *req) + return 0; + case nvme_cmd_write_zeroes: + req->execute = nvmet_bdev_execute_write_zeroes; ++ req->data_len = 0; + return 0; + default: + pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode, +-- +2.20.1 + diff --git a/queue-4.19/parisc-fix-compiler-warnings-in-float-emulation-code.patch b/queue-4.19/parisc-fix-compiler-warnings-in-float-emulation-code.patch new file mode 100644 index 00000000000..03277a798de --- /dev/null +++ b/queue-4.19/parisc-fix-compiler-warnings-in-float-emulation-code.patch @@ -0,0 +1,53 @@ +From a82ad420539e00e45c2216130a2f5d24c534a343 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 24 May 2019 23:16:25 +0200 +Subject: parisc: Fix compiler warnings in float emulation code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 6b98d9134e14f5ef4bcf64b27eedf484ed19a1ec ] + +Avoid such compiler warnings: +arch/parisc/math-emu/cnv_float.h:71:27: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] + ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) +arch/parisc/math-emu/fcnvxf.c:257:6: note: in expansion of macro ‘Dint_isinexact_to_sgl’ + if (Dint_isinexact_to_sgl(srcp1,srcp2)) { + +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + arch/parisc/math-emu/cnv_float.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h +index 933423fa5144..b0db61188a61 100644 +--- a/arch/parisc/math-emu/cnv_float.h ++++ b/arch/parisc/math-emu/cnv_float.h +@@ -60,19 +60,19 @@ + ((exponent < (SGL_P - 1)) ? \ + (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE) + +-#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) ++#define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0) + + #define Sgl_roundnearest_from_int(int_value,sgl_value) \ + if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \ +- if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ ++ if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \ + Sall(sgl_value)++ + + #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \ +- ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) ++ (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB)) + + #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \ + if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \ +- if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ ++ if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \ + Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++ + + #define Dint_isinexact_to_dbl(dint_value) \ +-- +2.20.1 + diff --git a/queue-4.19/parport-fix-mem-leak-in-parport_register_dev_model.patch b/queue-4.19/parport-fix-mem-leak-in-parport_register_dev_model.patch new file mode 100644 index 00000000000..396c3ce521d --- /dev/null +++ b/queue-4.19/parport-fix-mem-leak-in-parport_register_dev_model.patch @@ -0,0 +1,67 @@ +From f29979a38c2d87807017500127dfef66c92c4cf8 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Tue, 14 May 2019 23:24:37 +0800 +Subject: parport: Fix mem leak in parport_register_dev_model + +[ Upstream commit 1c7ebeabc9e5ee12e42075a597de40fdb9059530 ] + +BUG: memory leak +unreferenced object 0xffff8881df48cda0 (size 16): + comm "syz-executor.0", pid 5077, jiffies 4295994670 (age 22.280s) + hex dump (first 16 bytes): + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + backtrace: + [<00000000d2d0d5fe>] parport_register_dev_model+0x141/0x6e0 [parport] + [<00000000782f6dab>] 0xffffffffc15d1196 + [<00000000d2ca6ae4>] platform_drv_probe+0x7e/0x100 + [<00000000628c2a94>] really_probe+0x342/0x4d0 + [<000000006874f5da>] driver_probe_device+0x8c/0x170 + [<00000000424de37a>] __device_attach_driver+0xda/0x100 + [<000000002acab09a>] bus_for_each_drv+0xfe/0x170 + [<000000003d9e5f31>] __device_attach+0x190/0x230 + [<0000000035d32f80>] bus_probe_device+0x123/0x140 + [<00000000a05ba627>] device_add+0x7cc/0xce0 + [<000000003f7560bf>] platform_device_add+0x230/0x3c0 + [<000000002a0be07d>] 0xffffffffc15d0949 + [<000000007361d8d2>] port_check+0x3b/0x50 [parport] + [<000000004d67200f>] bus_for_each_dev+0x115/0x180 + [<000000003ccfd11c>] __parport_register_driver+0x1f0/0x210 [parport] + [<00000000987f06fc>] 0xffffffffc15d803e + +After commit 4e5a74f1db8d ("parport: Revert "parport: fix +memory leak""), free_pardevice do not free par_dev->state, +we should free it in error path of parport_register_dev_model +before return. + +Reported-by: Hulk Robot +Fixes: 4e5a74f1db8d ("parport: Revert "parport: fix memory leak"") +Signed-off-by: YueHaibing +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/parport/share.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/parport/share.c b/drivers/parport/share.c +index 5dc53d420ca8..7b4ee33c1935 100644 +--- a/drivers/parport/share.c ++++ b/drivers/parport/share.c +@@ -895,6 +895,7 @@ parport_register_dev_model(struct parport *port, const char *name, + par_dev->devmodel = true; + ret = device_register(&par_dev->dev); + if (ret) { ++ kfree(par_dev->state); + put_device(&par_dev->dev); + goto err_put_port; + } +@@ -912,6 +913,7 @@ parport_register_dev_model(struct parport *port, const char *name, + spin_unlock(&port->physport->pardevice_lock); + pr_debug("%s: cannot grant exclusive access for device %s\n", + port->name, name); ++ kfree(par_dev->state); + device_unregister(&par_dev->dev); + goto err_put_port; + } +-- +2.20.1 + diff --git a/queue-4.19/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch b/queue-4.19/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch new file mode 100644 index 00000000000..1ddb63f9b3a --- /dev/null +++ b/queue-4.19/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch @@ -0,0 +1,51 @@ +From e1561eafa5e728842e8d5d01e4489fe9f4951a0b Mon Sep 17 00:00:00 2001 +From: Alexandra Winter +Date: Wed, 5 Jun 2019 13:48:50 +0200 +Subject: s390/qeth: fix VLAN attribute in bridge_hostnotify udev event + +[ Upstream commit 335726195e460cb6b3f795b695bfd31f0ea70ef0 ] + +Enabling sysfs attribute bridge_hostnotify triggers a series of udev events +for the MAC addresses of all currently connected peers. In case no VLAN is +set for a peer, the device reports the corresponding MAC addresses with +VLAN ID 4096. This currently results in attribute VLAN=4096 for all +non-VLAN interfaces in the initial series of events after host-notify is +enabled. + +Instead, no VLAN attribute should be reported in the udev event for +non-VLAN interfaces. + +Only the initial events face this issue. For dynamic changes that are +reported later, the device uses a validity flag. + +This also changes the code so that it now sets the VLAN attribute for +MAC addresses with VID 0. On Linux, no qeth interface will ever be +registered with VID 0: Linux kernel registers VID 0 on all network +interfaces initially, but qeth will drop .ndo_vlan_rx_add_vid for VID 0. +Peers with other OSs could register MACs with VID 0. + +Fixes: 9f48b9db9a22 ("qeth: bridgeport support - address notifications") +Signed-off-by: Alexandra Winter +Signed-off-by: Julian Wiedmann +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/s390/net/qeth_l2_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c +index b7513c5848cf..c1c35eccd5b6 100644 +--- a/drivers/s390/net/qeth_l2_main.c ++++ b/drivers/s390/net/qeth_l2_main.c +@@ -1901,7 +1901,7 @@ static void qeth_bridgeport_an_set_cb(void *priv, + + l2entry = (struct qdio_brinfo_entry_l2 *)entry; + code = IPA_ADDR_CHANGE_CODE_MACADDR; +- if (l2entry->addr_lnid.lnid) ++ if (l2entry->addr_lnid.lnid < VLAN_N_VID) + code |= IPA_ADDR_CHANGE_CODE_VLANID; + qeth_bridge_emit_host_event(card, anev_reg_unreg, code, + (struct net_if_token *)&l2entry->nit, +-- +2.20.1 + diff --git a/queue-4.19/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch b/queue-4.19/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch new file mode 100644 index 00000000000..48186301c4d --- /dev/null +++ b/queue-4.19/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch @@ -0,0 +1,42 @@ +From c579b35747993b5dfbe505e46b8923d6f0a6472c Mon Sep 17 00:00:00 2001 +From: "George G. Davis" +Date: Mon, 3 Jun 2019 10:30:39 -0400 +Subject: scripts/checkstack.pl: Fix arm64 wrong or unknown architecture + +[ Upstream commit 4f45d62a52297b10ded963412a158685647ecdec ] + +The following error occurs for the `make ARCH=arm64 checkstack` case: + +aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \ +perl ./scripts/checkstack.pl arm64 +wrong or unknown architecture "arm64" + +As suggested by Masahiro Yamada, fix the above error using regular +expressions in the same way it was fixed for the `ARCH=x86` case via +commit fda9f9903be6 ("scripts/checkstack.pl: automatically handle +32-bit and 64-bit mode for ARCH=x86"). + +Suggested-by: Masahiro Yamada +Signed-off-by: George G. Davis +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/checkstack.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl +index 34414c6efad6..a2c9e7f98e06 100755 +--- a/scripts/checkstack.pl ++++ b/scripts/checkstack.pl +@@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre); + $x = "[0-9a-f]"; # hex character + $xs = "[0-9a-f ]"; # hex character or space + $funcre = qr/^$x* <(.*)>:$/; +- if ($arch eq 'aarch64') { ++ if ($arch =~ '^(aarch|arm)64$') { + #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]! + $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o; + } elsif ($arch eq 'arm') { +-- +2.20.1 + diff --git a/queue-4.19/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch b/queue-4.19/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch new file mode 100644 index 00000000000..e801a10c99a --- /dev/null +++ b/queue-4.19/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch @@ -0,0 +1,39 @@ +From 09735bf8efebb1c5e452c2bcb73d72a2af761425 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 29 May 2019 14:07:39 +0300 +Subject: scsi: smartpqi: unlock on error in + pqi_submit_raid_request_synchronous() + +[ Upstream commit cc8f52609bb4177febade24d11713e20c0893b0a ] + +We need to drop the "ctrl_info->sync_request_sem" lock before returning. + +Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver") +Signed-off-by: Dan Carpenter +Acked-by: Don Brace +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/smartpqi/smartpqi_init.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c +index 411d656f2530..98f2d076f938 100644 +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -3697,8 +3697,10 @@ static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info, + return -ETIMEDOUT; + msecs_blocked = + jiffies_to_msecs(jiffies - start_jiffies); +- if (msecs_blocked >= timeout_msecs) +- return -ETIMEDOUT; ++ if (msecs_blocked >= timeout_msecs) { ++ rc = -ETIMEDOUT; ++ goto out; ++ } + timeout_msecs -= msecs_blocked; + } + } +-- +2.20.1 + diff --git a/queue-4.19/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch b/queue-4.19/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch new file mode 100644 index 00000000000..4d239284502 --- /dev/null +++ b/queue-4.19/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch @@ -0,0 +1,42 @@ +From 5f2fe5495d10813d0dff0623615ae7ae5706758a Mon Sep 17 00:00:00 2001 +From: Avri Altman +Date: Tue, 21 May 2019 11:24:22 +0300 +Subject: scsi: ufs: Check that space was properly alloced in + copy_query_response + +[ Upstream commit 1c90836f70f9a8ef7b7ad9e1fdd8961903e6ced6 ] + +struct ufs_dev_cmd is the main container that supports device management +commands. In the case of a read descriptor request, we assume that the +proper space was allocated in dev_cmd to hold the returning descriptor. + +This is no longer true, as there are flows that doesn't use dev_cmd for +device management requests, and was wrong in the first place. + +Fixes: d44a5f98bb49 (ufs: query descriptor API) +Signed-off-by: Avri Altman +Reviewed-by: Alim Akhtar +Acked-by: Bean Huo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/ufs/ufshcd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c +index 3183fa8c5857..b8b59cfeacd1 100644 +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -1914,7 +1914,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) + memcpy(&query_res->upiu_res, &lrbp->ucd_rsp_ptr->qr, QUERY_OSF_SIZE); + + /* Get the descriptor */ +- if (lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) { ++ if (hba->dev_cmd.query.descriptor && ++ lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) { + u8 *descp = (u8 *)lrbp->ucd_rsp_ptr + + GENERAL_UPIU_REQUEST_SIZE; + u16 resp_len; +-- +2.20.1 + diff --git a/queue-4.19/selftests-vm-install-test_vmalloc.sh-for-run_vmtests.patch b/queue-4.19/selftests-vm-install-test_vmalloc.sh-for-run_vmtests.patch new file mode 100644 index 00000000000..d71e0e67f7d --- /dev/null +++ b/queue-4.19/selftests-vm-install-test_vmalloc.sh-for-run_vmtests.patch @@ -0,0 +1,38 @@ +From 8115635d434df5a604dc079d4cd3c8ff51c47038 Mon Sep 17 00:00:00 2001 +From: Naresh Kamboju +Date: Tue, 28 May 2019 13:18:09 +0100 +Subject: selftests: vm: install test_vmalloc.sh for run_vmtests + +[ Upstream commit bc2cce3f2ebcae02aa4bb29e3436bf75ee674c32 ] + +Add test_vmalloc.sh to TEST_FILES to make sure it gets installed for +run_vmtests. + +Fixed below error: +./run_vmtests: line 217: ./test_vmalloc.sh: No such file or directory + +Tested with: make TARGETS=vm install INSTALL_PATH=$PWD/x + +Signed-off-by: Naresh Kamboju +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/vm/Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile +index dc68340a6a96..2cf3dc49bd03 100644 +--- a/tools/testing/selftests/vm/Makefile ++++ b/tools/testing/selftests/vm/Makefile +@@ -24,6 +24,8 @@ TEST_GEN_FILES += virtual_address_range + + TEST_PROGS := run_vmtests + ++TEST_FILES := test_vmalloc.sh ++ + KSFT_KHDR_INSTALL := 1 + include ../lib.mk + +-- +2.20.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 9b8a91ecf61..e2bc30cc277 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -27,3 +27,41 @@ apparmor-fix-profile_mediates-for-untrusted-input.patch apparmor-enforce-nullbyte-at-end-of-tag-string.patch brcmfmac-sdio-disable-auto-tuning-around-commands-expected-to-fail.patch brcmfmac-sdio-don-t-tune-while-the-card-is-off.patch +arc-fix-build-warnings.patch +dmaengine-dw-axi-dmac-fix-null-dereference-when-poin.patch +dmaengine-sprd-fix-block-length-overflow.patch +arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch +arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch +fpga-dfl-afu-pass-the-correct-device-to-dma_mapping_.patch +fpga-dfl-add-lockdep-classes-for-pdata-lock.patch +parport-fix-mem-leak-in-parport_register_dev_model.patch +parisc-fix-compiler-warnings-in-float-emulation-code.patch +ib-rdmavt-fix-alloc_qpn-warn_on.patch +ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch +ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch +ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch +mips-uprobes-remove-set-but-not-used-variable-epc.patch +xtensa-fix-section-mismatch-between-memblock_reserve.patch +kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch +kselftest-cgroup-fix-unexpected-testing-failure-on-t.patch-1010 +kselftest-cgroup-fix-incorrect-test_core-skip.patch +selftests-vm-install-test_vmalloc.sh-for-run_vmtests.patch +net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch +net-hns-fix-loopback-test-failed-at-copper-ports.patch +mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch +sparc-perf-fix-updated-event-period-in-response-to-p.patch +net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch +net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch +drm-arm-mali-dp-add-a-loop-around-the-second-set-cva.patch +drm-arm-hdlcd-actually-validate-crtc-modes.patch +drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch +nvmet-fix-data_len-to-0-for-bdev-backed-write_zeroes.patch +scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch +scsi-ufs-check-that-space-was-properly-alloced-in-co.patch +scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch +net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch +s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch +hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch +hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch +arm64-silence-gcc-warnings-about-arch-abi-drift.patch +nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch diff --git a/queue-4.19/sparc-perf-fix-updated-event-period-in-response-to-p.patch b/queue-4.19/sparc-perf-fix-updated-event-period-in-response-to-p.patch new file mode 100644 index 00000000000..5f0a41e2464 --- /dev/null +++ b/queue-4.19/sparc-perf-fix-updated-event-period-in-response-to-p.patch @@ -0,0 +1,44 @@ +From e3e3255f3c33362ee62546e087c98eb7e69d78bd Mon Sep 17 00:00:00 2001 +From: Young Xiao <92siuyang@gmail.com> +Date: Wed, 29 May 2019 10:21:48 +0800 +Subject: sparc: perf: fix updated event period in response to + PERF_EVENT_IOC_PERIOD + +[ Upstream commit 56cd0aefa475079e9613085b14a0f05037518fed ] + +The PERF_EVENT_IOC_PERIOD ioctl command can be used to change the +sample period of a running perf_event. Consequently, when calculating +the next event period, the new period will only be considered after the +previous one has overflowed. + +This patch changes the calculation of the remaining event ticks so that +they are offset if the period has changed. + +See commit 3581fe0ef37c ("ARM: 7556/1: perf: fix updated event period in +response to PERF_EVENT_IOC_PERIOD") for details. + +Signed-off-by: Young Xiao <92siuyang@gmail.com> +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/sparc/kernel/perf_event.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c +index 67b3e6b3ce5d..1ad5911f62b4 100644 +--- a/arch/sparc/kernel/perf_event.c ++++ b/arch/sparc/kernel/perf_event.c +@@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(struct perf_event *event, + s64 period = hwc->sample_period; + int ret = 0; + ++ /* The period may have been changed by PERF_EVENT_IOC_PERIOD */ ++ if (unlikely(period != hwc->last_period)) ++ left = period - (hwc->last_period - left); ++ + if (unlikely(left <= -period)) { + left = period; + local64_set(&hwc->period_left, left); +-- +2.20.1 + diff --git a/queue-4.19/xtensa-fix-section-mismatch-between-memblock_reserve.patch b/queue-4.19/xtensa-fix-section-mismatch-between-memblock_reserve.patch new file mode 100644 index 00000000000..c77377bfabe --- /dev/null +++ b/queue-4.19/xtensa-fix-section-mismatch-between-memblock_reserve.patch @@ -0,0 +1,50 @@ +From 04e5f7c1b6ccc5830a10fc1be08ae21c92ce98b2 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Thu, 30 May 2019 05:41:38 -0700 +Subject: xtensa: Fix section mismatch between memblock_reserve and mem_reserve + +[ Upstream commit adefd051a6707a6ca0ebad278d3c1c05c960fc3b ] + +Since commit 9012d011660ea5cf2 ("compiler: allow all arches to enable +CONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section +mismatch errors. + +WARNING: vmlinux.o(.text.unlikely+0x68): Section mismatch in reference + from the function ___pa() + to the function .meminit.text:memblock_reserve() +WARNING: vmlinux.o(.text.unlikely+0x74): Section mismatch in reference + from the function mem_reserve() + to the function .meminit.text:memblock_reserve() +FATAL: modpost: Section mismatches detected. + +This was not seen prior to the above mentioned commit because mem_reserve() +was always inlined. + +Mark mem_reserve(() as __init_memblock to have it reside in the same +section as memblock_reserve(). + +Signed-off-by: Guenter Roeck +Message-Id: <1559220098-9955-1-git-send-email-linux@roeck-us.net> +Signed-off-by: Max Filippov +Signed-off-by: Sasha Levin +--- + arch/xtensa/kernel/setup.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c +index 351283b60df6..a285fbd0fd9b 100644 +--- a/arch/xtensa/kernel/setup.c ++++ b/arch/xtensa/kernel/setup.c +@@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_start; + extern char _SecondaryResetVector_text_end; + #endif + +-static inline int mem_reserve(unsigned long start, unsigned long end) ++static inline int __init_memblock mem_reserve(unsigned long start, ++ unsigned long end) + { + return memblock_reserve(start, end - start); + } +-- +2.20.1 +