Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1055717imm; Fri, 29 Jun 2018 10:35:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIDbxIP2cSa532A8AjDSXD1YkNX83GZiRGIg+kIUK7uJ8DV1YmWdBsFbOWJbMGYiEY/ufk X-Received: by 2002:a62:138c:: with SMTP id 12-v6mr15573055pft.34.1530293738346; Fri, 29 Jun 2018 10:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530293738; cv=none; d=google.com; s=arc-20160816; b=QcMGRoq/u4aL6JUTTYLbwSlvTfxIRIaFLR7wuzZ3GsKshO91Tt07oI2SF9lZvjkVGi uqcSnEV6MkAoSZ0/hU3E+upT8NmZ8rDTObsRQMCL9bvOD9ETNg/03DJ6MU1Q9HzOuv7F UqfS8ZXGxeoHlXOeaDNc5O3MJQD65nNP8hpETd2Qe5q1VOHFxQ4FUanW47LkXvtQEtwq 34YNBCWoBQxnCTOoCIxyM4SKJlwSLM1CR0pjKlNn5mThX7w+L7QzkiMUM2JQdZck8yf7 vuoDS2hGQ2vOOzURZ2yyrq1vik3npfKXa+W0u2waddYdNQw71gxpQQg5+jARYQowYM7q VEgA== 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=hW1Zkz2qu4KPlp1/IbQ+jjB4wOqLnYg4iC6qrKZnYE4=; b=0PAIQn94a8WJf5pmdGC8037Pir623oZmuYTDW5ut5vR+Om4q/VrR6dXXiFa9FuNSng 97++ijOGSX+FixPKfITYXdcLV0nmqqI+Sg2lbpubwkrRtjJolNKAlCW7fnMVTDNyQi84 jpfCHDEzUWZjLsJEs47ZvcuTBxobvr9hWlnCfXI9S7+IDt5duIk+wIl1q4SURp0L4hAO jKyBiK6MyIg/zBNDAb43sWGlK4ZUmuYyp0+/t0IVUwwC88Mhd8TAx9mlvVBhEyrZnpIF gfkUNey1PJLMbuIiYd5aj17Eo6RnA11+ikf2fc49PUsIfg2i+PvY+s32aBR8dUqjYTTR h8Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=Ji9uP1Lx; 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 y192-v6si7783462pgd.656.2018.06.29.10.35.24; Fri, 29 Jun 2018 10:35:38 -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=Ji9uP1Lx; 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 S937030AbeF2Qnh (ORCPT + 99 others); Fri, 29 Jun 2018 12:43:37 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:37431 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934630AbeF2Qne (ORCPT ); Fri, 29 Jun 2018 12:43:34 -0400 Received: by mail-qk0-f195.google.com with SMTP id t79-v6so5258693qke.4 for ; Fri, 29 Jun 2018 09:43:34 -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=hW1Zkz2qu4KPlp1/IbQ+jjB4wOqLnYg4iC6qrKZnYE4=; b=Ji9uP1Lx6xEyPovDlWXqLqX6q/nuwiC5dgo2XbcONxTXD9xWvAkQGKcIj4wDqXy874 USr/QV1Jt35aJ0iPQdB5vBCVEdTM4Xt3eXOzUSVhSoMO4bs8NSCrDH0T9VAUDhUuufOW ByAAy7XuZkI1kvjUl7zW8EWqh6serKu+dhtPCYETsHANZdLXobGDnEqQU+O/XHvWGK8D p0g6BM/Or08uB9r6BGymEbpkst9u8lZAxMg+5jWLJP1zNB2MZdRBkmvSMMSO1KigRo8D /zU/b93C0EIN/L0UHVc3u7KNMDF4Fz6G0KKJuBREoyhJI4L9D9xenXoK5wiYNF8aaIS0 fN5g== 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=hW1Zkz2qu4KPlp1/IbQ+jjB4wOqLnYg4iC6qrKZnYE4=; b=dDdtitdSyx6J7hnT4O1jhxpMb1KBfsbajVzu5d5D8WeEUMZ94Mll85s3whrmkAay94 8AOJFeKFoCerDMALG++9xHIPiJZBMqmlYPDktPStIZ7ePtieCLt5EZ3N7FcY7XGBTBUK cYcdggUgLALmhZuZBmTJipk2Mqpau6Ka7dM7V0sVIpePXQ9uVP9Cj7DTQLMb25rotAr5 BQkbLmLk21DFrN+A46uKjEJXkBaa2Ujvnr6o4SBjoizEGyD8ASRlQyBGSj9+7eSovMLt CwSrjV83irJo9w+o6mNZnkMlSd2hX+ZP5u7lfO0TWrELdZ6G3u4SE7AdAXk6HkPY/2vR hoTg== X-Gm-Message-State: APt69E1nW91LOTCKEPs8s66Wveq3KUl380agXtQl3vMDjVS2RViP3a2Y vU8gu8OfI1svehPa/Ip4v/81Kg== X-Received: by 2002:a37:a0c8:: with SMTP id j191-v6mr13066175qke.375.1530290613900; Fri, 29 Jun 2018 09:43:33 -0700 (PDT) Received: from cisco.cisco.com ([173.38.117.73]) by smtp.gmail.com with ESMTPSA id p189-v6sm6496022qkf.70.2018.06.29.09.43.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 09:43:32 -0700 (PDT) Date: Fri, 29 Jun 2018 10:43:30 -0600 From: Tycho Andersen To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Serge E . Hallyn" Subject: Re: [PATCH v2] uart: fix race between uart_put_char() and uart_shutdown() Message-ID: <20180629164330.GL27027@cisco.cisco.com> References: <20180628120542.GA4065@kroah.com> <20180629102446.11189-1-tycho@tycho.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629102446.11189-1-tycho@tycho.ws> 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 Fri, Jun 29, 2018 at 04:24:46AM -0600, Tycho Andersen wrote: > v2: switch to locking uport->lock on allocation/deallocation instead of > locking the per-port mutex in uart_put_char. Note that since > uport->lock is a spin lock, we have to switch the allocation to > GFP_ATOMIC. Serge pointed out off-list that we may want to do the allocation before the lock so that it's more likely to be successful. I'm happy to send that change to this if it's what we want to do, I don't have a strong preference. Tycho