Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3857429ybt; Tue, 30 Jun 2020 12:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbK58QN0wcawd3FflB0Pthmg56uyXnQgtN8PtmCJLd7AjMXYsXlpf3rCYwbUU52+XEBbe2 X-Received: by 2002:a50:dacf:: with SMTP id s15mr25844362edj.136.1593544807227; Tue, 30 Jun 2020 12:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593544807; cv=none; d=google.com; s=arc-20160816; b=m08shhRNoImrPtnfpguTSuM+nP5rVCfQ3lPIrUl0HGyuLuJeASXJM5+4+/9BdzkLyz uPAFxrnNLy2pfEceUvrOYQch/EvM4gSn4ABMzOBEbNzrayOOjB10AoRy5GebAnzVXVda 43jTu7yxjnjEKXTzP8j0i/jAON4nvyPZsl+hRsAQTj8IGOIOhkN6biqwvSxwvQpIC35x DQR1EcXUz4lIV/OrFNIRFkHn698XBUEMapOjjHkxvdm5YmGo0Ep4JtblV4OhFHKItNW5 JIfEMaROQaJuZA7vE2IUBIDOvVEjWFRMY3BjqCS84fstSQfGr/M7Vr+41GmCUia0ccp5 b+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LVPy04b8l7/4uLdPzRE04DDctnJ+UI4WPxlHg0AF6vs=; b=KRtWHDW5kq5JcD65urnGkNnFl0Y2rHtgRmRw8kT3swQ5aI0uo3Az+JWE2K9CB9lRuW oIEI+xDRipwzCwPx4B3mF/5L2Qsb/Gp4kapo155OPXDqlUVJckEA88BGbu7tGcTMqYFI MUpuV9YTn8IfTiGP72VlX0+/M+UE3xjmAo8S9/3UAK1W1mh9sXoB4MhOvWXcPrxG6Anw DTrTPJMHNM76LJEBYERIfV7dTCOFpGuKreWfFOKjrxin1X4/3LdFbcMZxBN/dh+5D3ym 8+JippWizcBC9qy3Ye9vGerCG7+HFSWfLz+Z3C4it5lDaNa4V/QHiColhb17gNsBU7Ar O7nA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si2398325edy.271.2020.06.30.12.19.44; Tue, 30 Jun 2020 12:20:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390616AbgF3SDC (ORCPT + 99 others); Tue, 30 Jun 2020 14:03:02 -0400 Received: from muru.com ([72.249.23.125]:60048 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729105AbgF3SDB (ORCPT ); Tue, 30 Jun 2020 14:03:01 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 829668164; Tue, 30 Jun 2020 18:03:50 +0000 (UTC) Date: Tue, 30 Jun 2020 11:02:55 -0700 From: Tony Lindgren To: Sergey Senozhatsky Cc: Petr Mladek , Andy Shevchenko , Raul Rangel , Sergey Senozhatsky , linux-kernel , Greg Kroah-Hartman , Andy Shevchenko , kurt@linutronix.de, "S, Shirish" , Peter Zijlstra , John Ogness , Steven Rostedt Subject: Re: UART/TTY console deadlock Message-ID: <20200630180255.GD37466@atomide.com> References: <20200630035816.GA21591@jagdpanzerIV.localdomain> <20200630102141.GA11587@alley> <20200630105512.GA530@jagdpanzerIV.localdomain> <20200630122239.GD6173@alley> <20200630130534.GB145027@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630130534.GB145027@jagdpanzerIV.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Sergey Senozhatsky [200630 13:06]: > On (20/06/30 14:22), Petr Mladek wrote: ... > > > > > @@ -2284,8 +2289,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,9 +2300,9 @@ 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); > > > > > + if (irq_shared) > > > > > + enable_irq(port->irq); > > > > > > > > > > /* > > > > > * If the interrupt is not reasserted, or we otherwise > > > > > > > > I think that it might be safe but I am not 100% sure, sigh. > > > > > > Yeah, I'm not 100%, but I'd give it a try. > > > > I do not feel brave enough to ack it today. But I am all for trying it > > if anyone more familiar with the code is fine with it. > > I see. Well, I suppose we need Ack-s from tty/serial/8250 maintainers. > I would not be very happy if _only_ printk people Ack the patch. 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(). The other device for irq_shared should be capable of dealing with spurious interrupts if it's shared. Regards, Tony