lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <f7900514-15d1-4da8-a330-ddd2d68a426e@app.fastmail.com>
Date:   Fri, 16 Dec 2022 13:38:45 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     Michel Dänzer <michel.daenzer@...lbox.org>,
        "Arnd Bergmann" <arnd@...nel.org>,
        "Harry Wentland" <harry.wentland@....com>,
        "Leo Li" <sunpeng.li@....com>,
        "Rodrigo Siqueira" <Rodrigo.Siqueira@....com>
Cc:     "Alan Liu" <HaoPing.Liu@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        "Wenjing Liu" <wenjing.liu@....com>, linux-kernel@...r.kernel.org,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        "Daniel Vetter" <daniel@...ll.ch>,
        "George Shen" <george.shen@....com>,
        "Alex Deucher" <alexander.deucher@....com>,
        "Dave Airlie" <airlied@...il.com>,
        Christian König <christian.koenig@....com>
Subject: Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code

On Thu, Dec 15, 2022, at 18:56, Michel Dänzer wrote:
> On 12/15/22 17:37, Arnd Bergmann wrote:
/amd/display/dc/core/dc_link_dp.c
>> index af9411ee3c74..95dbfa4e996a 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
>> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>>  
>>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
>> -		return false;
>> +		return DC_OK;
>
> 		return status;
>
> seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED 
> initialization has no effect)

Ok, makes sense. I'd also remove the unused initialization in that
case though:

 enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 {
        uint8_t lttpr_dpcd_data[8];
-       enum dc_status status = DC_ERROR_UNEXPECTED;
-       bool is_lttpr_present = false;
+       enum dc_status status;
+       bool is_lttpr_present;
 
        /* Logic to determine LTTPR support*/
        bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
        if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-               return false;
+               return DC_ERROR_UNEXPECTED;
 
        /* By reading LTTPR capability, RX assumes that we will enable
         * LTTPR extended aux timeout if LTTPR is present.

I'll send that as a v2 once that passes my build test and nobody
has further suggestions.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ