diff mbox

drm/amdgpu/display: fix wrong enum type for ddc_result

Message ID 20180202015505.10416-1-dbehr@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Dominik Behr Feb. 2, 2018, 1:55 a.m. UTC
From: Dominik Behr <dbehr@chromium.org>

v2: now with fixed result comparison and spelling fixes

Signed-off-by: Dominik Behr <dbehr@chromium.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c               | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c           | 4 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c            | 4 ++--
 drivers/gpu/drm/amd/display/include/ddc_service_types.h     | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

Comments

Michel Dänzer Feb. 2, 2018, 9:02 a.m. UTC | #1
Adding the amd-gfx list, please always send amdgpu patches there.


On 2018-02-02 02:55 AM, dbehr@chromium.org wrote:
> From: Dominik Behr <dbehr@chromium.org>
> 
> v2: now with fixed result comparison and spelling fixes
> 
> Signed-off-by: Dominik Behr <dbehr@chromium.org>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c               | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c           | 4 ++--
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c            | 4 ++--
>  drivers/gpu/drm/amd/display/include/ddc_service_types.h     | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 1e8a21b67df7..3b05900ccccd 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>  		 msg->address,
>  		 msg->buffer,
>  		 msg->size,
> -		 r == DDC_RESULT_SUCESSFULL);
> +		 r == DDC_RESULT_SUCCESSFUL);
>  #endif
>  
>  	return msg->size;
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0023754e034b..3abd0f1a287f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>  				&edp_config_set.raw,
>  				sizeof(edp_config_set.raw));
>  
> -			ASSERT(result == DDC_RESULT_SUCESSFULL);
> +			ASSERT(result == DDC_RESULT_SUCCESSFUL);
>  		}
>  	}
>  	dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index d5294798b0a5..6b69b339dba2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>  		ddc->ctx->i2caux,
>  		ddc->ddc_pin,
>  		&command))
> -		return DDC_RESULT_SUCESSFULL;
> +		return DDC_RESULT_SUCCESSFUL;
>  
>  	return DDC_RESULT_FAILED_OPERATION;
>  }
> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>  		ddc->ctx->i2caux,
>  		ddc->ddc_pin,
>  		&command))
> -		return DDC_RESULT_SUCESSFULL;
> +		return DDC_RESULT_SUCCESSFUL;
>  
>  	return DDC_RESULT_FAILED_OPERATION;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 33d91e4474ea..cc067d04505d 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>  {
>  	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
>  	union device_service_irq device_service_clear = { { 0 } };
> -	enum dc_status result = DDC_RESULT_UNKNOWN;
> +	enum ddc_result result = DDC_RESULT_UNKNOWN;
>  	bool status = false;
>  	/* For use cases related to down stream connection status change,
>  	 * PSR and device auto test, refer to function handle_sst_hpd_irq
> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>  	if (out_hpd_irq_dpcd_data)
>  		*out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>  
> -	if (result != DC_OK) {
> +	if (result != DDC_RESULT_SUCCESSFUL) {
>  		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>  			"%s: DPCD read failed to obtain irq data\n",
>  			__func__);
> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> index 019e7a095ea1..f3bf749b3636 100644
> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> @@ -32,7 +32,7 @@
>  
>  enum ddc_result {
>  	DDC_RESULT_UNKNOWN = 0,
> -	DDC_RESULT_SUCESSFULL,
> +	DDC_RESULT_SUCCESSFUL,
>  	DDC_RESULT_FAILED_CHANNEL_BUSY,
>  	DDC_RESULT_FAILED_TIMEOUT,
>  	DDC_RESULT_FAILED_PROTOCOL_ERROR,
>
Harry Wentland Feb. 2, 2018, 3:48 p.m. UTC | #2
On 2018-02-01 08:55 PM, dbehr@chromium.org wrote:
> From: Dominik Behr <dbehr@chromium.org>
> 
> v2: now with fixed result comparison and spelling fixes
> 
> Signed-off-by: Dominik Behr <dbehr@chromium.org>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c               | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c           | 4 ++--
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c            | 4 ++--
>  drivers/gpu/drm/amd/display/include/ddc_service_types.h     | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 1e8a21b67df7..3b05900ccccd 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>  		 msg->address,
>  		 msg->buffer,
>  		 msg->size,
> -		 r == DDC_RESULT_SUCESSFULL);
> +		 r == DDC_RESULT_SUCCESSFUL);
>  #endif
>  
>  	return msg->size;
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0023754e034b..3abd0f1a287f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>  				&edp_config_set.raw,
>  				sizeof(edp_config_set.raw));
>  
> -			ASSERT(result == DDC_RESULT_SUCESSFULL);
> +			ASSERT(result == DDC_RESULT_SUCCESSFUL);
>  		}
>  	}
>  	dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index d5294798b0a5..6b69b339dba2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>  		ddc->ctx->i2caux,
>  		ddc->ddc_pin,
>  		&command))
> -		return DDC_RESULT_SUCESSFULL;
> +		return DDC_RESULT_SUCCESSFUL;
>  
>  	return DDC_RESULT_FAILED_OPERATION;
>  }
> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>  		ddc->ctx->i2caux,
>  		ddc->ddc_pin,
>  		&command))
> -		return DDC_RESULT_SUCESSFULL;
> +		return DDC_RESULT_SUCCESSFUL;
>  
>  	return DDC_RESULT_FAILED_OPERATION;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 33d91e4474ea..cc067d04505d 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>  {
>  	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
>  	union device_service_irq device_service_clear = { { 0 } };
> -	enum dc_status result = DDC_RESULT_UNKNOWN;
> +	enum ddc_result result = DDC_RESULT_UNKNOWN;

Result gets the return value from read_hpd_rx_irq_data which is dc_status. This line should be

enum dc_status result = DC_OK;

>  	bool status = false;
>  	/* For use cases related to down stream connection status change,
>  	 * PSR and device auto test, refer to function handle_sst_hpd_irq
> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>  	if (out_hpd_irq_dpcd_data)
>  		*out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>  
> -	if (result != DC_OK) {
> +	if (result != DDC_RESULT_SUCCESSFUL) {

We should keep the result != DC_OK check here as read_hpd_rx_irq_data returns dc_status.

Harry

>  		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>  			"%s: DPCD read failed to obtain irq data\n",
>  			__func__);
> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> index 019e7a095ea1..f3bf749b3636 100644
> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> @@ -32,7 +32,7 @@
>  
>  enum ddc_result {
>  	DDC_RESULT_UNKNOWN = 0,
> -	DDC_RESULT_SUCESSFULL,
> +	DDC_RESULT_SUCCESSFUL,
>  	DDC_RESULT_FAILED_CHANNEL_BUSY,
>  	DDC_RESULT_FAILED_TIMEOUT,
>  	DDC_RESULT_FAILED_PROTOCOL_ERROR,
>
Dominik Behr Feb. 2, 2018, 9:06 p.m. UTC | #3
Aww, you are right. Let me redo it and do the spelling fix separately
because I cannot unsee it now.

On Fri, Feb 2, 2018 at 7:48 AM, Harry Wentland <harry.wentland@amd.com> wrote:
> On 2018-02-01 08:55 PM, dbehr@chromium.org wrote:
>> From: Dominik Behr <dbehr@chromium.org>
>>
>> v2: now with fixed result comparison and spelling fixes
>>
>> Signed-off-by: Dominik Behr <dbehr@chromium.org>
>> ---
>>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>>  drivers/gpu/drm/amd/display/dc/core/dc_link.c               | 2 +-
>>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c           | 4 ++--
>>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c            | 4 ++--
>>  drivers/gpu/drm/amd/display/include/ddc_service_types.h     | 2 +-
>>  5 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> index 1e8a21b67df7..3b05900ccccd 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>>                msg->address,
>>                msg->buffer,
>>                msg->size,
>> -              r == DDC_RESULT_SUCESSFULL);
>> +              r == DDC_RESULT_SUCCESSFUL);
>>  #endif
>>
>>       return msg->size;
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> index 0023754e034b..3abd0f1a287f 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>>                               &edp_config_set.raw,
>>                               sizeof(edp_config_set.raw));
>>
>> -                     ASSERT(result == DDC_RESULT_SUCESSFULL);
>> +                     ASSERT(result == DDC_RESULT_SUCCESSFUL);
>>               }
>>       }
>>       dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> index d5294798b0a5..6b69b339dba2 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>>               ddc->ctx->i2caux,
>>               ddc->ddc_pin,
>>               &command))
>> -             return DDC_RESULT_SUCESSFULL;
>> +             return DDC_RESULT_SUCCESSFUL;
>>
>>       return DDC_RESULT_FAILED_OPERATION;
>>  }
>> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>>               ddc->ctx->i2caux,
>>               ddc->ddc_pin,
>>               &command))
>> -             return DDC_RESULT_SUCESSFULL;
>> +             return DDC_RESULT_SUCCESSFUL;
>>
>>       return DDC_RESULT_FAILED_OPERATION;
>>  }
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> index 33d91e4474ea..cc067d04505d 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>>  {
>>       union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
>>       union device_service_irq device_service_clear = { { 0 } };
>> -     enum dc_status result = DDC_RESULT_UNKNOWN;
>> +     enum ddc_result result = DDC_RESULT_UNKNOWN;
>
> Result gets the return value from read_hpd_rx_irq_data which is dc_status. This line should be
>
> enum dc_status result = DC_OK;
>
>>       bool status = false;
>>       /* For use cases related to down stream connection status change,
>>        * PSR and device auto test, refer to function handle_sst_hpd_irq
>> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
>>       if (out_hpd_irq_dpcd_data)
>>               *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>>
>> -     if (result != DC_OK) {
>> +     if (result != DDC_RESULT_SUCCESSFUL) {
>
> We should keep the result != DC_OK check here as read_hpd_rx_irq_data returns dc_status.
>
> Harry
>
>>               dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>>                       "%s: DPCD read failed to obtain irq data\n",
>>                       __func__);
>> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> index 019e7a095ea1..f3bf749b3636 100644
>> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> @@ -32,7 +32,7 @@
>>
>>  enum ddc_result {
>>       DDC_RESULT_UNKNOWN = 0,
>> -     DDC_RESULT_SUCESSFULL,
>> +     DDC_RESULT_SUCCESSFUL,
>>       DDC_RESULT_FAILED_CHANNEL_BUSY,
>>       DDC_RESULT_FAILED_TIMEOUT,
>>       DDC_RESULT_FAILED_PROTOCOL_ERROR,
>>
kernel test robot Feb. 4, 2018, 8:40 a.m. UTC | #4
Hi Dominik,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.15]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/dbehr-chromium-org/drm-amdgpu-display-fix-wrong-enum-type-for-ddc_result/20180204-073608
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


vim +1945 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c

4562236b3b Harry Wentland 2017-09-12  1924  
d0778ebfd5 Harry Wentland 2017-07-22  1925  bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd_irq_dpcd_data)
4562236b3b Harry Wentland 2017-09-12  1926  {
4562236b3b Harry Wentland 2017-09-12  1927  	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
c2e218dda0 Harry Wentland 2017-02-24  1928  	union device_service_irq device_service_clear = { { 0 } };
4935e2b954 Dominik Behr   2018-02-01  1929  	enum ddc_result result = DDC_RESULT_UNKNOWN;
4562236b3b Harry Wentland 2017-09-12  1930  	bool status = false;
4562236b3b Harry Wentland 2017-09-12  1931  	/* For use cases related to down stream connection status change,
4562236b3b Harry Wentland 2017-09-12  1932  	 * PSR and device auto test, refer to function handle_sst_hpd_irq
4562236b3b Harry Wentland 2017-09-12  1933  	 * in DAL2.1*/
4562236b3b Harry Wentland 2017-09-12  1934  
4562236b3b Harry Wentland 2017-09-12  1935  	dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1936  		"%s: Got short pulse HPD on link %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1937  		__func__, link->link_index);
4562236b3b Harry Wentland 2017-09-12  1938  
8ee65d7c93 Wenjing Liu    2017-07-19  1939  
4562236b3b Harry Wentland 2017-09-12  1940  	 /* All the "handle_hpd_irq_xxx()" methods
4562236b3b Harry Wentland 2017-09-12  1941  		 * should be called only after
4562236b3b Harry Wentland 2017-09-12  1942  		 * dal_dpsst_ls_read_hpd_irq_data
4562236b3b Harry Wentland 2017-09-12  1943  		 * Order of calls is important too
4562236b3b Harry Wentland 2017-09-12  1944  		 */
4562236b3b Harry Wentland 2017-09-12 @1945  	result = read_hpd_rx_irq_data(link, &hpd_irq_dpcd_data);
8ee65d7c93 Wenjing Liu    2017-07-19  1946  	if (out_hpd_irq_dpcd_data)
8ee65d7c93 Wenjing Liu    2017-07-19  1947  		*out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
4562236b3b Harry Wentland 2017-09-12  1948  
4935e2b954 Dominik Behr   2018-02-01  1949  	if (result != DDC_RESULT_SUCCESSFUL) {
4562236b3b Harry Wentland 2017-09-12  1950  		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1951  			"%s: DPCD read failed to obtain irq data\n",
4562236b3b Harry Wentland 2017-09-12  1952  			__func__);
4562236b3b Harry Wentland 2017-09-12  1953  		return false;
4562236b3b Harry Wentland 2017-09-12  1954  	}
4562236b3b Harry Wentland 2017-09-12  1955  
4562236b3b Harry Wentland 2017-09-12  1956  	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {
4562236b3b Harry Wentland 2017-09-12  1957  		device_service_clear.bits.AUTOMATED_TEST = 1;
4562236b3b Harry Wentland 2017-09-12  1958  		core_link_write_dpcd(
4562236b3b Harry Wentland 2017-09-12  1959  			link,
3a340294f7 Dave Airlie    2016-12-13  1960  			DP_DEVICE_SERVICE_IRQ_VECTOR,
4562236b3b Harry Wentland 2017-09-12  1961  			&device_service_clear.raw,
4562236b3b Harry Wentland 2017-09-12  1962  			sizeof(device_service_clear.raw));
4562236b3b Harry Wentland 2017-09-12  1963  		device_service_clear.raw = 0;
4562236b3b Harry Wentland 2017-09-12  1964  		handle_automated_test(link);
4562236b3b Harry Wentland 2017-09-12  1965  		return false;
4562236b3b Harry Wentland 2017-09-12  1966  	}
4562236b3b Harry Wentland 2017-09-12  1967  
4562236b3b Harry Wentland 2017-09-12  1968  	if (!allow_hpd_rx_irq(link)) {
4562236b3b Harry Wentland 2017-09-12  1969  		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1970  			"%s: skipping HPD handling on %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1971  			__func__, link->link_index);
4562236b3b Harry Wentland 2017-09-12  1972  		return false;
4562236b3b Harry Wentland 2017-09-12  1973  	}
4562236b3b Harry Wentland 2017-09-12  1974  
4562236b3b Harry Wentland 2017-09-12  1975  	if (handle_hpd_irq_psr_sink(link))
4562236b3b Harry Wentland 2017-09-12  1976  		/* PSR-related error was detected and handled */
4562236b3b Harry Wentland 2017-09-12  1977  		return true;
4562236b3b Harry Wentland 2017-09-12  1978  
4562236b3b Harry Wentland 2017-09-12  1979  	/* If PSR-related error handled, Main link may be off,
4562236b3b Harry Wentland 2017-09-12  1980  	 * so do not handle as a normal sink status change interrupt.
4562236b3b Harry Wentland 2017-09-12  1981  	 */
4562236b3b Harry Wentland 2017-09-12  1982  
aaa15026f2 Wenjing Liu    2017-08-22  1983  	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.UP_REQ_MSG_RDY)
aaa15026f2 Wenjing Liu    2017-08-22  1984  		return true;
aaa15026f2 Wenjing Liu    2017-08-22  1985  
4562236b3b Harry Wentland 2017-09-12  1986  	/* check if we have MST msg and return since we poll for it */
aaa15026f2 Wenjing Liu    2017-08-22  1987  	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.DOWN_REP_MSG_RDY)
4562236b3b Harry Wentland 2017-09-12  1988  		return false;
4562236b3b Harry Wentland 2017-09-12  1989  
4562236b3b Harry Wentland 2017-09-12  1990  	/* For now we only handle 'Downstream port status' case.
4562236b3b Harry Wentland 2017-09-12  1991  	 * If we got sink count changed it means
4562236b3b Harry Wentland 2017-09-12  1992  	 * Downstream port status changed,
4562236b3b Harry Wentland 2017-09-12  1993  	 * then DM should call DC to do the detection. */
4562236b3b Harry Wentland 2017-09-12  1994  	if (hpd_rx_irq_check_link_loss_status(
4562236b3b Harry Wentland 2017-09-12  1995  		link,
4562236b3b Harry Wentland 2017-09-12  1996  		&hpd_irq_dpcd_data)) {
4562236b3b Harry Wentland 2017-09-12  1997  		/* Connectivity log: link loss */
4562236b3b Harry Wentland 2017-09-12  1998  		CONN_DATA_LINK_LOSS(link,
4562236b3b Harry Wentland 2017-09-12  1999  					hpd_irq_dpcd_data.raw,
4562236b3b Harry Wentland 2017-09-12  2000  					sizeof(hpd_irq_dpcd_data),
4562236b3b Harry Wentland 2017-09-12  2001  					"Status: ");
4562236b3b Harry Wentland 2017-09-12  2002  
4562236b3b Harry Wentland 2017-09-12  2003  		perform_link_training_with_retries(link,
d0778ebfd5 Harry Wentland 2017-07-22  2004  			&link->cur_link_settings,
4562236b3b Harry Wentland 2017-09-12  2005  			true, LINK_TRAINING_ATTEMPTS);
4562236b3b Harry Wentland 2017-09-12  2006  
4562236b3b Harry Wentland 2017-09-12  2007  		status = false;
4562236b3b Harry Wentland 2017-09-12  2008  	}
4562236b3b Harry Wentland 2017-09-12  2009  
d0778ebfd5 Harry Wentland 2017-07-22  2010  	if (link->type == dc_connection_active_dongle &&
4562236b3b Harry Wentland 2017-09-12  2011  		hpd_irq_dpcd_data.bytes.sink_cnt.bits.SINK_COUNT
4562236b3b Harry Wentland 2017-09-12  2012  			!= link->dpcd_sink_count)
4562236b3b Harry Wentland 2017-09-12  2013  		status = true;
4562236b3b Harry Wentland 2017-09-12  2014  
4562236b3b Harry Wentland 2017-09-12  2015  	/* reasons for HPD RX:
4562236b3b Harry Wentland 2017-09-12  2016  	 * 1. Link Loss - ie Re-train the Link
4562236b3b Harry Wentland 2017-09-12  2017  	 * 2. MST sideband message
4562236b3b Harry Wentland 2017-09-12  2018  	 * 3. Automated Test - ie. Internal Commit
4562236b3b Harry Wentland 2017-09-12  2019  	 * 4. CP (copy protection) - (not interesting for DM???)
4562236b3b Harry Wentland 2017-09-12  2020  	 * 5. DRR
4562236b3b Harry Wentland 2017-09-12  2021  	 * 6. Downstream Port status changed
4562236b3b Harry Wentland 2017-09-12  2022  	 * -ie. Detect - this the only one
4562236b3b Harry Wentland 2017-09-12  2023  	 * which is interesting for DM because
4562236b3b Harry Wentland 2017-09-12  2024  	 * it must call dc_link_detect.
4562236b3b Harry Wentland 2017-09-12  2025  	 */
4562236b3b Harry Wentland 2017-09-12  2026  	return status;
4562236b3b Harry Wentland 2017-09-12  2027  }
4562236b3b Harry Wentland 2017-09-12  2028  

:::::: The code at line 1945 was first introduced by commit
:::::: 4562236b3bc0a28aeb6ee93b2d8a849a4c4e1c7c drm/amd/dc: Add dc display driver (v2)

:::::: TO: Harry Wentland <harry.wentland@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 1e8a21b67df7..3b05900ccccd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -130,7 +130,7 @@  static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 		 msg->address,
 		 msg->buffer,
 		 msg->size,
-		 r == DDC_RESULT_SUCESSFULL);
+		 r == DDC_RESULT_SUCCESSFUL);
 #endif
 
 	return msg->size;
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 0023754e034b..3abd0f1a287f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1176,7 +1176,7 @@  static void dpcd_configure_panel_mode(
 				&edp_config_set.raw,
 				sizeof(edp_config_set.raw));
 
-			ASSERT(result == DDC_RESULT_SUCESSFULL);
+			ASSERT(result == DDC_RESULT_SUCCESSFUL);
 		}
 	}
 	dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
index d5294798b0a5..6b69b339dba2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
@@ -661,7 +661,7 @@  enum ddc_result dal_ddc_service_read_dpcd_data(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
 		&command))
-		return DDC_RESULT_SUCESSFULL;
+		return DDC_RESULT_SUCCESSFUL;
 
 	return DDC_RESULT_FAILED_OPERATION;
 }
@@ -698,7 +698,7 @@  enum ddc_result dal_ddc_service_write_dpcd_data(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
 		&command))
-		return DDC_RESULT_SUCESSFULL;
+		return DDC_RESULT_SUCCESSFUL;
 
 	return DDC_RESULT_FAILED_OPERATION;
 }
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 33d91e4474ea..cc067d04505d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1926,7 +1926,7 @@  bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 {
 	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
 	union device_service_irq device_service_clear = { { 0 } };
-	enum dc_status result = DDC_RESULT_UNKNOWN;
+	enum ddc_result result = DDC_RESULT_UNKNOWN;
 	bool status = false;
 	/* For use cases related to down stream connection status change,
 	 * PSR and device auto test, refer to function handle_sst_hpd_irq
@@ -1946,7 +1946,7 @@  bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 	if (out_hpd_irq_dpcd_data)
 		*out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
 
-	if (result != DC_OK) {
+	if (result != DDC_RESULT_SUCCESSFUL) {
 		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
 			"%s: DPCD read failed to obtain irq data\n",
 			__func__);
diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
index 019e7a095ea1..f3bf749b3636 100644
--- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
+++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
@@ -32,7 +32,7 @@ 
 
 enum ddc_result {
 	DDC_RESULT_UNKNOWN = 0,
-	DDC_RESULT_SUCESSFULL,
+	DDC_RESULT_SUCCESSFUL,
 	DDC_RESULT_FAILED_CHANNEL_BUSY,
 	DDC_RESULT_FAILED_TIMEOUT,
 	DDC_RESULT_FAILED_PROTOCOL_ERROR,