]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Fix kernel panic by dal_gpio_open() error
authorTakashi Iwai <tiwai@suse.de>
Fri, 23 Oct 2020 07:46:54 +0000 (09:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:43:34 +0000 (11:43 +0100)
commit 920bb38c518408fa2600eaefa0af9e82cf48f166 upstream.

Currently both error code paths handled in dal_gpio_open_ex() issues
ASSERT_CRITICAL(), and this leads to a kernel panic unnecessarily if
CONFIG_KGDB is enabled.  Since basically both are non-critical errors
and can be recovered, drop those assert calls and use a safer one,
BREAK_TO_DEBUGGER(), for allowing the debugging, instead.

BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1177973
Cc: <stable@vger.kernel.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c

index f8f85490e77e20d8494e9356a6e4133cbaedf7ca..8a6fb58d019947819b13a5b53a36b4c9c32f8234 100644 (file)
@@ -63,13 +63,13 @@ enum gpio_result dal_gpio_open_ex(
        enum gpio_mode mode)
 {
        if (gpio->pin) {
-               ASSERT_CRITICAL(false);
+               BREAK_TO_DEBUGGER();
                return GPIO_RESULT_ALREADY_OPENED;
        }
 
        // No action if allocation failed during gpio construct
        if (!gpio->hw_container.ddc) {
-               ASSERT_CRITICAL(false);
+               BREAK_TO_DEBUGGER();
                return GPIO_RESULT_NON_SPECIFIC_ERROR;
        }
        gpio->mode = mode;