Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2008390imm; Thu, 12 Jul 2018 11:31:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc8WSZgC5j9f3ShXF2RVDZMllyXlZZFfSgcVaskpZ/CpSz+vHbiid0Z13C6ECCjOvK6s7BF X-Received: by 2002:a62:ac12:: with SMTP id v18-v6mr3532618pfe.126.1531420261264; Thu, 12 Jul 2018 11:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531420261; cv=none; d=google.com; s=arc-20160816; b=GQLvFvD9YkX7C/5u74DqgIzm4EHWSwXGD8m4kUYcBqWYebs4UXL3VWdwiVDSrwxs0w jeREoHeL/yD0NKzTr+xDD6VEhfa8w4B2ejLvYp4//WZXKi7yIvaOtKmr4Rm1vIw1P/q1 LO+1UhGhQj/qI9VjSlsev3gF+LBUOV/dBCfxxcte9XJC9rHpjmljfPHDaRJcirQ2sMYr 8dl5OszaY45au//NhBwdUk2VUQ+XJiStGb5kV1slWUV69s3Qc8kEcvEYvo27JgR48n6R z5cTSQ6MK4uFLnNjDEkrOvWgn8rrpgkjAY4AiZ3K2E1q/YodLvCjohSekBUq+dFydPy+ ehHA== 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:dkim-signature:arc-authentication-results; bh=tA3HDK0TCXsaY5W6Jb7kk0KxJYXoFW2pt7zKS2PMEac=; b=ZP8KksqFcJcmFyORagroTpPqYN4HpQ/DZk0nGopajlptauPXpCZl8CTOo6PLDJutpA xCHP8np6kHu2ykJms508kAX5gHY75ppIZ5IhYHW4hWSNHpXYnkosKRmRg9SMZvD+kg+f 65Epi5oVBkkYDFmDiLGuSwuUnK0zRFyMXBSKNJWz2ZeUUAvpV1xXXx0rZ8K6tJdCT6qr RkFUSiyDpIEYtpBxy8iMEVTA/zXq7cH6XEPLQKzJgh5D7GDbR9GTU4h7JfLdYiJ/8kdC 0joC7dRm5vR9NCkb5SZOPqq9cNl9ehzuEwALccrGojWx7d/LunHKxerw7iQi9NYFWNoq aRug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=GLwF5z5+; 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 w61-v6si21699546plb.502.2018.07.12.11.30.45; Thu, 12 Jul 2018 11:31:01 -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; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=GLwF5z5+; 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 S1726778AbeGLSkz (ORCPT + 99 others); Thu, 12 Jul 2018 14:40:55 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:33905 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbeGLSky (ORCPT ); Thu, 12 Jul 2018 14:40:54 -0400 Received: by mail-qt0-f194.google.com with SMTP id m13-v6so24971989qth.1 for ; Thu, 12 Jul 2018 11:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho-ws.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tA3HDK0TCXsaY5W6Jb7kk0KxJYXoFW2pt7zKS2PMEac=; b=GLwF5z5+G5ltTCXUc0G2NIn/LtbQI7Anc71F5HoeOM+kmhesX/5A24UeF+U1vSiQMQ 9rtQvlg4H4Lw2j3RReudebkr1B9fF2XHTXtLbPMxna4rPNOuubUqO7J7M60I7jgQnmcV cQEi9hopdc8rEzkxpJ5hAKCgKp+Xj0dlkA2TbT+vcKGXVDU6E5CubB9UxhprK8qoy4C2 Lnk7FnDZtnFC8gYgEFtfpx2s6pZtB/fgx+khqP+Tk83FT9RKbvhUzK8Jis83J7tQaZep ouUUf1580MCCP/8Ro5ZvgAwXEc+LBzkF+0MuTue8TuxCfWQeJkkGmk3p7li1wg3CkKW6 PvMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tA3HDK0TCXsaY5W6Jb7kk0KxJYXoFW2pt7zKS2PMEac=; b=USGImGWhsoxQmKpElY2b3PIEZ7sBNhiryjktHP4ci4Fis49D7cRvtnBzUpx+/s+2Va CJ42huFxBo6YYloFUlt4I5NSwU7I/GPqQ5TM3n7NK6PvhYAZWCD5c1LVuBSq0qy8vJyQ D79NwDhmz54BajHRVFrZkvxx4eigVlWYMUddGqsv22PBQQQjtFpp7gcibNEFpBdCI2Jm xOsj1nw4TqjppRhrY3l+5InL9B23vx2tu15AI089UYvQwFgrMMcURzOlrrGfmfFSSW0i 8cnzTCDhi3548r7TClIwCDlzeyjyFzXwTW0hjw1dLoDUg1jTgfVUUXoMiEAL/LUctOKQ wnPA== X-Gm-Message-State: AOUpUlHYLySKGdV7/DNMcVy8ruSwaPut1W8/PWQ+77Ol2Bh4K1vvYkMM 5I/GlgaUozpvh+loJUycocbUVvB+ X-Received: by 2002:aed:258e:: with SMTP id x14-v6mr3001781qtc.308.1531420209842; Thu, 12 Jul 2018 11:30:09 -0700 (PDT) Received: from cisco.cisco.com ([173.38.117.87]) by smtp.gmail.com with ESMTPSA id c93-v6sm25603225qkh.90.2018.07.12.11.30.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 11:30:08 -0700 (PDT) Date: Thu, 12 Jul 2018 12:30:01 -0600 From: Tycho Andersen To: Greg Kroah-Hartman 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: <20180712183001.GE13192@cisco.cisco.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712182545.GA30099@kroah.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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 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. Tycho