Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp501971pxb; Fri, 15 Oct 2021 09:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk8HIkbMJMS5hsBukudlbzbD4menkaXtIU/1NpB3jcgyz1oBxvJLvoK3qtSPocTBddSF+/ X-Received: by 2002:a17:906:6549:: with SMTP id u9mr7898439ejn.514.1634316587642; Fri, 15 Oct 2021 09:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634316587; cv=none; d=google.com; s=arc-20160816; b=JAaHUBKj3/NhgKTWDG6n/wa/ckwpXuLoEhdZwXYJDUoqMf9YRolYaOQA7a9UVSgj7T 9GJ1aHJg5gTsGN126wnHLeAccfbkbK2oF5dNWd9n/fVq/QgDqhfFxedBGZ2WlGBMX5OR Ovdztg07RKvlURdr/kOHt5n1nW82h2TtTU/UXO536k81Iir9ADyZyEbgcEIaOjcBIRck fRCsjVAsJS8e87wg3iVAi9tjXwAP1uDZNwKZhgpZRbNDPUmWrK1DnhlrPxUc95uQWWgi GMdH5QRwFL3wGN3/XtiCLfuAjOL0VBe1TIUMy9fdgTL/F6tzpepY/dh0gTbkbf3egYiT fkNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yL8I/fpb9XNU45qST4UPK6zQRDaH+uQXsgJbT3Bfm1o=; b=J2LZmLLCkzQXYGskdqqtAKLpq/ClTHQ7rbnGIsT8PGc50c5a8viYZ6QAqHV3saCkKv Nc62qhE3mHQxwlHf/7iMIXp0d25MnPhc2V/TPXy7C3mPxm+xB1I/FTJwncSZadWzZi/b iIsOBl8kPELL+1Nf2qVrAkx3wG3f0KEWfLmrpc/jncFPG50nqielrWYribMiadr4xE7E RVMNZ3to8VjJLev5xgPG+TUSayVgfYTv2Re5li9prp/5ShysO0Y7/UBd+PJGe4KGuhgs qZJ9QuIX8TE2t856LbViMTixE1ciFPjatTPIzSwGabkOXodUnuLPmI9xm5lmcwfhCM/K MXuQ== 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 w14si8428703ejc.561.2021.10.15.09.49.22; Fri, 15 Oct 2021 09:49:47 -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 S236354AbhJOJPw (ORCPT + 99 others); Fri, 15 Oct 2021 05:15:52 -0400 Received: from muru.com ([72.249.23.125]:44812 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbhJOJPw (ORCPT ); Fri, 15 Oct 2021 05:15:52 -0400 Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 6F00980F1; Fri, 15 Oct 2021 09:14:17 +0000 (UTC) Date: Fri, 15 Oct 2021 12:13:43 +0300 From: Tony Lindgren To: Greg Kroah-Hartman Cc: Andy Shevchenko , Jiri Slaby , Johan Hovold , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] serial: core: Add wakeup() and start_pending_tx() for power management Message-ID: References: <20210930062906.58937-1-tony@atomide.com> <20210930062906.58937-2-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Greg Kroah-Hartman [211013 12:34]: > On Thu, Sep 30, 2021 at 09:29:03AM +0300, Tony Lindgren wrote: > > --- a/drivers/tty/serial/serial_core.c > > +++ b/drivers/tty/serial/serial_core.c > > @@ -91,6 +91,23 @@ static inline struct uart_port *uart_port_check(struct uart_state *state) > > return state->uart_port; > > } > > > > +/* > > + * This routine can be used before register access to wake up a serial > > + * port that has been runtime PM suspended by the serial port driver. > > + * Note that the runtime_suspended flag is managed by the serial port > > + * device driver runtime PM. > > + */ > > +static int uart_port_wakeup(struct uart_port *port) > > +{ > > + if (!atomic_read(&port->runtime_suspended)) > > + return 0; > > And if the value changes right after you read this? > > Why not use a real lock here? Don't use an atomic if you don't need it. Yeah good point, we should just use port->lock. Regards, Tony