Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3065350pxa; Tue, 18 Aug 2020 05:53:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaprSe57mS65heexe/qV9gnyWRVpQxVU9y8uJjSezZqW8AZn9geZw6Cs3QdEoRQwxQ+su4 X-Received: by 2002:a17:906:e50:: with SMTP id q16mr21055354eji.155.1597755212178; Tue, 18 Aug 2020 05:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597755212; cv=none; d=google.com; s=arc-20160816; b=f1X++qHygkxLqHIhjLsEw6GCh0HMUYHfvAyiSFbw3TihAZxuFVC5IC7bSB26ts4vXS cW75LpmHj36lox6ZBiu0ZKsUQH2civP7MMuu3Ng7BrVJztBmaymVq4dT0dnbNuXOBaqa 8EGQxXoanzZTRMWUf7GiTrzJSUxnh3tUHSL2dwUmA65L1MdFcMfEhbuXAN2QZ9cpdn9Z uziNhP0CTlmZ9nGx9wIokOQBZtRJgY+3fOEmjkKl/P2fogloIlO2cl9WxE8cU4QLgUCJ h2tU5YvI8pGzzhc2jrWy183qpmqyDdqRnhVMx3gn40w8zTdiWqPMXbiA43jgyWptYFLK 5g6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=y9QZvbmJoGaQT+7idy1gaa/9HxEIYltEcTsXBccWIlo=; b=iqaBbAHn0Afs0rlO2Lxt6mm4KEN9Fluwwq4fxaq5SjUnrzl+nCqo6f1bN8eUlU2XEH mNZZCcLlhf4r8T8r+rWlM1cuU+jBfkGT6J83J+QvcOPAKJZMhyq3Zi5goz4MqnxNOor6 GJQd5LFCz1F/RKJg+7SdpN4995FMydNdKBIKhL/j5mXEJx5HIuf+bHkzigNpNPB8LTJu C75UkI4+1CP4jvojV6QExxBUs3jLXXBQ42EzNsIzyUQQn2t/uM369UT38U0gPd5qtVLU JmJhyqXcToUiJCn6Z3CjRKkr9/j55/w9o7VIA939mCJICqBLAJsronN1xMqdR8CiGMS3 CmQA== 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 k23si13055317edx.21.2020.08.18.05.53.07; Tue, 18 Aug 2020 05:53: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; 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 S1726885AbgHRMwe (ORCPT + 99 others); Tue, 18 Aug 2020 08:52:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:51638 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbgHRMwV (ORCPT ); Tue, 18 Aug 2020 08:52:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E3F9BAE25; Tue, 18 Aug 2020 12:52:44 +0000 (UTC) Date: Tue, 18 Aug 2020 14:52:18 +0200 From: Petr Mladek To: Andy Shevchenko Cc: Sergey Senozhatsky , Greg KH , Guenter Roeck , Tony Lindgren , Kurt Kanzenbach , Raul Rangel , Steven Rostedt , John Ogness , linux-kernel , linux-serial@vger.kernel.org Subject: Re: [PATCH] uart:8250: change lock order in serial8250_do_startup() Message-ID: <20200818125218.GC17612@alley> References: <20200814013802.357412-1-sergey.senozhatsky@gmail.com> <20200814095928.GK1891694@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200814095928.GK1891694@smile.fi.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2020-08-14 12:59:28, Andy Shevchenko wrote: > On Fri, Aug 14, 2020 at 10:38:02AM +0900, Sergey Senozhatsky wrote: > > We have a number of "uart.port->desc.lock vs desc.lock->uart.port" > > lockdep reports coming from 8250 driver; this causes a bit of trouble > > to people, so let's fix it. > > > > I guess we may add some tags here > > Fixes: 768aec0b5bcc ("serial: 8250: fix shared interrupts issues with SMP and RT kernels") > Reported-by: Guenter Roeck > Reported-by: Raul Rangel > BugLink: https://bugs.chromium.org/p/chromium/issues/detail?id=1114800 > Link: https://lore.kernel.org/lkml/CAHQZ30BnfX+gxjPm1DUd5psOTqbyDh4EJE=2=VAMW_VDafctkA@mail.gmail.com/T/#u "Link:" tag should point to the mail that is applied using git am. I am not sure if there is a tag for related discussion in another mail threads. A solution might be to add a comment like: This solution has been discussed in several threads: https://lore.kernel.org/lkml/CAHQZ30BnfX+gxjPm1DUd5psOTqbyDh4EJE=2=VAMW_VDafctkA@mail.gmail.com/T/#u https://lore.kernel.org/lkml/20200812154813.GA46894@roeck-us.net/#t > > --- a/drivers/tty/serial/8250/8250_port.c > > +++ b/drivers/tty/serial/8250/8250_port.c > > @@ -2275,6 +2275,11 @@ int serial8250_do_startup(struct uart_port *port) > > > > if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) { > > unsigned char iir1; > > > + bool irq_shared = up->port.irqflags & IRQF_SHARED; > > I'm wondering why we need a temporary variable? This flag is not supposed to be > changed in between, can we leave original conditionals? > > Nevertheless I noticed an inconsistency of the dereference of the flags which > seems to be brough by dfe42443ea1d ("serial: reduce number of indirections in > 8250 code"). > > I think we can stick with newer: > > if (port->irqflags & IRQF_SHARED) Sounds reasonable to me. Andy proposed many changes. Sergey, could you please send v2? Best Regards, Petr