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: <f6a745d2-aed4-b10d-3343-d34a364f5236@redhat.com>
Date:   Wed, 30 Aug 2023 15:25:09 +0200
From:   Hans de Goede <hdegoede@...hat.com>
To:     "Luke D. Jones" <luke@...nes.dev>
Cc:     corentin.chary@...il.com, markgross@...nel.org,
        linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH v2 1/1] platform/x86: asus-wmi: corrections to egpu safety
 check

Hi Luke,

On 8/30/23 04:29, Luke D. Jones wrote:
> An incorrect if statement was preventing the enablement of the egpu.
> 
> Fixes: d49f4d1a30ac ("platform/x86: asus-wmi: don't allow eGPU switching if eGPU not connected")
> 
> Signed-off-by: Luke D. Jones <luke@...nes.dev>
> ---
>  drivers/platform/x86/asus-wmi.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 9783893d2d6e..f54178d6f780 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -726,19 +726,18 @@ static ssize_t egpu_enable_store(struct device *dev,
>  		return -EINVAL;
>  
>  	err = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_EGPU_CONNECTED);
> -	if (err < 0)
> -		return err;
> -	if (err < 1) {
> -		err = -ENODEV;
> -		pr_warn("Failed to set egpu disable: %d\n", err);
> +	if (err < 0) {
> +		pr_warn("Failed to get egpu connection status: %d\n", err);
>  		return err;
>  	}
>  
>  	if (asus->gpu_mux_mode_available) {
>  		result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPU_MUX);
> -		if (result < 0)
> +		if (result < 0) {
>  			/* An error here may signal greater failure of GPU handling */
> +			pr_warn("Failed to get gpu mux status: %d\n", err);

The error-code to print here should be result not err, since the error is stored in result.

I've fixed this up while merging this.

Regards,

Hans



>  			return result;
> +		}
>  		if (!result && enable) {
>  			err = -ENODEV;
>  			pr_warn("Can not enable eGPU when the MUX is in dGPU mode: %d\n", err);
> @@ -748,12 +747,12 @@ static ssize_t egpu_enable_store(struct device *dev,
>  
>  	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_EGPU, enable, &result);
>  	if (err) {
> -		pr_warn("Failed to set egpu disable: %d\n", err);
> +		pr_warn("Failed to set egpu state: %d\n", err);
>  		return err;
>  	}
>  
>  	if (result > 1) {
> -		pr_warn("Failed to set egpu disable (retval): 0x%x\n", result);
> +		pr_warn("Failed to set egpu state (retval): 0x%x\n", result);
>  		return -EIO;
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ