[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ns16550: add support for polling mode when device tree is used


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 16 Aug 2023 15:39:51 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AM5oBtmVS8a8QaOE8sjQInakuSvwPDsbDyA9jnD4i6g=; b=VRDyN8DzD6C+RiCivD/WZhszZTnFlwQML3eWi+eqpZeGa7X/q7ONl8QD1q0Z0Q1dRQRkwipsL1+Cz1M2AfRlYsXKbEcFYyVNllH42i49H0fBWVgclTdac5XaROWqLMHis4Jg8Scq3YuxwtLOFaze7u7lqwwv96+2DT+uUXZZfsn7oRXH661lMOaJnzwE8QdK/zmi650aBvNmmYIRkC70/dPrrdfjFgxMVqLfbUZX4Gvtke4b61Lc5Y5mW7tkRMTRLGHxsw7HCwznHnqfYN0evDHES86mrSDBbxpxK6z/Sm1oT7EnGVX/QfABpEwuhQoG6ynaKzslVheKdMRLXj7WlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSzDch9Z6e9xMNMojBBnT2Q8DLHy2YumQOfuahqpa+U1MxSihUOKFZF4SjG2o6yBbKqh9zffkDG8AdFns+oKVosTHZiHMFKrcjBS8KqOGAYabSgCHA2/P/gXhxlMchk/neNRbQxx/fdUnvIdmw4FzjGVX2k53mZPxfE8bx1Yac8e5AZIfAt5h9MyGSNsNsDTjpyxEGFDXMTl9GH5+5MYcZU9AU1ZkSAsb5/4yvJrg98wQXfjY0Mbqi1itAsSPp7eCz2zFmAdPLqmSBM2sen5qNV1ZUwhYjRmDwBiXpO/bdT+C1oxlH54cV/RAxSGkHO2um+spD76UAJyy2zG5vDYxQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 16 Aug 2023 13:40:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2023 17:30, Oleksii Kurochko wrote:
> @@ -1555,6 +1566,9 @@ static bool __init parse_positional(struct ns16550 
> *uart, char **str)
>          }
>          else
>  #endif
> +        if ( strncmp(conf, "poll", 4) == 0 )
> +            uart->intr_works = polling;

Don't you need to update "conf" here as well then?

As said before, please also update parse_namevalue_pairs(). I would
appreciate (but not insist) if you also added recognition of "msi"
at this occasion.

> +        else
>              uart->irq = simple_strtol(conf, &conf, 10);
>      }
>  
> @@ -1760,6 +1774,9 @@ static int __init ns16550_uart_dt_init(struct 
> dt_device_node *dev,
>  
>      ns16550_init_common(uart);
>  
> +    if ( strstr(opt_com1, "poll") )
> +        uart->intr_works = polling;

Is strstr() really appropriate? Shouldn't it simply be strcmp(), with
there not being any other sub-options in the non-x86 case?

Plus the question remains of it necessarily being com1: Is there no
way with DT to have multiple serial ports (e.g. one for the console
and one for a debugger)? If there indeed isn't, then unconditionally
using opt_com1[] here is of course okay, but then opt_com2[]
is effectively a dead variable and recognizing "com2" on the command
line (rather than spitting out an error) is then also a mistake. IOW
in that case both would want keeping x86-only (with a new #ifdef, as
we certainly don't want to have com1 and com2 stuff in separate
places).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.