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

Re: [PATCH v2] ns16550: enable memory decoding on MMIO-based PCI console card


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 2 May 2023 12:53:15 +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=gXbRNs8L0HqQSzzKkVrPVszxsVNglD88jNZQ98h8eug=; b=dkmdwbyZ4TVCmhA9uFOUKpt2PH+f+y+J6xEcKTpoiRFtHUZkREq22J8X9yGtnYlABFLYpa1nmHEJ/5fwNhKGw8pwGiyZTxj5St5DhcVB+3cYI8BYYcmo1FyyFzcIZOtdp7l5kZb4fw7zqsxJ5me6eV7RqE6r1fhjkdQAK7NlX4D+vkeImZ+f26Y5khxD54KZPTbUByBEM3nMsK08YBK5cXAGWDIYimL+Ah/9Z2+JRgJFGVXC9tLDt3bVrSLMBWDy6OO4a3AbBErSxWgeyMH2bYgaf+lyZpprI/tMMGGpWoWw9P7QCHOVC9Rx71KRELfCRkys7BuiYY9XLH+cfrPx9A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z6uT0owrnYItSFu/uyk+jGZ88jOexV6wNpyIKosz5LRvMk3MPjLOZu8hBYufVM1prSBJ4VByLr2kmnoUw5ZP1fhzdZdcHb8E5Yu49/JBi/diEWbJ4bq2WgRkXBYTj/RlnfK9an09nftBjfiI9mwwN+/1OsxOEl649CcGe8ksg16l+CdepOfsES7luJsKb2Pmf1mkYYLxR4jABet6K5MJfaqYMJi7ZoqaLgO4X2CZh92jwyLHuASTPzwvjNma/1BFDN1EtpUmTuZPFS0u8LV5h7s4UhvEiCNOJzNH/n+aN/koyct611mQgtwCvIQClFg3L2IieiUeHERrAwNyml30Og==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 02 May 2023 10:53:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.04.2023 16:39, Marek Marczykowski-Górecki wrote:
> pci_serial_early_init() enables PCI_COMMAND_IO for IO-based UART
> devices, add setting PCI_COMMAND_MEMORY for MMIO-based UART devices too.

This sentence is odd, as by its grammar it looks to describe the current
situation only. The respective sentence in v1 did not have this issue.

> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -272,7 +272,15 @@ static int cf_check ns16550_getc(struct serial_port 
> *port, char *pc)
>  static void pci_serial_early_init(struct ns16550 *uart)
>  {
>  #ifdef NS16550_PCI
> -    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
> +    if ( uart->bar )
> +    {
> +        pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
> +                                  uart->ps_bdf[2]),
> +                         PCI_COMMAND, PCI_COMMAND_MEMORY);
> +        return;
> +    }
> +
> +    if ( !uart->ps_bdf_enable )
>          return;
>  
>      if ( uart->pb_bdf_enable )

While I did suggest using uart->bar, my implication was that the io_base
check would then remain in place. Otherwise, if I'm not mistaken, MMIO-
based devices not specified via "com<N>=...,pci" would then wrongly take
the I/O port path.

Furthermore - you can't use uart->bar alone here, can you? The field is
set equally for MMIO and port based cards in pci_uart_config().

Jan



 


Rackspace

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