Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp77890ybt; Mon, 6 Jul 2020 04:32:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoyqPf2yzvO+neVkv23SKsiCnawPDX2fx4zkirsq0OP+Kt5HVIq6tg7NADAabi/22RgyCC X-Received: by 2002:a50:d7c1:: with SMTP id m1mr56224630edj.217.1594035122813; Mon, 06 Jul 2020 04:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594035122; cv=none; d=google.com; s=arc-20160816; b=Wnd1qNAcBAkgGNu05rCSLf//tcP3qStG22nYgYSvvNQxTA5WsjqZlISMNiFRKXAT1a ZEMEZtoHKQYACPi5oYt7LBghC3fPAuop9hAfKgu2HwWj2ST/1fHkVveJRc91ouraV9Ed ljKZzigU7jSKeGvGrR4d2nT8mW5FZuiaNlPDrmFi42gZ8pu3ZX/CfVctD1YG7Vl9y9ZU LOTBPqreuhlfH+F2fGDkhXrzGjhLPjYF5dNYpV8XjlNOfKlEF3muIajX41K2DN/Y8v1c SaCaPJV64zfeQZIfBWtZ6PyXqSicl0x6q/myapovJEsiLwq5CWl408kzBzHD+pEwKc7c yPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=zIjr59zT/ebHtB1OersU4qLeRIoOyUYlrI9yu0DaPO0=; b=BNAeIv/DdNZcQBwgx0XiDVsUSmS6ViD6jb3/7duHlAyrcqeMfrOIDhncmD5aUkG2A1 psqfSEAXdeEKDRfKCGNXhzTbM7QssUVXQNW/3MTaji9cze7QHbRnMpnSW3zyFsN3xMll jDKVdKnwdO4MQFO9WJon3Nr9xot77LAIR5SfOsYkEKEn0CA9gV7g094M7hxPZalB1KXn BwFZlxmxGdDJB/pDHqrpNVtOhbB6t4BOMHHjneRuo/wAmjSgalTm3Zm+YxNdO3ze5ORw 1LEQV4Qr74KGAoW6zA3g/MvWCGoBjOJlLgk9aM7s37iuyeH2fJ27P49aRZdnJPYYCWxn ov1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=do98fXC1; dkim=neutral (no key) header.i=@vger.kernel.org; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r4si13698827edl.262.2020.07.06.04.31.40; Mon, 06 Jul 2020 04:32:02 -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=@linutronix.de header.s=2020 header.b=do98fXC1; dkim=neutral (no key) header.i=@vger.kernel.org; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728981AbgGFLbR (ORCPT + 99 others); Mon, 6 Jul 2020 07:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728859AbgGFLbR (ORCPT ); Mon, 6 Jul 2020 07:31:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC39BC061794 for ; Mon, 6 Jul 2020 04:31:16 -0700 (PDT) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594035075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zIjr59zT/ebHtB1OersU4qLeRIoOyUYlrI9yu0DaPO0=; b=do98fXC1FGkK0E7Fn2LbBXk/QTKlQVhmeQuF59Ki8hZOR3/Ci2hDkKEInuRYu5T4SfPnFo J88n+fIcn00/3PpiBGZZbNrHPijv/rgTceVxJY/YAB1Jm8lf166G3JMmgWv455lYsu3gXe WahJjVbkyC1xdBxf6GuWmhBqZ1TYHIB3pyNX/L4/u4MZi2psXMt3bsezSJKcrVwIrCirLT hJcVivYW5KtOAcSKhDiuRBBp14wLE2FmQmmEJZRIzxSltROcVyR2ylGAweopVuJufdxxDV wfVhxy3sSLsBXicEujJpVtJGsiJE1gLVn8LmfS7Xi/TRg95sJ9iIquRhauBPiw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594035075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zIjr59zT/ebHtB1OersU4qLeRIoOyUYlrI9yu0DaPO0=; b=e02smifr93XZX3Wn5TwGUzMVRAp6tsngVXmHDmLZlWgIZTFIQmyRpjSfiB1rfv8E7Jr4CE uSd53rEr/P2jc5BQ== To: Andy Shevchenko , Sergey Senozhatsky Cc: Tony Lindgren , Petr Mladek , Raul Rangel , Sergey Senozhatsky , linux-kernel , Greg Kroah-Hartman , Andy Shevchenko , "S\, Shirish" , Peter Zijlstra , John Ogness , Steven Rostedt Subject: Re: UART/TTY console deadlock In-Reply-To: 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> Date: Mon, 06 Jul 2020 13:31:01 +0200 Message-ID: <877dvg6ft6.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Hi, On Sat Jul 04 2020, Andy Shevchenko wrote: > 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") Please, don't revert that commit. I've faced the same issue as described in the commit log. There is hardware available with shared UART interrupt lines. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAl8DC3UACgkQeSpbgcuY 8KaatQ/+I3uMpcHFLxQZhMYRh5GqeaLa/qLoonGoPgq5vSZihPv1qQHC5CIPHs9u b1kud/9/p1yItg1tFM/xbUCBB5m8Ghp1kq3auEA39q1vz80PD39K9g+Jcw1Eh4xU v06gSdvac3rNNAFk27iMKf55wITenBJWEZvttrSDI44KH3Mr0Zftl9y2azHh3gg1 iFpk7RsdoVziAHAwufC4SPghWatmB6NgZrbn2XZO+nqdg+E9457bjbLOHEUaDBqg l7jXGOnRH0J/y+H5Nj+K9MGpzov855RbARwOUvnc9F9WY3mMPaRGkj+hTeueyU3K ymwNPWotPsVQVEMTLzOgnR2lnxmUgahL+JO3MF+/wu1Vt1INZedHhawwGGXNMC9T rPXs3CeDsdInR9GhEsuOjehrYpW577ZH/NQnmNZr1dPTViCJI1vryDhgV3toClnl 67XKp0m4XIUgbGPrRP7OAc/mePjSaHhPvfh3dlrNPyRCTq8ViLN3PgTLfZcyhexz wvhBQFxp2d0wbI96J2VzOoVNccPr4n0pepXXYGwrzEe1IehwMI6PjN7GfB2ugO8o lpklK0KHm2YrKsLKFg8ncCNEfq1NpDFISSaK3eLnMdhoGCuEPNvXMCgN9AaRVnKE jZXuk/iOekD5ua4K3H+zcck76ECCNbPlXV/5uqSaYzyug/kCHFM= =tqSP -----END PGP SIGNATURE----- --=-=-=--