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] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f4bf248-cd27-623d-5984-fafa931404fa@gmail.com>
Date:   Tue, 8 Jun 2021 12:31:45 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...il.com>
To:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Benjamin Berg <bberg@...hat.com>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode
 registration on busy condition

Hello!

On 07.06.2021 16:14, Heikki Krogerus wrote:

> If the PPM tells it's busy, we can now simply try again.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
>   drivers/usb/typec/ucsi/ucsi.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 366c8a468bc18..a8e0e31dcddf5 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -437,8 +437,11 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
>   		command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num);
>   		command |= UCSI_GET_ALTMODE_OFFSET(i);
>   		len = ucsi_send_command(con->ucsi, command, alt, sizeof(alt));

    Could insert your check here, to reduce the indentation...

> -		if (len <= 0)
> +		if (len <= 0) {
> +			if (len == -EBUSY)
> +				continue;
>   			return len;
> +		}
>   
>   		/*
>   		 * This code is requesting one alt mode at a time, but some PPMs

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ