Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp568354imm; Fri, 13 Jul 2018 02:29:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfEo6/iTaM6GJfMEXt9Kh+/qX6F/8DOYOisPd4ScJYNTcQ5OGt5FQi70eZlr1PQoRUc8jBu X-Received: by 2002:a63:735d:: with SMTP id d29-v6mr5435899pgn.156.1531474164899; Fri, 13 Jul 2018 02:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531474164; cv=none; d=google.com; s=arc-20160816; b=WwsAFXStbL3WAtFlAjP7964t/wm/ybxsstXsufgOsWt8psLUeCBxkppgV5mVr6IuWx mT5vbKnivnM+Cvgi6BZVYKHKClo+flkkXeJ6SzJMOjlbLuJPeYvDVh+xCcjEGT9BhvZm ZyEDlMmnzhaFk9vctbEBVgb0RGMq5cA1pt566oZ40Z479Pwle8XLWyIdm7NU4qci3VMN 0dSA8PaITkfoJA7RDxcMfWs4aMrwzy0mVBObDlF2BwedS8L7JIBVlBMR4qoUBYsQ+8qr Z++r2EmPQLnvM/pyvsm+ohp5mIrWN7EBZRWmTlZoCSIPcvD/osKNFwwJjAu6cy3qGR23 b+Tw== 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:arc-authentication-results; bh=vy1Fkled/trPLsTGBYJrxV8XsyxTncdr3r+P3vsebcg=; b=sC0AKmy/tCwnV8GCtcwZdUISVmTP9RrHWqVX/q+G6ZlOaQ9p7ngpDS3Tic/3Wa6G4z bo/zjIwNFpOBnvHRWip+seE8nmIsvagQKvdZPWQBTFQQ5C2PmFia2/9/WThu8prOs28E TxeP5IR5RX6u/NT0als7se0CZDhtTo7Gz6ilXH5AcSV9zen9cK78OxU5OafMY6sJsTY0 lSUJgpDGv/H/WT6IWJP+drwDJ53LWhnNNxecFaN2ICCb9foJAI1vuCL4nz43zgr+e0CK Fpz5fbFMXnNJqvKUubQinwvVMhYgEfRlB8PhDQq8pGdLEjjoqxTV4/ou1FJ93+S1KUjW HTbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si22837174pln.145.2018.07.13.02.29.09; Fri, 13 Jul 2018 02:29:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728035AbeGMJmV (ORCPT + 99 others); Fri, 13 Jul 2018 05:42:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59600 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbeGMJmV (ORCPT ); Fri, 13 Jul 2018 05:42:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6CE4DBB3; Fri, 13 Jul 2018 09:28:31 +0000 (UTC) Date: Fri, 13 Jul 2018 11:28:28 +0200 From: Greg Kroah-Hartman To: Tycho Andersen Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Serge E . Hallyn" Subject: Re: [PATCH v4] uart: fix race between uart_put_char() and uart_shutdown() Message-ID: <20180713092828.GA6589@kroah.com> References: <20180706212220.GC3583@cisco.lan> <20180711160744.32074-1-tycho@tycho.ws> <20180712150438.GF22502@kroah.com> <20180712150822.GC13192@cisco.cisco.com> <20180712154015.GC13114@kroah.com> <20180712181846.GD13192@cisco.cisco.com> <20180712182545.GA30099@kroah.com> <20180712183001.GE13192@cisco.cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712183001.GE13192@cisco.cisco.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 12:30:01PM -0600, Tycho Andersen wrote: > On Thu, Jul 12, 2018 at 08:25:45PM +0200, Greg Kroah-Hartman wrote: > > On Thu, Jul 12, 2018 at 12:18:46PM -0600, Tycho Andersen wrote: > > > On Thu, Jul 12, 2018 at 05:40:15PM +0200, Greg Kroah-Hartman wrote: > > > > On Thu, Jul 12, 2018 at 09:08:22AM -0600, Tycho Andersen wrote: > > > > > On Thu, Jul 12, 2018 at 05:04:38PM +0200, Greg Kroah-Hartman wrote: > > > > > > On Wed, Jul 11, 2018 at 10:07:44AM -0600, Tycho Andersen wrote: > > > > > > > + if (uport) > > > > > > > + spin_lock_irqsave(&uport->lock, flags); > > > > > > > > > > > > That's the same thing as just calling uart_port_lock(), why aren't you > > > > > > doing that? > > > > > > > > > > Because the compiler can't seem to "see" through the macros/ref calls, > > > > > and I get the warning I mentioned here if I use them: > > > > > > > > > > https://lkml.org/lkml/2018/7/6/840 > > > > > > > > What horrible version of gcc are you using that give you that? Don't > > > > open-code things just because of a broken compiler. > > > > > > I've tried with both 7.3.0 and 5.4.0. I think the reason we see this > > > here but not elsewhere in the file is because there's an actual > > > function call (free_page()) in the critical section. > > > > > > If we move that out, something like the below patch, it all works for > > > me. > > > > Ick. Which version of this series had the problem? Let me test it out > > here... > > v3, if you remove the initialization of flags from both functions you > should see it. Ok, I tried v3 out and yes, you are right, removing the "= 0" causes gcc to complain. The compiler is being dumb here, so I'll just leave it as-is. I've queued up the v3 version now, thanks for sticking with this. greg k-h