From: Greg Kroah-Hartman Date: Thu, 8 Feb 2018 17:16:10 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.15.3~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca2efa7b44c4b1421b0316b24a86981ab2514e65;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: asoc-rsnd-avoid-duplicate-free_irq.patch asoc-rsnd-don-t-call-free_irq-on-parent-ssi.patch asoc-simple-card-fix-misleading-error-message.patch crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch drm-rcar-du-fix-race-condition-when-disabling-planes-at-crtc-stop.patch drm-rcar-du-use-the-vbk-interrupt-for-vblank-events.patch --- diff --git a/queue-4.9/asoc-rsnd-avoid-duplicate-free_irq.patch b/queue-4.9/asoc-rsnd-avoid-duplicate-free_irq.patch new file mode 100644 index 00000000000..bee898754a3 --- /dev/null +++ b/queue-4.9/asoc-rsnd-avoid-duplicate-free_irq.patch @@ -0,0 +1,43 @@ +From e0936c3471a8411a5df327641fa3ffe12a2fb07b Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Wed, 9 Aug 2017 02:16:20 +0000 +Subject: ASoC: rsnd: avoid duplicate free_irq() + +From: Kuninori Morimoto + +commit e0936c3471a8411a5df327641fa3ffe12a2fb07b upstream. + +commit 1f8754d4daea5f ("ASoC: rsnd: don't call free_irq() on +Parent SSI") fixed Parent SSI duplicate free_irq(). +But on Renesas Sound, not only Parent SSI but also Multi SSI +have same issue. +This patch avoid duplicate free_irq() if it was not pure SSI. + +Fixes: 1f8754d4daea5f ("ASoC: rsnd: don't call free_irq() on Parent SSI") +Signed-off-by: Kuninori Morimoto +Signed-off-by: Mark Brown +Signed-off-by: thongsyho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sh/rcar/ssi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -699,12 +699,12 @@ static int rsnd_ssi_dma_remove(struct rs + struct rsnd_priv *priv) + { + struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); +- struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io); ++ struct rsnd_mod *pure_ssi_mod = rsnd_io_to_mod_ssi(io); + struct device *dev = rsnd_priv_to_dev(priv); + int irq = ssi->irq; + +- /* Do nothing for SSI parent mod */ +- if (ssi_parent_mod == mod) ++ /* Do nothing if non SSI (= SSI parent, multi SSI) mod */ ++ if (pure_ssi_mod != mod) + return 0; + + /* PIO will request IRQ again */ diff --git a/queue-4.9/asoc-rsnd-don-t-call-free_irq-on-parent-ssi.patch b/queue-4.9/asoc-rsnd-don-t-call-free_irq-on-parent-ssi.patch new file mode 100644 index 00000000000..39df5f42c74 --- /dev/null +++ b/queue-4.9/asoc-rsnd-don-t-call-free_irq-on-parent-ssi.patch @@ -0,0 +1,43 @@ +From 1f8754d4daea5f257370a52a30fcb22798c54516 Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Tue, 16 May 2017 01:48:24 +0000 +Subject: ASoC: rsnd: don't call free_irq() on Parent SSI + +From: Kuninori Morimoto + +commit 1f8754d4daea5f257370a52a30fcb22798c54516 upstream. + +If SSI uses shared pin, some SSI will be used as parent SSI. +Then, normal SSI's remove and Parent SSI's remove +(these are same SSI) will be called when unbind or remove timing. +In this case, free_irq() will be called twice. +This patch solve this issue. + +Signed-off-by: Kuninori Morimoto +Tested-by: Hiroyuki Yokoyama +Reported-by: Hiroyuki Yokoyama +Signed-off-by: Mark Brown +Signed-off-by: thongsyho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sh/rcar/ssi.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -699,9 +699,14 @@ static int rsnd_ssi_dma_remove(struct rs + struct rsnd_priv *priv) + { + struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); ++ struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io); + struct device *dev = rsnd_priv_to_dev(priv); + int irq = ssi->irq; + ++ /* Do nothing for SSI parent mod */ ++ if (ssi_parent_mod == mod) ++ return 0; ++ + /* PIO will request IRQ again */ + devm_free_irq(dev, irq, mod); + diff --git a/queue-4.9/asoc-simple-card-fix-misleading-error-message.patch b/queue-4.9/asoc-simple-card-fix-misleading-error-message.patch new file mode 100644 index 00000000000..9f5420e0c88 --- /dev/null +++ b/queue-4.9/asoc-simple-card-fix-misleading-error-message.patch @@ -0,0 +1,45 @@ +From 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b Mon Sep 17 00:00:00 2001 +From: Julian Scheel +Date: Wed, 24 May 2017 12:28:23 +0200 +Subject: ASoC: simple-card: Fix misleading error message + +From: Julian Scheel + +commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream. + +In case cpu could not be found the error message would always refer to +/codec/ not being found in DT. Fix this by catching the cpu node not found +case explicitly. + +Signed-off-by: Julian Scheel +Signed-off-by: Mark Brown +Signed-off-by: thongsyho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/generic/simple-card.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/sound/soc/generic/simple-card.c ++++ b/sound/soc/generic/simple-card.c +@@ -232,13 +232,19 @@ static int asoc_simple_card_dai_link_of( + snprintf(prop, sizeof(prop), "%scpu", prefix); + cpu = of_get_child_by_name(node, prop); + ++ if (!cpu) { ++ ret = -EINVAL; ++ dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); ++ goto dai_link_of_err; ++ } ++ + snprintf(prop, sizeof(prop), "%splat", prefix); + plat = of_get_child_by_name(node, prop); + + snprintf(prop, sizeof(prop), "%scodec", prefix); + codec = of_get_child_by_name(node, prop); + +- if (!cpu || !codec) { ++ if (!codec) { + ret = -EINVAL; + dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); + goto dai_link_of_err; diff --git a/queue-4.9/crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch b/queue-4.9/crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch new file mode 100644 index 00000000000..a36ca1b539c --- /dev/null +++ b/queue-4.9/crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch @@ -0,0 +1,40 @@ +From 5c6ac1d4f8fbdbed65dbeb8cf149d736409d16a1 Mon Sep 17 00:00:00 2001 +From: Robert Baronescu +Date: Tue, 10 Oct 2017 13:21:59 +0300 +Subject: crypto: tcrypt - fix S/G table for test_aead_speed() + +From: Robert Baronescu + +commit 5c6ac1d4f8fbdbed65dbeb8cf149d736409d16a1 upstream. + +In case buffer length is a multiple of PAGE_SIZE, +the S/G table is incorrectly generated. +Fix this by handling buflen = k * PAGE_SIZE separately. + +Signed-off-by: Robert Baronescu +Signed-off-by: Herbert Xu +Signed-off-by: Horia Geantă +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/tcrypt.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/crypto/tcrypt.c ++++ b/crypto/tcrypt.c +@@ -223,11 +223,13 @@ static void sg_init_aead(struct scatterl + } + + sg_init_table(sg, np + 1); +- np--; ++ if (rem) ++ np--; + for (k = 0; k < np; k++) + sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE); + +- sg_set_buf(&sg[k + 1], xbuf[k], rem); ++ if (rem) ++ sg_set_buf(&sg[k + 1], xbuf[k], rem); + } + + static void test_aead_speed(const char *algo, int enc, unsigned int secs, diff --git a/queue-4.9/drm-rcar-du-fix-race-condition-when-disabling-planes-at-crtc-stop.patch b/queue-4.9/drm-rcar-du-fix-race-condition-when-disabling-planes-at-crtc-stop.patch new file mode 100644 index 00000000000..7cd6f2926cc --- /dev/null +++ b/queue-4.9/drm-rcar-du-fix-race-condition-when-disabling-planes-at-crtc-stop.patch @@ -0,0 +1,150 @@ +From 641307df71fe77d7b38a477067495ede05d47295 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Sat, 29 Jul 2017 02:31:33 +0300 +Subject: drm: rcar-du: Fix race condition when disabling planes at CRTC stop + +From: Laurent Pinchart + +commit 641307df71fe77d7b38a477067495ede05d47295 upstream. + +When stopping the CRTC the driver must disable all planes and wait for +the change to take effect at the next vblank. Merely calling +drm_crtc_wait_one_vblank() is not enough, as the function doesn't +include any mechanism to handle the race with vblank interrupts. + +Replace the drm_crtc_wait_one_vblank() call with a manual mechanism that +handles the vblank interrupt race. + +Signed-off-by: Laurent Pinchart +Reviewed-by: Kieran Bingham +Signed-off-by: thongsyho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 53 +++++++++++++++++++++++++++++---- + drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 8 ++++ + 2 files changed, 55 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +@@ -392,6 +392,31 @@ static void rcar_du_crtc_start(struct rc + rcrtc->started = true; + } + ++static void rcar_du_crtc_disable_planes(struct rcar_du_crtc *rcrtc) ++{ ++ struct rcar_du_device *rcdu = rcrtc->group->dev; ++ struct drm_crtc *crtc = &rcrtc->crtc; ++ u32 status; ++ /* Make sure vblank interrupts are enabled. */ ++ drm_crtc_vblank_get(crtc); ++ /* ++ * Disable planes and calculate how many vertical blanking interrupts we ++ * have to wait for. If a vertical blanking interrupt has been triggered ++ * but not processed yet, we don't know whether it occurred before or ++ * after the planes got disabled. We thus have to wait for two vblank ++ * interrupts in that case. ++ */ ++ spin_lock_irq(&rcrtc->vblank_lock); ++ rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0); ++ status = rcar_du_crtc_read(rcrtc, DSSR); ++ rcrtc->vblank_count = status & DSSR_VBK ? 2 : 1; ++ spin_unlock_irq(&rcrtc->vblank_lock); ++ if (!wait_event_timeout(rcrtc->vblank_wait, rcrtc->vblank_count == 0, ++ msecs_to_jiffies(100))) ++ dev_warn(rcdu->dev, "vertical blanking timeout\n"); ++ drm_crtc_vblank_put(crtc); ++} ++ + static void rcar_du_crtc_stop(struct rcar_du_crtc *rcrtc) + { + struct drm_crtc *crtc = &rcrtc->crtc; +@@ -400,17 +425,16 @@ static void rcar_du_crtc_stop(struct rca + return; + + /* Disable all planes and wait for the change to take effect. This is +- * required as the DSnPR registers are updated on vblank, and no vblank +- * will occur once the CRTC is stopped. Disabling planes when starting +- * the CRTC thus wouldn't be enough as it would start scanning out +- * immediately from old frame buffers until the next vblank. ++ * required as the plane enable registers are updated on vblank, and no ++ * vblank will occur once the CRTC is stopped. Disabling planes when ++ * starting the CRTC thus wouldn't be enough as it would start scanning ++ * out immediately from old frame buffers until the next vblank. + * + * This increases the CRTC stop delay, especially when multiple CRTCs + * are stopped in one operation as we now wait for one vblank per CRTC. + * Whether this can be improved needs to be researched. + */ +- rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0); +- drm_crtc_wait_one_vblank(crtc); ++ rcar_du_crtc_disable_planes(rcrtc); + + /* Disable vertical blanking interrupt reporting. We first need to wait + * for page flip completion before stopping the CRTC as userspace +@@ -548,10 +572,25 @@ static irqreturn_t rcar_du_crtc_irq(int + irqreturn_t ret = IRQ_NONE; + u32 status; + ++ spin_lock(&rcrtc->vblank_lock); ++ + status = rcar_du_crtc_read(rcrtc, DSSR); + rcar_du_crtc_write(rcrtc, DSRCR, status & DSRCR_MASK); + + if (status & DSSR_VBK) { ++ /* ++ * Wake up the vblank wait if the counter reaches 0. This must ++ * be protected by the vblank_lock to avoid races in ++ * rcar_du_crtc_disable_planes(). ++ */ ++ if (rcrtc->vblank_count) { ++ if (--rcrtc->vblank_count == 0) ++ wake_up(&rcrtc->vblank_wait); ++ } ++ } ++ spin_unlock(&rcrtc->vblank_lock); ++ ++ if (status & DSSR_VBK) { + drm_crtc_handle_vblank(&rcrtc->crtc); + rcar_du_crtc_finish_page_flip(rcrtc); + ret = IRQ_HANDLED; +@@ -606,6 +645,8 @@ int rcar_du_crtc_create(struct rcar_du_g + } + + init_waitqueue_head(&rcrtc->flip_wait); ++ init_waitqueue_head(&rcrtc->vblank_wait); ++ spin_lock_init(&rcrtc->vblank_lock); + + rcrtc->group = rgrp; + rcrtc->mmio_offset = mmio_offsets[index]; +--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h ++++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h +@@ -15,6 +15,7 @@ + #define __RCAR_DU_CRTC_H__ + + #include ++#include + #include + + #include +@@ -33,6 +34,9 @@ struct rcar_du_vsp; + * @started: whether the CRTC has been started and is running + * @event: event to post when the pending page flip completes + * @flip_wait: wait queue used to signal page flip completion ++ * @vblank_lock: protects vblank_wait and vblank_count ++ * @vblank_wait: wait queue used to signal vertical blanking ++ * @vblank_count: number of vertical blanking interrupts to wait for + * @outputs: bitmask of the outputs (enum rcar_du_output) driven by this CRTC + * @group: CRTC group this CRTC belongs to + */ +@@ -48,6 +52,10 @@ struct rcar_du_crtc { + struct drm_pending_vblank_event *event; + wait_queue_head_t flip_wait; + ++ spinlock_t vblank_lock; ++ wait_queue_head_t vblank_wait; ++ unsigned int vblank_count; ++ + unsigned int outputs; + + struct rcar_du_group *group; diff --git a/queue-4.9/drm-rcar-du-use-the-vbk-interrupt-for-vblank-events.patch b/queue-4.9/drm-rcar-du-use-the-vbk-interrupt-for-vblank-events.patch new file mode 100644 index 00000000000..b417e865c98 --- /dev/null +++ b/queue-4.9/drm-rcar-du-use-the-vbk-interrupt-for-vblank-events.patch @@ -0,0 +1,35 @@ +From cbbb90b0c084d7dfb2ed8e3fecf8df200fbdd2a0 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Mon, 10 Jul 2017 23:46:39 +0300 +Subject: drm: rcar-du: Use the VBK interrupt for vblank events + +From: Laurent Pinchart + +commit cbbb90b0c084d7dfb2ed8e3fecf8df200fbdd2a0 upstream. + +When implementing support for interlaced modes, the driver switched from +reporting vblank events on the vertical blanking (VBK) interrupt to the +frame end interrupt (FRM). This incorrectly divided the reported refresh +rate by two. Fix it by moving back to the VBK interrupt. + +Fixes: 906eff7fcada ("drm: rcar-du: Implement support for interlaced modes") +Signed-off-by: Laurent Pinchart +Reviewed-by: Kieran Bingham +Signed-off-by: thongsyho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +@@ -551,7 +551,7 @@ static irqreturn_t rcar_du_crtc_irq(int + status = rcar_du_crtc_read(rcrtc, DSSR); + rcar_du_crtc_write(rcrtc, DSRCR, status & DSRCR_MASK); + +- if (status & DSSR_FRM) { ++ if (status & DSSR_VBK) { + drm_crtc_handle_vblank(&rcrtc->crtc); + rcar_du_crtc_finish_page_flip(rcrtc); + ret = IRQ_HANDLED; diff --git a/queue-4.9/series b/queue-4.9/series index 15db3734b2b..25f2af01c4e 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -82,3 +82,9 @@ kvm-x86-add-ibpb-support.patch kvm-vmx-emulate-msr_ia32_arch_capabilities.patch kvm-vmx-allow-direct-access-to-msr_ia32_spec_ctrl.patch kvm-svm-allow-direct-access-to-msr_ia32_spec_ctrl.patch +crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch +asoc-simple-card-fix-misleading-error-message.patch +asoc-rsnd-don-t-call-free_irq-on-parent-ssi.patch +asoc-rsnd-avoid-duplicate-free_irq.patch +drm-rcar-du-use-the-vbk-interrupt-for-vblank-events.patch +drm-rcar-du-fix-race-condition-when-disabling-planes-at-crtc-stop.patch