ACK/Cmnt: [PATCH 1/1][SRU][B][E][F] UBUNTU: SAUCE: platform/x86: dell-uart-backlight: add retry for get scalar status

Stefan Bader stefan.bader at canonical.com
Thu Jan 16 14:03:47 UTC 2020


On 08.01.20 08:59, AceLan Kao wrote:
> BugLink: https://bugs.launchpad.net/bugs/1858761
> 
> Found on new platforms that UART require more than 1 second to respond
> commands in the first 10 seconds after booted.
> dell_uart_get_scalar_status() is the first command we send to scalar and
> this command should be more reliable than other commands, and make sure
> we got correct response from scalar. So, add retry and increase the read
> timeout to 2 seconds.
> 
> Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---

Fixes a problem and should not have impact on other platforms than the targeted
one. Not acking for Disco since that goes EOL Jan-23. The derivative kernels
other then oem-osp1 do not need this and oem-osp1 get it separately.

-Stefan

>  drivers/platform/x86/dell-uart-backlight.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-uart-backlight.c b/drivers/platform/x86/dell-uart-backlight.c
> index 90b28865896a..76e9a60a9388 100644
> --- a/drivers/platform/x86/dell-uart-backlight.c
> +++ b/drivers/platform/x86/dell-uart-backlight.c
> @@ -318,7 +318,7 @@ static int dell_uart_get_scalar_status(struct dell_uart_backlight *dell_pdata)
>  	struct dell_uart_bl_cmd *bl_cmd = &uart_cmd[DELL_UART_GET_SCALAR];
>  	struct uart_8250_port *uart = serial8250_get_port(dell_pdata->line);
>  	int rx_len;
> -	int status = 0;
> +	int status = 0, retry = 20;
>  
>  	dell_uart_dump_cmd(__func__, "tx: ", bl_cmd->cmd, bl_cmd->tx_len);
>  
> @@ -328,7 +328,11 @@ static int dell_uart_get_scalar_status(struct dell_uart_backlight *dell_pdata)
>  	}
>  
>  	dell_uart_write(uart, bl_cmd->cmd, bl_cmd->tx_len);
> -	rx_len = dell_uart_read(uart, bl_cmd->ret, bl_cmd->rx_len);
> +	do {
> +		rx_len = dell_uart_read(uart, bl_cmd->ret, bl_cmd->rx_len);
> +		if (rx_len == 0)
> +			msleep(100);
> +	} while (rx_len == 0 && --retry);
>  
>  	mutex_unlock(&dell_pdata->brightness_mutex);
>  
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200116/b542e3fc/attachment-0001.sig>


More information about the kernel-team mailing list