Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2205986ybt; Fri, 3 Jul 2020 03:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGKHbvBP/IQwlX+ciYaRIKaECf24lu76Cj8S+m0Ij7AgcFnZc5LU7rwoIYFL6cvDVjL7Uw X-Received: by 2002:a17:906:6499:: with SMTP id e25mr31452433ejm.352.1593772550688; Fri, 03 Jul 2020 03:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593772550; cv=none; d=google.com; s=arc-20160816; b=OaGFMpFdldztO9GEwZM1P0A1gkvqfoYiO5ExsJlZkfm0HaTfQepWJrH74FP+zsiayy 3SF654BqL+cFkqAlKxqPtZN59higbBf5M4/3wvDQyLUbadhAd3zl/91NrC1Imhu83JcM Ei6lFOBfXqev54zqydWbgfCgeJQkmyQcEMTBpbTbBVZwlcxxVUXliHGLYfSxr7ZeNLFZ Dv7iFCEKOgAdO7O5VStqA6tLh3ynaR4ucU3G1xx5DZ1t9GKU10gXmydKVToESjLcarCM yhwY2Q9Q4mFAHKTqpVz+9b8i84AQS1ETMDEp57USZhFwprQsJHw6LxptITO6u763xswz uzqA== 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:date:from :dkim-signature; bh=pzSbVsHlCFQpZk8xTOuSpkh1whPCZ1SzpJvQ6Rn1zkg=; b=lGTcFjEI5UcpKMfrKKrXBYjqeeLii/TKJvr037+UVbZRtTEmrvP9mek1bkDC5EuFwH n++DoPqzmReR2vvpHmG9oEqZMHZO+N6wPZf7gpfRcAa/ZAKDsF7mZ4kmwlqUwR8ADUHU /SR+sMPuNW1Kcc0BGtj0ucwKfFzA+ALlmhuVjvYDxvh+0Oaj+8FvGeNchyHdQc/fkTgo ntHZ9Xpdd0ggmXrwg0ML/RkNwD8uihActM8SX6j4u4tcxTOxwgoQAcn7nWHNov9EZeTD w8laqBkg642+C/SIppa3gHAVIo+27Th9FJjJCpnXUGakhUT4GgfXJ448WvjUMjRHpL6J XGFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g3pmMCMO; 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 y27si7381123eje.284.2020.07.03.03.35.27; Fri, 03 Jul 2020 03:35:50 -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=g3pmMCMO; 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 S1726152AbgGCKco (ORCPT + 99 others); Fri, 3 Jul 2020 06:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgGCKcn (ORCPT ); Fri, 3 Jul 2020 06:32:43 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2ABDC08C5C1 for ; Fri, 3 Jul 2020 03:32:43 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id w19so1825888ply.9 for ; Fri, 03 Jul 2020 03:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pzSbVsHlCFQpZk8xTOuSpkh1whPCZ1SzpJvQ6Rn1zkg=; b=g3pmMCMOJMi5nBAfhKNeRhsdM9IPEcNKjdNl/1GJJdNSlHFuRZmMFj+XBBbX6Oljnb R8Sl47GsYbHDLJuA3gIWwzyXhTfBVusAwM/pdWbnX75taKK7bcOFDwXI1sm7cnKDID4u KqxrldZfztpG+9LzfLupMMXy46ZiBxOVZbWz3hNlxuZgu+4trbA94M+SW0MK4XEWGZKz XVnKeSbdKfI9LNyM4991PeGfzCUb+qqfG8VWNmSxazxHavlQBa4AM1u/Mdz6w9NxwFs0 b7XjLoYUhIiMUgG6JUGm4hbZAAWy7HTB4ZWbdyLmY/3+Lam4kXG9IjJCx7dC3MHId/gq huaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pzSbVsHlCFQpZk8xTOuSpkh1whPCZ1SzpJvQ6Rn1zkg=; b=HwjebuDQr3XxbHNPeyaGX7Gln4wYN2ebpJIWamOKZQ3krHHJeqpSyTTO32jQcDzbtq BEPLto7QyRWdEbiW+V62qLzk9irzA9aI7DIfGPmcSmyqGuBzKcBSximEgvV/38qNEgE2 orFA8mL+qO/Az2hLTfpH4FNZLBMeSnZVHwCuG515H/srqRXhpgETNycO26bYDfqREVu8 zDiwPAb6muZuH3S5JPXMwe7mlYfrmM4Iv2jwz2KwIjKe94zMbldaMO3DT/G3PwFRzM3E ylreNPh50C28fsTfd/bS9qhuepbdDo/n/V7Cpad07hj/YJQEMHy90O5uHmG5qC3EnXrQ RaIQ== X-Gm-Message-State: AOAM533soss11Hpisgp4C8rUHgkP6L2/oQ0kwSGwm1kDPtxmlpn7avvO xEHr3H03HlLZVNuZCWOf6ww= X-Received: by 2002:a17:90a:ea0f:: with SMTP id w15mr39549618pjy.138.1593772363054; Fri, 03 Jul 2020 03:32:43 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id q24sm8451149pfg.34.2020.07.03.03.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 03:32:42 -0700 (PDT) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky Date: Fri, 3 Jul 2020 19:32:41 +0900 To: Tony Lindgren Cc: Sergey Senozhatsky , 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: <20200703103241.GB182102@jagdpanzerIV.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702160514.GK37466@atomide.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); /* -- 2.27.0