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

Re: [PATCH 2/2] ns16550: add Exar dual PCIe UART card support


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Aug 2021 09:55:16 +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-SenderADCheck; bh=QKFeOKusJpquxtd00pOoP6vf9uFbiqjeRB5MQoS5kfE=; b=Rj1MfK+aUgwu8oSlphIbwcQaNFOW5oRRJROw3rhs95pK5BHeUAGqN1KqfUbZGxMZQK+Q64bsPBu9CVsTAynBZDV7nNqHdQEESImIhedq0mGKo6PC73ejus/QfV3s1AOXRQdseuOpIJmrxmILIpZ0ELjZfkHMRksdJgCazEq7vZffSlvhUgmzXdG2oGRxv/nE5hUKAhF7loor/4TsM9EftOJ4avmWIZKY06SHsiV3fYKf02PDtX/yHU2zTmWF8mpkEIRUl2L/Dka+NhlqAQ/1uMVkoW05vUChDWRGF7tv4Y2Bi8j59a4+xyfbMggV2C3+P79m6fAh7hkxuLumYetL9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RFwU4NtIHrV3O74N9KnB/emxBOZ86NemWJ0IQ2+YUp3KSD0YwZwoHVS5po58orO0eW81jILxVZ6jJE0iLprptMNic561ZnRsKSMGMTHs5aows1BtZLiaMOp8zTg6oy9o6W3KJpHw9nbMrYRkHZBdz2bOtNSf5P6GgPtfb2MMS4AfBhVEx8ApnxqBha6h6nugvY6LepQoUtY64lmc+LcM/AUgnu0s/nEVHBnG9ETPZ9CVS43D5FZE82gH2jxMImI2JaQmALY3wsIpVlBrbhSd28JpSm0FeHAEpxScyKsG3KEW/5quoKvGboIDBPQl8+3MSPFRtlpC3/G+ScUQUqpwWg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 16 Aug 2021 07:55:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.08.2021 20:31, Marek Marczykowski-Górecki wrote:
> Besides standard UART setup, this device needs enabling
> (vendor-specific) "Enhanced Control Bits" - otherwise disabling hardware
> control flow (MCR[2]) is ignored. Add appropriate quirk to the
> ns16550_setup_preirq(), similar to the handle_dw_usr_busy_quirk(). The
> new function act on Exar cards only (based on vendor ID).

While on IRC you did say you have a datasheet or alike for the specific
card you have in use, may I ask that you clarify why the logic is
applicable to all (past, present, and future) Exar cards?

> @@ -169,6 +170,21 @@ static void handle_dw_usr_busy_quirk(struct ns16550 
> *uart)
>      }
>  }
>  
> +static void enable_exar_enhanced_bits(struct ns16550 *uart)
> +{
> +#ifdef NS16550_PCI
> +    if ( uart->bar &&
> +         pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[2],
> +                         uart->ps_bdf[2]), PCI_VENDOR_ID) == 
> PCI_VENDOR_ID_EXAR )
> +    {
> +        /* Exar cards ignores setting MCR[2] (hardware flow control) unless
> +         * "Enhanced control bits" is enabled.
> +         */

Style nit: /* belongs on its own line as per ./CODING_STYLE.

> +        ns_write_reg(uart, UART_XR_EFR, UART_EFR_ECB);

Wouldn't this better be a read-modify-write operation?

> --- a/xen/include/xen/8250-uart.h
> +++ b/xen/include/xen/8250-uart.h
> @@ -121,6 +121,10 @@
>  /* Frequency of external clock source. This definition assumes PC platform. 
> */
>  #define UART_CLOCK_HZ     1843200
>  
> +/* Exar specific */
> +#define UART_XR_EFR       0x09
> +#define UART_EFR_ECB      0x10

Please move the former into the group after the "/* Register offsets */"
comment and extend the comment on the latter to establish a link to
UART_XR_EFR.

Jan




 


Rackspace

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