Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp480242imn; Wed, 27 Jul 2022 11:22:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgqK4RiO+wvLVq0TMfroPQXxFM+jxoKaEiNg7a5cV/vHOuCWfUvIBownrmCr3DRDDZEyz3 X-Received: by 2002:a17:907:7ea4:b0:72b:6929:4571 with SMTP id qb36-20020a1709077ea400b0072b69294571mr17937904ejc.257.1658946145902; Wed, 27 Jul 2022 11:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946145; cv=none; d=google.com; s=arc-20160816; b=NwtstMrdZIxCsWTndGy2JjC3onQSpOsyLVWU7VrHZmbFGVI2tY7hSICagOCvkIPn/g CZtSq1YPTXGj10OUV1n7825cZF67VhESbRlqVQckMgV2/Ki/+JNQj8kfUN+XgIHrf7s4 Kqtp9b22LVXpoJLaUYXWPUjZ1LuC11LxEj4N++NXzgdM8ovs21KeCLaOlikS1Vis+Li0 2Ov8raekQHM0MOvRaXXTDfzoB5GzIoaOL47Hlr6aqDvrPNp7exJzGcuQmTKr1e6seI8J 4tw1aBsl1qgeV1JlTn7960ihcpK42wAsAsbc/Y4VqDjebAM0mtPvJ/ddoySfXzRjqTHH KABQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JEAZL/vGmhd0Z1mzQfEpR6w0g+EtAxklVEF57OthuHE=; b=EFriC9kaexYzzljb2T8KoP2woXS0RRnwYCJ8bwysv3/1fLPK522ijCoA/7hFvxGPPX 5fE0jQ49rRl0bJQ74O1FFk0T/qZzmGTsJ7EBTthRBxdES3uj/7EYAEEESzGs69vUUT76 d7J5u6X2jV8O7hNUdsM3X9UFDFBzguLMddriIjTr6NJSBQRqWqH13Cdzb/NupHfDs4m9 sBoFuR3QL4aZHul4Wd8qRHum01AbLOWtTdYMYWwBnXbHaCJkzgMdBr3g+93qrAZQBcJt cGsethScpNtCrjsLOPnLwtTQZhXLQU73MK7N5i5G+oDroO0WToefzdEgEQzmVrMww1tf QegQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ia3Fy2vI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a05640242d500b0043a4cff7e3csi14429812edc.423.2022.07.27.11.22.00; Wed, 27 Jul 2022 11:22:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ia3Fy2vI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235742AbiG0QXt (ORCPT + 99 others); Wed, 27 Jul 2022 12:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235738AbiG0QXF (ORCPT ); Wed, 27 Jul 2022 12:23:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DAEB4D4DB; Wed, 27 Jul 2022 09:22:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55E52619CF; Wed, 27 Jul 2022 16:22:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62B5CC433D6; Wed, 27 Jul 2022 16:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658938967; bh=UK1VOdXVVn5+yhhI/M4hguhOG81C+djP+Xywz0Dklko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ia3Fy2vIBKQ4s0c9p1+N3ANyi3443cGd6MyTlAF3o/yuQPt5/4nAx9camR8KzTz8P jsI4uOiAAE25x1qFrChn6pvcf+gYyBAZY4t9Egw79W8nM/RQWWGdJMMeIG/MzI6zD4 8CDy+kz6US+Lrg+VzZ3uXw1v+tS6PiHKcXznuNwA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hillf Danton , =?UTF-8?q?=E4=B8=80=E5=8F=AA=E7=8B=97?= , Dan Carpenter , Jiri Slaby Subject: [PATCH 4.9 24/26] tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push() Date: Wed, 27 Jul 2022 18:10:53 +0200 Message-Id: <20220727161000.083152864@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727160959.122591422@linuxfoundation.org> References: <20220727160959.122591422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Slaby commit 716b10580283fda66f2b88140e3964f8a7f9da89 upstream. We will need this new helper in the next patch. Cc: Hillf Danton Cc: 一只狗 Cc: Dan Carpenter Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220707082558.9250-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_buffer.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -526,6 +526,15 @@ static void flush_to_ldisc(struct work_s tty_ldisc_deref(disc); } +static inline void tty_flip_buffer_commit(struct tty_buffer *tail) +{ + /* + * Paired w/ acquire in flush_to_ldisc(); ensures flush_to_ldisc() sees + * buffer data. + */ + smp_store_release(&tail->commit, tail->used); +} + /** * tty_flip_buffer_push - terminal * @port: tty port to push @@ -541,11 +550,7 @@ void tty_flip_buffer_push(struct tty_por { struct tty_bufhead *buf = &port->buf; - /* - * Paired w/ acquire in flush_to_ldisc(); ensures flush_to_ldisc() sees - * buffer data. - */ - smp_store_release(&buf->tail->commit, buf->tail->used); + tty_flip_buffer_commit(buf->tail); queue_work(system_unbound_wq, &buf->work); } EXPORT_SYMBOL(tty_flip_buffer_push);