[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] ns16550: add support for polling mode when device tree is used
- To: Oleksii <oleksii.kurochko@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 25 Jul 2023 10:18:48 +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=ODO1xSaXezWXoStZDdTbR/K3+TD1E18vrSVKt/DrhP8=; b=FY6v1JZJtg6e7KAD2thS92I5PGhlHPWLlKK2nf2fsD3rXeRSYx2sj0PxZS+B9hYC+afLF2xiPF6kgQ4aXq1/14yWBdM9lh4C4jU+swQQLWVzamFeQbF8GnYOpy5O6IDjnhr5cqq4W3N5EG5Ze0TdPnOIeVnxdRjv9uVV47GW8wt3efNQ1ykZjrD/aW/GuT5XpACWh41fjYkwKxSMrts7ZrfHFEGS8rKDfs45nJJ72BWwg3CZQwQEkNAPFgRv8zk9Ntxr/z7YfqrbLUPxpcobqbfeV+13zQk27wSINMc4bQWPvTIn7vYf4n2+ZSu2Hh42dr9ttXNsg85HGHHQ29hfCw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kAFbrqzWFv0r4mtIyN+JYQgtBFophrHKKX6FdTu2D8Np1KRs52/lpWbZt8Yshu412fByp00an28axc32tEofkN1lH5CQPc4LFQqBNGd93pU67wyoql+Ds1IuT9bF8TPlM+h++Sfn8GLLnjVFzh0esRjV/xVnt+K60s+htqyM7VdtImTFfNvCw5hBGJaB6rQWMPtFbcXK6gM1kwLh5ja6WkTARUaWpRaSajhrvLyEba3uphGCnRyBO87UnCWdlQ8AgZp0gt9dbtmG69wVaF8BRe+DwGJNmMcru2OBvwjlmQpnlFeGm3CFrnphy5J+SwBTsWkyVO+vxISPJAYokvj7qA==
- 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, 25 Jul 2023 08:19:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 25.07.2023 10:15, Oleksii wrote:
> On Mon, 2023-07-24 at 16:43 +0200, Jan Beulich wrote:
>> On 24.07.2023 16:27, Oleksii Kurochko wrote:
>>> @@ -1330,9 +1341,12 @@ pci_uart_config(struct ns16550 *uart, bool_t
>>> skip_amt, unsigned int idx)
>>> * as special only for X86.
>>> */
>>> if ( uart->irq == 0xff )
>>> + {
>>> uart->irq = 0;
>>> + uart->intr_works = polling;
>>> + }
>>> #endif
>>> - if ( !uart->irq )
>>> + if ( !uart->irq || (uart->intr_works == polling) )
>>> printk(XENLOG_INFO
>>> "ns16550: %pp: no legacy IRQ, using
>>> poll mode\n",
>>> &PCI_SBDF(0, b, d, f));
>>
>> Message and code (after your addition) continue to be out of sync.
>> As said before, any condition that leads to polling mode wants to
>> find itself expressed by uart->intr_works set to "polling".
> Well. It looks like it would be better to set 'uart->intr_works =
> polling' inside if ( !uart->irq ):
> if ( !uart->irq || (uart->intr_works == polling) )
> {
> uart->intr_works = polling;
> printk(XENLOG_INFO
> "ns16550: %pp: using poll mode\n",
> &PCI_SBDF(0, b, d, f));
> }
> Then "uart->intr_works = polling;" can be removed from "if ( uart->irq
> == 0xff )" as in that case 'uart->irq = 0' means polling mode for X86.
I'm not fully convinced. Care needs to be taken that both the x86 case
and the general case continue to function as they did (unless proven to
be buggy).
Jan
|