Patch "drm/ast: Fix soft lockup" has been added to the 6.1-stable tree
This is a note to let you know that I've just added the patch titled drm/ast: Fix soft lockup to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-ast-fix-soft-lockup.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From bc004f5038220b1891ef4107134ccae44be55109 Mon Sep 17 00:00:00 2001 From: Jammy Huang Date: Wed, 3 Apr 2024 17:02:46 +0800 Subject: drm/ast: Fix soft lockup From: Jammy Huang commit bc004f5038220b1891ef4107134ccae44be55109 upstream. There is a while-loop in ast_dp_set_on_off() that could lead to infinite-loop. This is because the register, VGACRI-Dx, checked in this API is a scratch register actually controlled by a MCU, named DPMCU, in BMC. These scratch registers are protected by scu-lock. If suc-lock is not off, DPMCU can not update these registers and then host will have soft lockup due to never updated status. DPMCU is used to control DP and relative registers to handshake with host's VGA driver. Even the most time-consuming task, DP's link training, is less than 100ms. 200ms should be enough. Signed-off-by: Jammy Huang Fixes: 594e9c04b586 ("drm/ast: Create the driver for ASPEED proprietory Display-Port") Reviewed-by: Jocelyn Falempe Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Cc: KuoHsiang Chou Cc: Thomas Zimmermann Cc: Dave Airlie Cc: Jocelyn Falempe Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Link: https://patchwork.freedesktop.org/patch/msgid/20240403090246.1495487-1-jammy_hu...@aspeedtech.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ast/ast_dp.c |3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -190,6 +190,7 @@ void ast_dp_set_on_off(struct drm_device { struct ast_private *ast = to_ast_private(dev); u8 video_on_off = on; + u32 i = 0; // Video On/Off ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE3, (u8) ~AST_DP_VIDEO_ENABLE, on); @@ -202,6 +203,8 @@ void ast_dp_set_on_off(struct drm_device ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) { // wait 1 ms mdelay(1); + if (++i > 200) + break; } } } Patches currently in stable-queue which might be from jammy_hu...@aspeedtech.com are queue-6.1/drm-ast-fix-soft-lockup.patch
Patch "drm/ast: Fix soft lockup" has been added to the 6.6-stable tree
This is a note to let you know that I've just added the patch titled drm/ast: Fix soft lockup to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-ast-fix-soft-lockup.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From bc004f5038220b1891ef4107134ccae44be55109 Mon Sep 17 00:00:00 2001 From: Jammy Huang Date: Wed, 3 Apr 2024 17:02:46 +0800 Subject: drm/ast: Fix soft lockup From: Jammy Huang commit bc004f5038220b1891ef4107134ccae44be55109 upstream. There is a while-loop in ast_dp_set_on_off() that could lead to infinite-loop. This is because the register, VGACRI-Dx, checked in this API is a scratch register actually controlled by a MCU, named DPMCU, in BMC. These scratch registers are protected by scu-lock. If suc-lock is not off, DPMCU can not update these registers and then host will have soft lockup due to never updated status. DPMCU is used to control DP and relative registers to handshake with host's VGA driver. Even the most time-consuming task, DP's link training, is less than 100ms. 200ms should be enough. Signed-off-by: Jammy Huang Fixes: 594e9c04b586 ("drm/ast: Create the driver for ASPEED proprietory Display-Port") Reviewed-by: Jocelyn Falempe Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Cc: KuoHsiang Chou Cc: Thomas Zimmermann Cc: Dave Airlie Cc: Jocelyn Falempe Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Link: https://patchwork.freedesktop.org/patch/msgid/20240403090246.1495487-1-jammy_hu...@aspeedtech.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ast/ast_dp.c |3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -180,6 +180,7 @@ void ast_dp_set_on_off(struct drm_device { struct ast_device *ast = to_ast_device(dev); u8 video_on_off = on; + u32 i = 0; // Video On/Off ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE3, (u8) ~AST_DP_VIDEO_ENABLE, on); @@ -192,6 +193,8 @@ void ast_dp_set_on_off(struct drm_device ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) { // wait 1 ms mdelay(1); + if (++i > 200) + break; } } } Patches currently in stable-queue which might be from jammy_hu...@aspeedtech.com are queue-6.6/drm-ast-fix-soft-lockup.patch
Patch "drm/ast: Fix soft lockup" has been added to the 6.8-stable tree
This is a note to let you know that I've just added the patch titled drm/ast: Fix soft lockup to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-ast-fix-soft-lockup.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From bc004f5038220b1891ef4107134ccae44be55109 Mon Sep 17 00:00:00 2001 From: Jammy Huang Date: Wed, 3 Apr 2024 17:02:46 +0800 Subject: drm/ast: Fix soft lockup From: Jammy Huang commit bc004f5038220b1891ef4107134ccae44be55109 upstream. There is a while-loop in ast_dp_set_on_off() that could lead to infinite-loop. This is because the register, VGACRI-Dx, checked in this API is a scratch register actually controlled by a MCU, named DPMCU, in BMC. These scratch registers are protected by scu-lock. If suc-lock is not off, DPMCU can not update these registers and then host will have soft lockup due to never updated status. DPMCU is used to control DP and relative registers to handshake with host's VGA driver. Even the most time-consuming task, DP's link training, is less than 100ms. 200ms should be enough. Signed-off-by: Jammy Huang Fixes: 594e9c04b586 ("drm/ast: Create the driver for ASPEED proprietory Display-Port") Reviewed-by: Jocelyn Falempe Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Cc: KuoHsiang Chou Cc: Thomas Zimmermann Cc: Dave Airlie Cc: Jocelyn Falempe Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Link: https://patchwork.freedesktop.org/patch/msgid/20240403090246.1495487-1-jammy_hu...@aspeedtech.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ast/ast_dp.c |3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -180,6 +180,7 @@ void ast_dp_set_on_off(struct drm_device { struct ast_device *ast = to_ast_device(dev); u8 video_on_off = on; + u32 i = 0; // Video On/Off ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE3, (u8) ~AST_DP_VIDEO_ENABLE, on); @@ -192,6 +193,8 @@ void ast_dp_set_on_off(struct drm_device ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) { // wait 1 ms mdelay(1); + if (++i > 200) + break; } } } Patches currently in stable-queue which might be from jammy_hu...@aspeedtech.com are queue-6.8/drm-ast-fix-soft-lockup.patch
Re: [PATCH] drm/ast: Fix soft lockup
Hi Am 01.04.24 um 04:20 schrieb 黃立銘: Hi Thomas and Jocelyn, What we do in ast_dp_set_on_off() is a handshake between host driver and bmc-fw to confirm the operation, on/off, is completed. We use some scratch registers in bmc to handshake with host. This handshake only work if BMC's scu-lock is opened. If scu-lock is opened too late, then it could lead to this issue. Thanks a lot. Can you please send a new version of this patch with this information in the commit message? Please also mention why 200 ms is a good upper limit. The code currently waits and then possibly breaks the loop. Should the if-branch be located before the mdelay() statement to avoid any unnecessary waiting? Please also send the patch from your Aspeed email address. Our scripts do not accept patches where the sender differs from the Signed-off-by tag. Best regards Thomas Best regards Jammy Thomas Zimmermann 於 2024年3月28日 週四 上午4:28寫道: Hi Am 27.03.24 um 09:53 schrieb Jocelyn Falempe: Hi, Thanks for your patch. I'm wondering how you can trigger this infinite loop ? Yeah, a bit more context for this bug would be welcome. It's hard to judge the fix without. Best regards Thomas Also this looks like a simple fix, that can be easily backported, so I'm adding stable in Cc. If Thomas has no objections, I can push it to drm-misc-fixes. Reviewed-by: Jocelyn Falempe -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg) -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Re: [PATCH] drm/ast: Fix soft lockup
Hi Thomas and Jocelyn, What we do in ast_dp_set_on_off() is a handshake between host driver and bmc-fw to confirm the operation, on/off, is completed. We use some scratch registers in bmc to handshake with host. This handshake only work if BMC's scu-lock is opened. If scu-lock is opened too late, then it could lead to this issue. Best regards Jammy Thomas Zimmermann 於 2024年3月28日 週四 上午4:28寫道: > > Hi > > Am 27.03.24 um 09:53 schrieb Jocelyn Falempe: > > Hi, > > > > Thanks for your patch. > > I'm wondering how you can trigger this infinite loop ? > > Yeah, a bit more context for this bug would be welcome. It's hard to > judge the fix without. > > Best regards > Thomas > > > > > Also this looks like a simple fix, that can be easily backported, so > > I'm adding stable in Cc. > > > > If Thomas has no objections, I can push it to drm-misc-fixes. > > > > Reviewed-by: Jocelyn Falempe > > > > > > -- > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Frankenstrasse 146, 90461 Nuernberg, Germany > GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman > HRB 36809 (AG Nuernberg) >
Re: [PATCH] drm/ast: Fix soft lockup
Hi Thomas and Jocelyn, What we do in ast_dp_set_on_off() is a handshake between host driver and bmc-fw to confirm the operation, on/off, is completed. We use some scratch registers in bmc to handshake with host. This handshake only work if BMC's scu-lock is opened. If scu-lock is opened too late, then it could lead to this issue. Best regards Jammy Thomas Zimmermann 於 2024年3月28日 週四 上午4:28寫道: > Hi > > Am 27.03.24 um 09:53 schrieb Jocelyn Falempe: > > Hi, > > > > Thanks for your patch. > > I'm wondering how you can trigger this infinite loop ? > > Yeah, a bit more context for this bug would be welcome. It's hard to > judge the fix without. > > Best regards > Thomas > > > > > Also this looks like a simple fix, that can be easily backported, so > > I'm adding stable in Cc. > > > > If Thomas has no objections, I can push it to drm-misc-fixes. > > > > Reviewed-by: Jocelyn Falempe > > > > > > -- > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Frankenstrasse 146, 90461 Nuernberg, Germany > GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman > HRB 36809 (AG Nuernberg) > >
Re: [PATCH] drm/ast: Fix soft lockup
Hi Am 27.03.24 um 09:53 schrieb Jocelyn Falempe: Hi, Thanks for your patch. I'm wondering how you can trigger this infinite loop ? Yeah, a bit more context for this bug would be welcome. It's hard to judge the fix without. Best regards Thomas Also this looks like a simple fix, that can be easily backported, so I'm adding stable in Cc. If Thomas has no objections, I can push it to drm-misc-fixes. Reviewed-by: Jocelyn Falempe -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Re: [PATCH] drm/ast: Fix soft lockup
Hi, Thanks for your patch. I'm wondering how you can trigger this infinite loop ? Also this looks like a simple fix, that can be easily backported, so I'm adding stable in Cc. If Thomas has no objections, I can push it to drm-misc-fixes. Reviewed-by: Jocelyn Falempe -- Jocelyn On 25/03/2024 04:35, Jammy Huang wrote: Avoid infinite-loop in ast_dp_set_on_off(). Signed-off-by: Jammy Huang --- drivers/gpu/drm/ast/ast_dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index ebb6d8ebd44e..1e9259416980 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -180,6 +180,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) { struct ast_device *ast = to_ast_device(dev); u8 video_on_off = on; + u32 i = 0; // Video On/Off ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE3, (u8) ~AST_DP_VIDEO_ENABLE, on); @@ -192,6 +193,8 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) { // wait 1 ms mdelay(1); + if (++i > 200) + break; } } } base-commit: b0546776ad3f332e215cebc0b063ba4351971cca
[PATCH] drm/ast: Fix soft lockup
Avoid infinite-loop in ast_dp_set_on_off(). Signed-off-by: Jammy Huang --- drivers/gpu/drm/ast/ast_dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index ebb6d8ebd44e..1e9259416980 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -180,6 +180,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) { struct ast_device *ast = to_ast_device(dev); u8 video_on_off = on; + u32 i = 0; // Video On/Off ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE3, (u8) ~AST_DP_VIDEO_ENABLE, on); @@ -192,6 +193,8 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) { // wait 1 ms mdelay(1); + if (++i > 200) + break; } } } base-commit: b0546776ad3f332e215cebc0b063ba4351971cca -- 2.25.1