All of lore.kernel.org
 help / color / mirror / Atom feed
From: "S, Shirish" <sshankar-5C7GfCeVMHo@public.gmane.org>
To: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>,
	Shirish S <shirish.s-5C7GfCeVMHo@public.gmane.org>,
	Alexander.Deucher-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/display: fix return value of dm_dp_aux_transfer() (V2)
Date: Tue, 24 Apr 2018 18:29:56 +0530	[thread overview]
Message-ID: <f4520258-7efc-d19e-49b1-81ff6becc269@amd.com> (raw)
In-Reply-To: <f1a2e63b-db81-d24e-9535-1d22af84efb1-5C7GfCeVMHo@public.gmane.org>



On 4/23/2018 9:53 AM, S, Shirish wrote:
>
>
> On 4/20/2018 11:52 PM, Harry Wentland wrote:
>> On 2018-04-17 10:56 PM, Shirish S wrote:
>>> Currently the dm_dp_aux_transfer() does not parse
>>> the return value of dal_ddc_service_read_dpcd_data(), which also
>>> has a failure case.
>>> This patch captures the same and ensures the i2c operation status is
>>> sent appropriately to the drm framework.
>>>
>>> V2: Updated commit message.
>>>
>>> Signed-off-by: Shirish S <shirish.s@amd.com>
>>> ---
>>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 
>>> +++++-
>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> 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 782491e..7ac124d 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
>>> @@ -115,7 +115,11 @@ static ssize_t dm_dp_aux_transfer(struct 
>>> drm_dp_aux *aux,
>>>                   msg->address,
>>>                   msg->buffer,
>>>                   msg->size);
>>> -        return read_bytes;
>>> +        if (read_bytes != msg->size &&
>>> +            read_bytes >= DDC_RESULT_FAILED_OPERATION)
>> This doesn't look right. We shouldn't be returning the size or error 
>> code from the same function. This will not work if we submit a read 7 
>> or 8 bytes and get an error.
> Agree,  but hope you understood the issue, to re-iterate, in case of 
> failure we reuturn a +ve number(7 or 8) back from dm_dp_aux_transfer() 
> leading to edid read failures later.
> I have 2 suggestions:
> 1. change the "enum ddc_result {" to #defines of -ve error codes? or
> 2. make enum start with 129 (> than the max read_bytes possible)?
> let me know which one would be better?
Any suggestions?
> Thanks,
> Regards,
> Shirish S
>>
>> Harry
>>
>>> +            return -EIO;
>>> +        else
>>> +            return read_bytes;
>>>       case DP_AUX_I2C_WRITE:
>>>           res = dal_ddc_service_write_dpcd_data(
>>>                   TO_DM_AUX(aux)->ddc_service,
>>>
>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-04-24 12:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  2:56 [PATCH] drm/amd/display: fix return value of dm_dp_aux_transfer() (V2) Shirish S
     [not found] ` <1524020209-8481-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-04-20 18:22   ` Harry Wentland
     [not found]     ` <3fa10009-7ef6-666f-a9ba-9888200be8ff-5C7GfCeVMHo@public.gmane.org>
2018-04-23  4:23       ` S, Shirish
     [not found]         ` <f1a2e63b-db81-d24e-9535-1d22af84efb1-5C7GfCeVMHo@public.gmane.org>
2018-04-24 12:59           ` S, Shirish [this message]
     [not found]             ` <f4520258-7efc-d19e-49b1-81ff6becc269-5C7GfCeVMHo@public.gmane.org>
2018-04-24 15:27               ` [PATCH] drm/amd/display: Don't return ddc result and read_bytes in same return value Harry Wentland
     [not found]                 ` <20180424152710.7810-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-04-27  9:33                   ` S, Shirish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4520258-7efc-d19e-49b1-81ff6becc269@amd.com \
    --to=sshankar-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=harry.wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=shirish.s-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.