[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: Thu, 27 Apr 2023 09:44:27 +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=Il2FPybCc8VxAutI5Akbi8VvA9CAHwBY/A8KbfUNolg=; b=Rdsj8Y7xttL2j6KCNpttVzSZvmXIBrWWPnbDFFmYbtAOq5fY0qNeYEYAqHos1WnD59tKGPTHegt3x3AtwBx47CDeewXs+i5UEh4SX1DUgmXNzV1cD1jCqrrAUSpt4QZBjnJfw/5xRhexz1qe4uWiDH8v5cTmKUOoqYUz4Sq5+PXR4vFps4MR76xN9l83uvy2dqhkbd5MJzBkeNPkIXdJSfE1FouIMwRywPr8tKubsyOpWBizW7U3F0E1XcsWKsaZzkLg9VvqC/mwwCfIpght5detj4u6pvFDNaIbewMSNNruV/4GdeQ3EHQRylDbIs7bHs9AuMjH/Fq6zTxHsYkBww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AgzDE6XyINxQ0eiLh2h7OQUzeVPr1ThWkiT/Na8Vn6QQ7AoR+D2JH0+nFTPcsS4XbXJzhz4bWELADafV3Km0zvn6i1WeoIz96tFAykhqbmtSHlo9GdRhaDkseyMI5he+AoPq2+3uOT7EFqkyU0u7QoRbEX2C83r30PRaAoX9A9tcechFSGtl9dZTRPfRhfw7Noua+shoNOV3PappJHxHCTZ9k9ecnvb82spqmus/vPcxLej2OSH9hkZxTIVA/AY9XoXMB3+rT29VBxkqTGPKd0SCTnjmDriFzYp7xLCG6eIhq8ug0dXOu4oq1K46fU/f0HZuYThZ952W61JNux033Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 27 Apr 2023 07:44:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.04.2023 01:43, Marek Marczykowski-Górecki wrote:
> On Wed, Apr 26, 2023 at 10:24:28AM +0200, Jan Beulich wrote:
>> On 26.04.2023 09:48, Roger Pau Monné wrote:
>>> On Tue, Apr 25, 2023 at 04:39:02PM +0200, Marek Marczykowski-Górecki wrote:
>>>> --- 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);
>>>
>>> Don't you want to read the current command register first and just
>>> or PCI_COMMAND_MEMORY?
>>>
>>> I see that for IO decoding we already do it this way, but I'm not sure
>>> whether it could cause issues down the road by unintentionally
>>> disabling command flags.
>>
>> Quite some time ago I asked myself the same question when seeing that
>> code, but I concluded that perhaps none of the bits are really sensible
>> to be set for a device as simple as a serial one. I'm actually thinking
>> that for such a device to be used during early boot, it might even be
>> helpful if bits like PARITY or SERR get cleared. (Of course if any of
>> that was really the intention of the change introducing that code, it
>> should have come with a code comment.)
> 
> I have mirrored the approach used for IO ports, with similar thinking,
> and I read the above as you agree. Does it mean this patch is okay,
> or you request some change here?

Sorry, I've yet to get to look at v2 itself. So far I've only looked at
Roger's response.

Jan



 


Rackspace

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