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

Re: [PATCH] ns1650: refactor interrupt handling in ns16550_uart_dt_init()


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jul 2023 12:08:53 +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=cs/iHZ6wTOUd5ud+2uIVAP6yVHZ7HE+7sLg9mA+mHfc=; b=Fxp3x1afOz/5HLnZ9X/lJoq2Qs9fgp1JAGCPneeID1PMMsQFAU+Erst0ykzm6gHkCYtkDKROJOMyuTBOWbenmpL66OsKzEkw0YWGNDz3LgJUutpFnKiwy+Y+wjyo2/YFlmdiuRs5iY10u5hjC1wjWmr5kzX8ip2r08Z/pN9d68pewM7iDIbLY21kP3//8e0ZqxngRTif5PTL+PKuDlcyfSqGRm/5BfnSoZfm/u2zFwPUvIyyBfIHWIujR+rKCG8gRz65lg6Ea1XyTG+pZw1Fqk9Q/H/hoGQFH9jW3YyNYiJGtwWDhQgwgB4TpDKScjsqx6l+Hkqo07sHKl6iPwy9hQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OESnFr6jOVm6AdjCKCMPVu1Z9Hi8T0SOEmojP2Vb9kSwdXIrbMYPj04QiyV4f2p3dcCmQwxSk+5TRh7X5/ByIciBUFIcoItwP0L+mNB9uWiVwm9KwScNcmGsRYVYWbDccDLOdR1Vb4IIfXiLTdQR8IPxk9q359WcvyEaM3EOpCeFtTp9ZPBILMpzUw8t3ZyJ0GZcoVgJAMNMMsLHL5rQEUMDVyKKt2jKvlrZK8lp1QOGWEHwy2ouEWjV+hXwoadD02D4RRo/SKkNNLzzBQTr+BxKWQaSvV6FCFBQnLevMPNBnKiD0nYxZV2A/KHSE8x7OrgmvuO7d2NJscoJMXtzZw==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 13 Jul 2023 10:09:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.07.2023 11:30, Oleksii Kurochko wrote:
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1791,8 +1791,16 @@ static int __init ns16550_uart_dt_init(struct 
> dt_device_node *dev,
>      }
>  
>      res = platform_get_irq(dev, 0);
> -    if ( ! res )
> -        return -EINVAL;
> +    if ( res == -1 )
> +    {
> +        printk("ns1650: polling will be used\n");

Nit: Please don't omit one of the two 5-s here.

> +        /*
> +         * There is the check 'if ( uart->irq > 0 )' in 
> ns16550_init_postirq().
> +         * If the check is true then interrupt mode will be used otherwise
> +         * ( when irq = 0 )polling.
> +         */

I wonder in how far that's actually correct outside of x86. On x86 IRQ0 is
always the timer interrupt, but I'm not convinced something similar can be
used as kind of a heuristic on Arm, RISC-V, or basically any other
architecture.

Jan



 


Rackspace

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