From: Sasha Levin Date: Wed, 8 May 2019 20:23:46 +0000 (-0400) Subject: fixes for 4.9 X-Git-Tag: v4.9.175~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6a5e651a48bd3f6dedbe863c5bb36a58481469e;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch b/queue-4.9/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch new file mode 100644 index 00000000000..7d5ca8ae4f5 --- /dev/null +++ b/queue-4.9/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch @@ -0,0 +1,37 @@ +From 1e800fa557ec45864219fd368490af1b8b65ff7c Mon Sep 17 00:00:00 2001 +From: Daniel Mack +Date: Wed, 20 Mar 2019 22:41:56 +0100 +Subject: ASoC: cs4270: Set auto-increment bit for register writes + +[ Upstream commit f0f2338a9cfaf71db895fa989ea7234e8a9b471d ] + +The CS4270 does not by default increment the register address on +consecutive writes. During normal operation it doesn't matter as all +register accesses are done individually. At resume time after suspend, +however, the regcache code gathers the biggest possible block of +registers to sync and sends them one on one go. + +To fix this, set the INCR bit in all cases. + +Signed-off-by: Daniel Mack +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/cs4270.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c +index 84f86745c30e9..828bc615a1908 100644 +--- a/sound/soc/codecs/cs4270.c ++++ b/sound/soc/codecs/cs4270.c +@@ -643,6 +643,7 @@ static const struct regmap_config cs4270_regmap = { + .reg_defaults = cs4270_reg_defaults, + .num_reg_defaults = ARRAY_SIZE(cs4270_reg_defaults), + .cache_type = REGCACHE_RBTREE, ++ .write_flag_mask = CS4270_I2C_INCR, + + .readable_reg = cs4270_reg_is_readable, + .volatile_reg = cs4270_reg_is_volatile, +-- +2.20.1 + diff --git a/queue-4.9/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch b/queue-4.9/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch new file mode 100644 index 00000000000..2307521e08f --- /dev/null +++ b/queue-4.9/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch @@ -0,0 +1,37 @@ +From b7b902e70c9c0f8a57f87576e86bbd43d4fb301c Mon Sep 17 00:00:00 2001 +From: John Hsu +Date: Wed, 13 Mar 2019 16:23:44 +0800 +Subject: ASoC: nau8810: fix the issue of widget with prefixed name + +[ Upstream commit 54d1cf78b0f4ba348a7c7fb8b7d0708d71b6cc8a ] + +The driver changes the stream name of DAC and ADC to avoid the issue of +widget with prefixed name. When the machine adds prefixed name for codec, +the stream name of DAI may not find the widgets. + +Signed-off-by: John Hsu +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/nau8810.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c +index e45518629968b..2234d0c041657 100644 +--- a/sound/soc/codecs/nau8810.c ++++ b/sound/soc/codecs/nau8810.c +@@ -414,9 +414,9 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { + SND_SOC_DAPM_MIXER("Mono Mixer", NAU8810_REG_POWER3, + NAU8810_MOUTMX_EN_SFT, 0, &nau8810_mono_mixer_controls[0], + ARRAY_SIZE(nau8810_mono_mixer_controls)), +- SND_SOC_DAPM_DAC("DAC", "HiFi Playback", NAU8810_REG_POWER3, ++ SND_SOC_DAPM_DAC("DAC", "Playback", NAU8810_REG_POWER3, + NAU8810_DAC_EN_SFT, 0), +- SND_SOC_DAPM_ADC("ADC", "HiFi Capture", NAU8810_REG_POWER2, ++ SND_SOC_DAPM_ADC("ADC", "Capture", NAU8810_REG_POWER2, + NAU8810_ADC_EN_SFT, 0), + SND_SOC_DAPM_PGA("SpkN Out", NAU8810_REG_POWER3, + NAU8810_NSPK_EN_SFT, 0, NULL, 0), +-- +2.20.1 + diff --git a/queue-4.9/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch b/queue-4.9/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch new file mode 100644 index 00000000000..62c2db56adf --- /dev/null +++ b/queue-4.9/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch @@ -0,0 +1,62 @@ +From d6910239bc3e346fd1c96a868968e4401b71b20b Mon Sep 17 00:00:00 2001 +From: Rander Wang +Date: Fri, 8 Mar 2019 16:38:57 +0800 +Subject: ASoC:soc-pcm:fix a codec fixup issue in TDM case + +[ Upstream commit 570f18b6a8d1f0e60e8caf30e66161b6438dcc91 ] + +On HDaudio platforms, if playback is started when capture is working, +there is no audible output. + +This can be root-caused to the use of the rx|tx_mask to store an HDaudio +stream tag. + +If capture is stared before playback, rx_mask would be non-zero on HDaudio +platform, then the channel number of playback, which is in the same codec +dai with the capture, would be changed by soc_pcm_codec_params_fixup based +on the tx_mask at first, then overwritten by this function based on rx_mask +at last. + +According to the author of tx|rx_mask, tx_mask is for playback and rx_mask +is for capture. And stream direction is checked at all other references of +tx|rx_mask in ASoC, so here should be an error. This patch checks stream +direction for tx|rx_mask for fixup function. + +This issue would affect not only HDaudio+ASoC, but also I2S codecs if the +channel number based on rx_mask is not equal to the one for tx_mask. It could +be rarely reproduecd because most drivers in kernel set the same channel number +to tx|rx_mask or rx_mask is zero. + +Tested on all platforms using stream_tag & HDaudio and intel I2S platforms. + +Signed-off-by: Rander Wang +Acked-by: Pierre-Louis Bossart +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/soc-pcm.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c +index b111ecda6439d..1dbcdc99dbe36 100644 +--- a/sound/soc/soc-pcm.c ++++ b/sound/soc/soc-pcm.c +@@ -894,10 +894,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, + codec_params = *params; + + /* fixup params based on TDM slot masks */ +- if (codec_dai->tx_mask) ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && ++ codec_dai->tx_mask) + soc_pcm_codec_params_fixup(&codec_params, + codec_dai->tx_mask); +- if (codec_dai->rx_mask) ++ ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && ++ codec_dai->rx_mask) + soc_pcm_codec_params_fixup(&codec_params, + codec_dai->rx_mask); + +-- +2.20.1 + diff --git a/queue-4.9/asoc-tlv320aic32x4-fix-common-pins.patch b/queue-4.9/asoc-tlv320aic32x4-fix-common-pins.patch new file mode 100644 index 00000000000..fd577e63bc2 --- /dev/null +++ b/queue-4.9/asoc-tlv320aic32x4-fix-common-pins.patch @@ -0,0 +1,33 @@ +From 99225b3fbc24d142cbf098962a4dbdb391ee6060 Mon Sep 17 00:00:00 2001 +From: Annaliese McDermond +Date: Sat, 30 Mar 2019 09:02:02 -0700 +Subject: ASoC: tlv320aic32x4: Fix Common Pins + +[ Upstream commit c63adb28f6d913310430f14c69f0a2ea55eed0cc ] + +The common pins were mistakenly not added to the DAPM graph. +Adding these pins will allow valid graphs to be created. + +Signed-off-by: Annaliese McDermond +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tlv320aic32x4.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c +index 28fdfc5ec5443..c27e3476848a8 100644 +--- a/sound/soc/codecs/tlv320aic32x4.c ++++ b/sound/soc/codecs/tlv320aic32x4.c +@@ -316,6 +316,8 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = { + SND_SOC_DAPM_INPUT("IN2_R"), + SND_SOC_DAPM_INPUT("IN3_L"), + SND_SOC_DAPM_INPUT("IN3_R"), ++ SND_SOC_DAPM_INPUT("CM_L"), ++ SND_SOC_DAPM_INPUT("CM_R"), + }; + + static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = { +-- +2.20.1 + diff --git a/queue-4.9/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch b/queue-4.9/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch new file mode 100644 index 00000000000..626279e81b1 --- /dev/null +++ b/queue-4.9/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch @@ -0,0 +1,33 @@ +From 7cb03f9aceadfde75178f7a2517944de3d14c1a7 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 28 Mar 2019 17:31:30 +0300 +Subject: drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata() + +[ Upstream commit 2d85978341e6a32e7443d9f28639da254d53f400 ] + +We don't want to overwrite "ret", it already holds the correct error +code. The "regmap" variable might be a valid pointer as this point. + +Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support") +Signed-off-by: Dan Carpenter +Signed-off-by: CK Hu +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c +index 863d030786e52..200f75e1d6198 100644 +--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c ++++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c +@@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, + if (IS_ERR(regmap)) + ret = PTR_ERR(regmap); + if (ret) { +- ret = PTR_ERR(regmap); + dev_err(dev, + "Failed to get system configuration registers: %d\n", + ret); +-- +2.20.1 + diff --git a/queue-4.9/drm-mediatek-fix-possible-object-reference-leak.patch b/queue-4.9/drm-mediatek-fix-possible-object-reference-leak.patch new file mode 100644 index 00000000000..36bcecd6975 --- /dev/null +++ b/queue-4.9/drm-mediatek-fix-possible-object-reference-leak.patch @@ -0,0 +1,46 @@ +From 307d2b2abd46dd886a3e7c8f1a489cf2d5ad9a92 Mon Sep 17 00:00:00 2001 +From: Wen Yang +Date: Thu, 4 Apr 2019 00:04:09 +0800 +Subject: drm/mediatek: fix possible object reference leak + +[ Upstream commit 2ae2c3316fb77dcf64275d011596b60104c45426 ] + +The call to of_parse_phandle returns a node pointer with refcount +incremented thus it must be explicitly decremented after the last +usage. + +Detected by coccinelle with the following warnings: +drivers/gpu/drm/mediatek/mtk_hdmi.c:1521:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function. +drivers/gpu/drm/mediatek/mtk_hdmi.c:1524:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function. + +Signed-off-by: Wen Yang +Cc: CK Hu +Cc: Philipp Zabel +Cc: David Airlie +Cc: Daniel Vetter +Cc: Matthias Brugger +Cc: dri-devel@lists.freedesktop.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-mediatek@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: CK Hu +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c +index 200f75e1d6198..e7a6651ceeab1 100644 +--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c ++++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c +@@ -1528,6 +1528,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, + of_node_put(remote); + + hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); ++ of_node_put(i2c_np); + if (!hdmi->ddc_adpt) { + dev_err(dev, "Failed to get ddc i2c adapter by node\n"); + return -EINVAL; +-- +2.20.1 + diff --git a/queue-4.9/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch b/queue-4.9/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch new file mode 100644 index 00000000000..d7e05c4b866 --- /dev/null +++ b/queue-4.9/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch @@ -0,0 +1,52 @@ +From 885948b6d6e35bfff5df9ca9109816022c1e8f00 Mon Sep 17 00:00:00 2001 +From: Kaike Wan +Date: Mon, 18 Mar 2019 09:55:39 -0700 +Subject: IB/hfi1: Eliminate opcode tests on mr deref + +[ Upstream commit a8639a79e85c18c16c10089edd589c7948f19bbd ] + +When an old ack_queue entry is used to store an incoming request, it may +need to clean up the old entry if it is still referencing the +MR. Originally only RDMA READ request needed to reference MR on the +responder side and therefore the opcode was tested when cleaning up the +old entry. The introduction of tid rdma specific operations in the +ack_queue makes the specific opcode tests wrong. Multiple opcodes (RDMA +READ, TID RDMA READ, and TID RDMA WRITE) may need MR ref cleanup. + +Remove the opcode specific tests associated with the ack_queue. + +Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging") +Signed-off-by: Mike Marciniszyn +Signed-off-by: Kaike Wan +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/rc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c +index e8e0fa58cb713..b08786614c1b0 100644 +--- a/drivers/infiniband/hw/hfi1/rc.c ++++ b/drivers/infiniband/hw/hfi1/rc.c +@@ -2394,7 +2394,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) + update_ack_queue(qp, next); + } + e = &qp->s_ack_queue[qp->r_head_ack_queue]; +- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { ++ if (e->rdma_sge.mr) { + rvt_put_mr(e->rdma_sge.mr); + e->rdma_sge.mr = NULL; + } +@@ -2469,7 +2469,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) + update_ack_queue(qp, next); + } + e = &qp->s_ack_queue[qp->r_head_ack_queue]; +- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { ++ if (e->rdma_sge.mr) { + rvt_put_mr(e->rdma_sge.mr); + e->rdma_sge.mr = NULL; + } +-- +2.20.1 + diff --git a/queue-4.9/iommu-amd-set-exclusion-range-correctly.patch b/queue-4.9/iommu-amd-set-exclusion-range-correctly.patch new file mode 100644 index 00000000000..7a895dbdbc1 --- /dev/null +++ b/queue-4.9/iommu-amd-set-exclusion-range-correctly.patch @@ -0,0 +1,38 @@ +From c5a45c25141ee6be666e25c122bfc00a94057e11 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Fri, 12 Apr 2019 12:50:31 +0200 +Subject: iommu/amd: Set exclusion range correctly + +[ Upstream commit 3c677d206210f53a4be972211066c0f1cd47fe12 ] + +The exlcusion range limit register needs to contain the +base-address of the last page that is part of the range, as +bits 0-11 of this register are treated as 0xfff by the +hardware for comparisons. + +So correctly set the exclusion range in the hardware to the +last page which is _in_ the range. + +Fixes: b2026aa2dce44 ('x86, AMD IOMMU: add functions for programming IOMMU MMIO space') +Signed-off-by: Joerg Roedel +Signed-off-by: Sasha Levin +--- + drivers/iommu/amd_iommu_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c +index 157e93421fb81..13bbe5795e4e4 100644 +--- a/drivers/iommu/amd_iommu_init.c ++++ b/drivers/iommu/amd_iommu_init.c +@@ -318,7 +318,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val) + static void iommu_set_exclusion_range(struct amd_iommu *iommu) + { + u64 start = iommu->exclusion_start & PAGE_MASK; +- u64 limit = (start + iommu->exclusion_length) & PAGE_MASK; ++ u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK; + u64 entry; + + if (!iommu->exclusion_start) +-- +2.20.1 + diff --git a/queue-4.9/linux-kernel.h-use-parentheses-around-argument-in-u6.patch b/queue-4.9/linux-kernel.h-use-parentheses-around-argument-in-u6.patch new file mode 100644 index 00000000000..c77f99ef6a7 --- /dev/null +++ b/queue-4.9/linux-kernel.h-use-parentheses-around-argument-in-u6.patch @@ -0,0 +1,70 @@ +From 5e6c3610f8e6db43226f860e9e2638c60b551a87 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Fri, 29 Mar 2019 22:46:49 +0100 +Subject: linux/kernel.h: Use parentheses around argument in u64_to_user_ptr() + +[ Upstream commit a0fe2c6479aab5723239b315ef1b552673f434a3 ] + +Use parentheses around uses of the argument in u64_to_user_ptr() to +ensure that the cast doesn't apply to part of the argument. + +There are existing uses of the macro of the form + + u64_to_user_ptr(A + B) + +which expands to + + (void __user *)(uintptr_t)A + B + +(the cast applies to the first operand of the addition, the addition +is a pointer addition). This happens to still work as intended, the +semantic difference doesn't cause a difference in behavior. + +But I want to use u64_to_user_ptr() with a ternary operator in the +argument, like so: + + u64_to_user_ptr(A ? B : C) + +This currently doesn't work as intended. + +Signed-off-by: Jann Horn +Signed-off-by: Borislav Petkov +Reviewed-by: Mukesh Ojha +Cc: Andrei Vagin +Cc: Andrew Morton +Cc: Dan Carpenter +Cc: Greg Kroah-Hartman +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Jani Nikula +Cc: Kees Cook +Cc: Masahiro Yamada +Cc: NeilBrown +Cc: Peter Zijlstra +Cc: Qiaowei Ren +Cc: Thomas Gleixner +Cc: x86-ml +Link: https://lkml.kernel.org/r/20190329214652.258477-1-jannh@google.com +Signed-off-by: Sasha Levin +--- + include/linux/kernel.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/linux/kernel.h b/include/linux/kernel.h +index 61054f12be7cf..d83fc669eeac7 100644 +--- a/include/linux/kernel.h ++++ b/include/linux/kernel.h +@@ -55,8 +55,8 @@ + + #define u64_to_user_ptr(x) ( \ + { \ +- typecheck(u64, x); \ +- (void __user *)(uintptr_t)x; \ ++ typecheck(u64, (x)); \ ++ (void __user *)(uintptr_t)(x); \ + } \ + ) + +-- +2.20.1 + diff --git a/queue-4.9/mm-add-try_get_page-helper-function.patch b/queue-4.9/mm-add-try_get_page-helper-function.patch new file mode 100644 index 00000000000..2aabc8b191c --- /dev/null +++ b/queue-4.9/mm-add-try_get_page-helper-function.patch @@ -0,0 +1,58 @@ +From 11bc3db63760789a9cbe3ec2e4516bafd0bb7bcf Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Thu, 11 Apr 2019 10:14:59 -0700 +Subject: mm: add 'try_get_page()' helper function + +[ Upstream commit 88b1a17dfc3ed7728316478fae0f5ad508f50397 ] + +This is the same as the traditional 'get_page()' function, but instead +of unconditionally incrementing the reference count of the page, it only +does so if the count was "safe". It returns whether the reference count +was incremented (and is marked __must_check, since the caller obviously +has to be aware of it). + +Also like 'get_page()', you can't use this function unless you already +had a reference to the page. The intent is that you can use this +exactly like get_page(), but in situations where you want to limit the +maximum reference count. + +The code currently does an unconditional WARN_ON_ONCE() if we ever hit +the reference count issues (either zero or negative), as a notification +that the conditional non-increment actually happened. + +NOTE! The count access for the "safety" check is inherently racy, but +that doesn't matter since the buffer we use is basically half the range +of the reference count (ie we look at the sign of the count). + +Acked-by: Matthew Wilcox +Cc: Jann Horn +Cc: stable@kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + include/linux/mm.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/include/linux/mm.h b/include/linux/mm.h +index 11a5a46ce72be..e3c8d40a18b5b 100644 +--- a/include/linux/mm.h ++++ b/include/linux/mm.h +@@ -777,6 +777,15 @@ static inline void get_page(struct page *page) + get_zone_device_page(page); + } + ++static inline __must_check bool try_get_page(struct page *page) ++{ ++ page = compound_head(page); ++ if (WARN_ON_ONCE(page_ref_count(page) <= 0)) ++ return false; ++ page_ref_inc(page); ++ return true; ++} ++ + static inline void put_page(struct page *page) + { + page = compound_head(page); +-- +2.20.1 + diff --git a/queue-4.9/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch b/queue-4.9/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch new file mode 100644 index 00000000000..35700e2b6f6 --- /dev/null +++ b/queue-4.9/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch @@ -0,0 +1,59 @@ +From 5ddc2966a7c4c6fa554efd94280cde8fcdd9e479 Mon Sep 17 00:00:00 2001 +From: Stephane Eranian +Date: Wed, 6 Mar 2019 11:50:48 -0800 +Subject: perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS + +[ Upstream commit 583feb08e7f7ac9d533b446882eb3a54737a6dbb ] + +When an event is programmed with attr.wakeup_events=N (N>0), it means +the caller is interested in getting a user level notification after +N samples have been recorded in the kernel sampling buffer. + +With precise events on Intel processors, the kernel uses PEBS. +The kernel tries minimize sampling overhead by verifying +if the event configuration is compatible with multi-entry PEBS mode. +If so, the kernel is notified only when the buffer has reached its threshold. +Other PEBS operates in single-entry mode, the kenrel is notified for each +PEBS sample. + +The problem is that the current implementation look at frequency +mode and event sample_type but ignores the wakeup_events field. Thus, +it may not be possible to receive a notification after each precise event. + +This patch fixes this problem by disabling multi-entry PEBS if wakeup_events +is non-zero. + +Signed-off-by: Stephane Eranian +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Andi Kleen +Cc: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: Vince Weaver +Cc: kan.liang@intel.com +Link: https://lkml.kernel.org/r/20190306195048.189514-1-eranian@google.com +Signed-off-by: Ingo Molnar +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c +index 098ab775135fd..a30829052a006 100644 +--- a/arch/x86/events/intel/core.c ++++ b/arch/x86/events/intel/core.c +@@ -2867,7 +2867,7 @@ static int intel_pmu_hw_config(struct perf_event *event) + return ret; + + if (event->attr.precise_ip) { +- if (!event->attr.freq) { ++ if (!(event->attr.freq || event->attr.wakeup_events)) { + event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; + if (!(event->attr.sample_type & + ~intel_pmu_free_running_flags(event))) +-- +2.20.1 + diff --git a/queue-4.9/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch b/queue-4.9/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch new file mode 100644 index 00000000000..ae6bf3adac5 --- /dev/null +++ b/queue-4.9/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch @@ -0,0 +1,38 @@ +From 0faafd0fd64eab5a63fc0a4d26eb7a56397c9ca5 Mon Sep 17 00:00:00 2001 +From: Varun Prakash +Date: Fri, 5 Apr 2019 20:39:13 +0530 +Subject: scsi: csiostor: fix missing data copy in csio_scsi_err_handler() + +[ Upstream commit 5c2442fd78998af60e13aba506d103f7f43f8701 ] + +If scsi cmd sglist is not suitable for DDP then csiostor driver uses +preallocated buffers for DDP, because of this data copy is required from +DDP buffer to scsi cmd sglist before calling ->scsi_done(). + +Signed-off-by: Varun Prakash +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/csiostor/csio_scsi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c +index 89a52b941ea8d..894d97e4ace51 100644 +--- a/drivers/scsi/csiostor/csio_scsi.c ++++ b/drivers/scsi/csiostor/csio_scsi.c +@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req) + } + + out: +- if (req->nsge > 0) ++ if (req->nsge > 0) { + scsi_dma_unmap(cmnd); ++ if (req->dcopy && (host_status == DID_OK)) ++ host_status = csio_scsi_copy_to_sgl(hw, req); ++ } + + cmnd->result = (((host_status) << 16) | scsi_status); + cmnd->scsi_done(cmnd); +-- +2.20.1 + diff --git a/queue-4.9/series b/queue-4.9/series index c859c922e54..4f2b1da532a 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,3 +1,17 @@ scsi-libsas-fix-a-race-condition-when-smp-task-timeout.patch ubsan-fix-nasty-wbuiltin-declaration-mismatch-gcc-9-warnings.patch staging-greybus-power_supply-fix-prop-descriptor-request-size.patch +asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch +asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch +asoc-cs4270-set-auto-increment-bit-for-register-writ.patch +ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch +asoc-tlv320aic32x4-fix-common-pins.patch +drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch +perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch +linux-kernel.h-use-parentheses-around-argument-in-u6.patch +xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch +scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch +drm-mediatek-fix-possible-object-reference-leak.patch +virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch +iommu-amd-set-exclusion-range-correctly.patch +mm-add-try_get_page-helper-function.patch diff --git a/queue-4.9/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch b/queue-4.9/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch new file mode 100644 index 00000000000..8ad82c92afe --- /dev/null +++ b/queue-4.9/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch @@ -0,0 +1,44 @@ +From 55d23fde7e1b172c332679a7a589966c5cbe3fb5 Mon Sep 17 00:00:00 2001 +From: Dongli Zhang +Date: Wed, 27 Mar 2019 18:36:34 +0800 +Subject: virtio-blk: limit number of hw queues by nr_cpu_ids + +[ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ] + +When tag_set->nr_maps is 1, the block layer limits the number of hw queues +by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it +has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queues. + +In addition, specifically for pci scenario, when the 'num-queues' specified +by qemu is more than maxcpus, virtio-blk would not be able to allocate more +than maxcpus vectors in order to have a vector for each queue. As a result, +it falls back into MSI-X with one vector for config and one shared for +queues. + +Considering above reasons, this patch limits the number of hw queues used +by virtio-blk by nr_cpu_ids. + +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Dongli Zhang +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/virtio_blk.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c +index 10332c24f9610..44ef1d66caa68 100644 +--- a/drivers/block/virtio_blk.c ++++ b/drivers/block/virtio_blk.c +@@ -392,6 +392,8 @@ static int init_vq(struct virtio_blk *vblk) + if (err) + num_vqs = 1; + ++ num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs); ++ + vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL); + if (!vblk->vqs) + return -ENOMEM; +-- +2.20.1 + diff --git a/queue-4.9/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch b/queue-4.9/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch new file mode 100644 index 00000000000..d232a3469d5 --- /dev/null +++ b/queue-4.9/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch @@ -0,0 +1,52 @@ +From ccf8ba3957e3a3efba8c770ab011e59b09e8bb30 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Wed, 3 Apr 2019 20:22:42 -0700 +Subject: xtensa: fix initialization of pt_regs::syscall in start_thread + +[ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ] + +New pt_regs should indicate that there's no syscall, not that there's +syscall #0. While at it wrap macro body in do/while and parenthesize +macro arguments. + +Signed-off-by: Max Filippov +Signed-off-by: Sasha Levin +--- + arch/xtensa/include/asm/processor.h | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h +index 521c1e789e6e0..1fc0154597550 100644 +--- a/arch/xtensa/include/asm/processor.h ++++ b/arch/xtensa/include/asm/processor.h +@@ -180,15 +180,18 @@ struct thread_struct { + + /* Clearing a0 terminates the backtrace. */ + #define start_thread(regs, new_pc, new_sp) \ +- memset(regs, 0, sizeof(*regs)); \ +- regs->pc = new_pc; \ +- regs->ps = USER_PS_VALUE; \ +- regs->areg[1] = new_sp; \ +- regs->areg[0] = 0; \ +- regs->wmask = 1; \ +- regs->depc = 0; \ +- regs->windowbase = 0; \ +- regs->windowstart = 1; ++ do { \ ++ memset((regs), 0, sizeof(*(regs))); \ ++ (regs)->pc = (new_pc); \ ++ (regs)->ps = USER_PS_VALUE; \ ++ (regs)->areg[1] = (new_sp); \ ++ (regs)->areg[0] = 0; \ ++ (regs)->wmask = 1; \ ++ (regs)->depc = 0; \ ++ (regs)->windowbase = 0; \ ++ (regs)->windowstart = 1; \ ++ (regs)->syscall = NO_SYSCALL; \ ++ } while (0) + + /* Forward declaration */ + struct task_struct; +-- +2.20.1 +