Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3038266ybt; Sat, 4 Jul 2020 04:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoFytrpoUTyT+VXoi8y2SFWpW2cH4IJ4j3Ne4EX+2Y5GRUVjIJ25FkogPTZhjtMi3TcxCa X-Received: by 2002:a17:906:1044:: with SMTP id j4mr35399120ejj.187.1593862772958; Sat, 04 Jul 2020 04:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593862772; cv=none; d=google.com; s=arc-20160816; b=DgFNjyQz74gQ2DKBM35YPQLEtU2p0Q4NPNwS7UrriOWSlo+UNIP3ys94zUajxuhhD+ j3gAQtDvy7njmXegF9K5rG9o9ekPGMLGVGYZan/bQB+L9fzaMxuNL/XvXQay+/lJcssF 6LVMb3nuFDwzCd/H+pHOuz779JWAu1hsM4N8Yoij8apKdIhZ5WogHB1Yt3XUH60KXp7q EnWdqMXZoLfH+gQymEhL4g0EN3Ehdu6QC3uffR8hWAXhfL2cZ8ulw9lPFXnM0PtnasmM I5bR66u8Rhbrdtna8wC96gX3VPFMpI6Uqs54pdGDOUa1iNDw2p2HKvh/4RMtCsa7HW7x u7BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=57n94MhwYLFuD1T6ZycMA1rGCA3SSVPMIKT/pMmwRpo=; b=x9SIrxwDRboTGynjKTo0GdpvgYjXuqp9DCh0IaUKAInz188EJ3d8wI8eGy4Ko5zreM MNzHvrFg1/V+uf1FFixBLY1g1ixNUj1Ib1I67SEpP1NMtDhPYPx6jNU7EvBzKveidiv4 n94YuY7gj+huMVaCDrrbzgSCwOD4x1p8khzMtXxMcJuRzwD6jhHA15PydsLMXfDfncjl qwOpU4I1pyxWeYfbpJnqvio7g013gqrX/gaIvI9Ld+aUJd8XvgGMYpkcr4pnjGlIxhgc 3VOa++BYnDRz6mFq00JnLBhFEQvgXjR/vmcK6QjNT7l/DuYDRlYXQNGO7+tWpqYqtous pGiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eV5PJN1v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si9552355ejk.32.2020.07.04.04.39.09; Sat, 04 Jul 2020 04:39:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eV5PJN1v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbgGDLgE (ORCPT + 99 others); Sat, 4 Jul 2020 07:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgGDLgD (ORCPT ); Sat, 4 Jul 2020 07:36:03 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A07BC061794 for ; Sat, 4 Jul 2020 04:36:03 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id e8so16244882pgc.5 for ; Sat, 04 Jul 2020 04:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=57n94MhwYLFuD1T6ZycMA1rGCA3SSVPMIKT/pMmwRpo=; b=eV5PJN1v9takJBwFWZXZkfYrrTcA8u8LAnErDVFa2WYBNibG+CGc6NtjGRxLJR1ZU8 7gFQFuA+3f4633Ei84zMDtJvd6QGIAaiDP7tE+Qe/eF44nG3I6cQNEP4+LQSQxM/fAUw 963BR5ChLguoBP+07TLSZxAMAvYDI/qPADDQXP79pRZLCLsNfN/DGMp66ZgvEuVZ3IUX HWy4TpPFKDvP/lBU6AyIdJWdHMOt7Cbk9drRRlHHaFFnY/tUw00GeW/Frsab5PdEMCwV mdX3DSH/Q6cshyRylbnB8mo9qT6MyimX8NDIXU9anIkg21x2g2AipriXb8pnbf100iTC NVMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=57n94MhwYLFuD1T6ZycMA1rGCA3SSVPMIKT/pMmwRpo=; b=QUyWge1AWjta5UATPzIYrOfovHMtYG7424HXEGJJqtq6MXWxmXVYGjA2XV5Jis+/oG j3c8k07YprU6VpcGV0tiFeRWTGr1X3Z/FtDyQeBwwH6fghIK+ymTFqWVgLhlfATGkCxl FhRESe9wqvTxak+touLNYz4HODzJUWuB/SxQufofFMlfImeDM/R/nvzJfQzSUbxd3Z0T vshAYzB0jE8y5LZRJpJKPVw5pqBjVbLQPX0FKk8hTC9z/5PNNrl+OZFpdehHNFknEevN DZA1xs6uK2KoM4iwzrI6NAiOJkusSNnhR8Qn/U1v2zJWEht/5265o3y4jIa9eHjnaeNA VqXA== X-Gm-Message-State: AOAM531TcW1op/Yeqq2fuqMomeH3gQMPaX7yzSR964Rh+Ur3hJA+tJYz bowE/eBavxAbWx7YFJaDMoZEVvTFFIru1SgmWPA= X-Received: by 2002:a62:7657:: with SMTP id r84mr35690096pfc.130.1593862563045; Sat, 04 Jul 2020 04:36:03 -0700 (PDT) MIME-Version: 1.0 References: <20200630035816.GA21591@jagdpanzerIV.localdomain> <20200630102141.GA11587@alley> <20200630105512.GA530@jagdpanzerIV.localdomain> <20200630122239.GD6173@alley> <20200630130534.GB145027@jagdpanzerIV.localdomain> <20200630180255.GD37466@atomide.com> <20200702051213.GB3450@jagdpanzerIV.localdomain> <20200702160514.GK37466@atomide.com> <20200703103241.GB182102@jagdpanzerIV.localdomain> In-Reply-To: <20200703103241.GB182102@jagdpanzerIV.localdomain> From: Andy Shevchenko Date: Sat, 4 Jul 2020 14:35:46 +0300 Message-ID: Subject: Re: UART/TTY console deadlock To: Sergey Senozhatsky Cc: Tony Lindgren , Petr Mladek , Raul Rangel , Sergey Senozhatsky , linux-kernel , Greg Kroah-Hartman , Andy Shevchenko , kurt@linutronix.de, "S, Shirish" , Peter Zijlstra , John Ogness , Steven Rostedt Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 3, 2020 at 1:32 PM Sergey Senozhatsky wrote: > > On (20/07/02 09:05), Tony Lindgren wrote: > > * Sergey Senozhatsky [200702 05:13]: > > > On (20/06/30 11:02), Tony Lindgren wrote: > > > > This conditional disable for irq_shared does not look nice to me > > > > from the other device point of view :) > > > > > > > > Would it be possible to just set up te dummy interrupt handler > > > > for the startup, then change it back afterwards? See for example > > > > omap8250_no_handle_irq(). > > > > > > I think we can do it. serial8250_do_startup() and irq handler take > > > port->lock, so they should be synchronized. > > > > > > Something like this then? > > > > Yeah thanks this should work better for shared irq. > > This is, basically, an equivalent of > > --- > drivers/tty/serial/8250/8250_port.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index d64ca77d9cfa..dba7747d2ddd 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -2275,6 +2275,7 @@ int serial8250_do_startup(struct uart_port *port) > > if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) { > unsigned char iir1; > + > /* > * Test for UARTs that do not reassert THRE when the > * transmitter is idle and the interrupt has already > @@ -2284,8 +2285,6 @@ int serial8250_do_startup(struct uart_port *port) > * allow register changes to become visible. > */ > spin_lock_irqsave(&port->lock, flags); > - if (up->port.irqflags & IRQF_SHARED) > - disable_irq_nosync(port->irq); > > wait_for_xmitr(up, UART_LSR_THRE); > serial_port_out_sync(port, UART_IER, UART_IER_THRI); > @@ -2297,8 +2296,6 @@ int serial8250_do_startup(struct uart_port *port) > iir = serial_port_in(port, UART_IIR); > serial_port_out(port, UART_IER, 0); > > - if (port->irqflags & IRQF_SHARED) > - enable_irq(port->irq); > spin_unlock_irqrestore(&port->lock, flags); > > /* ...which effectively is a revert of 768aec0b5bcc ("serial: 8250: fix shared interrupts issues with SMP and RT kernels") -- With Best Regards, Andy Shevchenko