From 540794e02131c07c2c38d1e1e3a49e2d2407e481 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 15:10:36 +0100 Subject: [PATCH] 4.19-stable patches added patches: media-usbtv-fix-deadlock-on-suspend.patch media-v4l-vsp1-fix-bru-null-pointer-access.patch media-v4l-vsp1-fix-uif-null-pointer-access.patch sh_eth-fix-trscer-mask-for-r7s9210.patch --- .../media-usbtv-fix-deadlock-on-suspend.patch | 42 +++++++++++++++++++ ...v4l-vsp1-fix-bru-null-pointer-access.patch | 32 ++++++++++++++ ...v4l-vsp1-fix-uif-null-pointer-access.patch | 35 ++++++++++++++++ queue-4.19/series | 4 ++ .../sh_eth-fix-trscer-mask-for-r7s9210.patch | 33 +++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 queue-4.19/media-usbtv-fix-deadlock-on-suspend.patch create mode 100644 queue-4.19/media-v4l-vsp1-fix-bru-null-pointer-access.patch create mode 100644 queue-4.19/media-v4l-vsp1-fix-uif-null-pointer-access.patch create mode 100644 queue-4.19/sh_eth-fix-trscer-mask-for-r7s9210.patch diff --git a/queue-4.19/media-usbtv-fix-deadlock-on-suspend.patch b/queue-4.19/media-usbtv-fix-deadlock-on-suspend.patch new file mode 100644 index 00000000000..ec8ae0534e5 --- /dev/null +++ b/queue-4.19/media-usbtv-fix-deadlock-on-suspend.patch @@ -0,0 +1,42 @@ +From 8a7e27fd5cd696ba564a3f62cedef7269cfd0723 Mon Sep 17 00:00:00 2001 +From: Maxim Mikityanskiy +Date: Fri, 5 Feb 2021 23:51:39 +0100 +Subject: media: usbtv: Fix deadlock on suspend + +From: Maxim Mikityanskiy + +commit 8a7e27fd5cd696ba564a3f62cedef7269cfd0723 upstream. + +usbtv doesn't support power management, so on system suspend the +.disconnect callback of the driver is called. The teardown sequence +includes a call to snd_card_free. Its implementation waits until the +refcount of the sound card device drops to zero, however, if its file is +open, snd_card_file_add takes a reference, which can't be dropped during +the suspend, because the userspace processes are already frozen at this +point. snd_card_free waits for completion forever, leading to a hang on +suspend. + +This commit fixes this deadlock condition by replacing snd_card_free +with snd_card_free_when_closed, that doesn't wait until all references +are released, allowing suspend to progress. + +Fixes: 63ddf68de52e ("[media] usbtv: add audio support") +Signed-off-by: Maxim Mikityanskiy +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/usbtv/usbtv-audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/usb/usbtv/usbtv-audio.c ++++ b/drivers/media/usb/usbtv/usbtv-audio.c +@@ -399,7 +399,7 @@ void usbtv_audio_free(struct usbtv *usbt + cancel_work_sync(&usbtv->snd_trigger); + + if (usbtv->snd && usbtv->udev) { +- snd_card_free(usbtv->snd); ++ snd_card_free_when_closed(usbtv->snd); + usbtv->snd = NULL; + } + } diff --git a/queue-4.19/media-v4l-vsp1-fix-bru-null-pointer-access.patch b/queue-4.19/media-v4l-vsp1-fix-bru-null-pointer-access.patch new file mode 100644 index 00000000000..15d468011a8 --- /dev/null +++ b/queue-4.19/media-v4l-vsp1-fix-bru-null-pointer-access.patch @@ -0,0 +1,32 @@ +From ac8d82f586c8692b501cb974604a71ef0e22a04c Mon Sep 17 00:00:00 2001 +From: Biju Das +Date: Mon, 1 Mar 2021 13:08:27 +0100 +Subject: media: v4l: vsp1: Fix bru null pointer access + +From: Biju Das + +commit ac8d82f586c8692b501cb974604a71ef0e22a04c upstream. + +RZ/G2L SoC has only BRS. This patch fixes null pointer access,when only +BRS is enabled. + +Fixes: cbb7fa49c7466("media: v4l: vsp1: Rename BRU to BRx") +Signed-off-by: Biju Das +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/vsp1/vsp1_drm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/platform/vsp1/vsp1_drm.c ++++ b/drivers/media/platform/vsp1/vsp1_drm.c +@@ -243,7 +243,7 @@ static int vsp1_du_pipeline_setup_brx(st + brx = &vsp1->bru->entity; + else if (pipe->brx && !drm_pipe->force_brx_release) + brx = pipe->brx; +- else if (!vsp1->bru->entity.pipe) ++ else if (vsp1_feature(vsp1, VSP1_HAS_BRU) && !vsp1->bru->entity.pipe) + brx = &vsp1->bru->entity; + else + brx = &vsp1->brs->entity; diff --git a/queue-4.19/media-v4l-vsp1-fix-uif-null-pointer-access.patch b/queue-4.19/media-v4l-vsp1-fix-uif-null-pointer-access.patch new file mode 100644 index 00000000000..a0f76686ebc --- /dev/null +++ b/queue-4.19/media-v4l-vsp1-fix-uif-null-pointer-access.patch @@ -0,0 +1,35 @@ +From 6732f313938027a910e1f7351951ff52c0329e70 Mon Sep 17 00:00:00 2001 +From: Biju Das +Date: Mon, 1 Mar 2021 13:08:28 +0100 +Subject: media: v4l: vsp1: Fix uif null pointer access + +From: Biju Das + +commit 6732f313938027a910e1f7351951ff52c0329e70 upstream. + +RZ/G2L SoC has no UIF. This patch fixes null pointer access, when UIF +module is not used. + +Fixes: 5e824f989e6e8("media: v4l: vsp1: Integrate DISCOM in display pipeline") +Signed-off-by: Biju Das +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/vsp1/vsp1_drm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/platform/vsp1/vsp1_drm.c ++++ b/drivers/media/platform/vsp1/vsp1_drm.c +@@ -460,9 +460,9 @@ static int vsp1_du_pipeline_setup_inputs + * make sure it is present in the pipeline's list of entities if it + * wasn't already. + */ +- if (!use_uif) { ++ if (drm_pipe->uif && !use_uif) { + drm_pipe->uif->pipe = NULL; +- } else if (!drm_pipe->uif->pipe) { ++ } else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + drm_pipe->uif->pipe = pipe; + list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); + } diff --git a/queue-4.19/series b/queue-4.19/series index 957314ad6b4..a565c483193 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -34,3 +34,7 @@ s390-cio-return-efault-if-copy_to_user-fails.patch drm-compat-clear-bounce-structures.patch drm-meson_drv-add-shutdown-function.patch s390-cio-return-efault-if-copy_to_user-fails-take-2.patch +sh_eth-fix-trscer-mask-for-r7s9210.patch +media-usbtv-fix-deadlock-on-suspend.patch +media-v4l-vsp1-fix-uif-null-pointer-access.patch +media-v4l-vsp1-fix-bru-null-pointer-access.patch diff --git a/queue-4.19/sh_eth-fix-trscer-mask-for-r7s9210.patch b/queue-4.19/sh_eth-fix-trscer-mask-for-r7s9210.patch new file mode 100644 index 00000000000..ca109500cf2 --- /dev/null +++ b/queue-4.19/sh_eth-fix-trscer-mask-for-r7s9210.patch @@ -0,0 +1,33 @@ +From 165bc5a4f30eee4735845aa7dbd6b738643f2603 Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Sun, 28 Feb 2021 23:27:32 +0300 +Subject: sh_eth: fix TRSCER mask for R7S9210 + +From: Sergey Shtylyov + +commit 165bc5a4f30eee4735845aa7dbd6b738643f2603 upstream. + +According to the RZ/A2M Group User's Manual: Hardware, Rev. 2.00, +the TRSCER register has bit 9 reserved, hence we can't use the driver's +default TRSCER mask. Add the explicit initializer for sh_eth_cpu_data:: +trscer_err_mask for R7S9210. + +Fixes: 6e0bb04d0e4f ("sh_eth: Add R7S9210 support") +Signed-off-by: Sergey Shtylyov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/renesas/sh_eth.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/renesas/sh_eth.c ++++ b/drivers/net/ethernet/renesas/sh_eth.c +@@ -825,6 +825,8 @@ static struct sh_eth_cpu_data r7s9210_da + + .fdr_value = 0x0000070f, + ++ .trscer_err_mask = DESC_I_RINT8 | DESC_I_RINT5, ++ + .apr = 1, + .mpr = 1, + .tpauser = 1, -- 2.47.3