From f519b2663dc9e8ac978b5c64f1659d59c3c48777 Mon Sep 17 00:00:00 2001 From: Petr Cvek Date: Fri, 16 Nov 2018 02:43:43 +0100 Subject: [PATCH] [RFC] [PATCH] Bug 105725 - WARNING: CPU: 0 PID: 487 at drivers/gpu/drm/amd/amdgpu/../display /dc/gpio/gpio_base.c:64 dal_gpio_open_ex+0xc/0x30 [amdgpu] Signed-off-by: Petr Cvek --- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c index f20161c5706d..6118d45bd527 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c @@ -472,6 +472,8 @@ void dal_gpio_destroy_ddc( *ddc = NULL; } +DEFINE_SEMAPHORE(my_ddc_sem); + enum gpio_result dal_ddc_open( struct ddc *ddc, enum gpio_mode mode, @@ -483,6 +485,8 @@ enum gpio_result dal_ddc_open( struct hw_gpio *hw_data; struct hw_gpio *hw_clock; + down_interruptible(&my_ddc_sem); + result = dal_gpio_open_ex(ddc->pin_data, mode); if (result != GPIO_RESULT_OK) { @@ -589,5 +593,7 @@ void dal_ddc_close( { dal_gpio_close(ddc->pin_clock); dal_gpio_close(ddc->pin_data); + + up(&my_ddc_sem); } -- 2.19.1