Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp478927imn; Wed, 27 Jul 2022 11:20:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRyi0q6QdYr4YSb4WnIcP2o7hMqgVGLd3blJxov60ipAl5V0c42f7+3yjBeAu10yLS7Wbi X-Received: by 2002:a17:90b:4d12:b0:1f2:ad15:3ee8 with SMTP id mw18-20020a17090b4d1200b001f2ad153ee8mr6019321pjb.82.1658946017027; Wed, 27 Jul 2022 11:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946017; cv=none; d=google.com; s=arc-20160816; b=EiGA49W6g1KHUNcFoQ70zcQPDjpHkV4r90A5Mg+EUNWKsDzEfHCi8I8ERWNAGcQR69 pxaaBTFUG0JoEq4J0QvG98FdaeYW0Dx5DoVxpa0VMWk2l74gxNpcQJjwpLSn2h0oz4PN 3lo64coDR9sCisQsykzHZhtJk1z7UT685EKFja0if8IUdp6iTg/wz729BXbCu0SmuODz JhoSeq6eOC36fZpl+6wrf+mucEAjyRboVXp5QxNTokjGOI3Po+LhgcG97jS/e/a0+V5e l9tC3Aq6LZe+WA204TBSu74k2lluDP9xpy1vGk/+CXwrkz31/DTFD6ve4ua5sT81n5mE fysA== 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=SLBpC8h7MDfR22oEwwCDtFoxsHHp12n1BkeEQpAYneg=; b=jr+6RneRaK2J19RLSqpD/7VQutPV/o8QCWI08qqCS4OB8A60Ytl6F/CMsaO3xRZ33/ GGGlRADXQ4V7Rt2yk64r19bX5dByVInIKDSWGpECx33x+olF/QASLAZZ+/o8cmVI+fPo dxefIIoWyupKoQ47FQKIvD/3O1bEfGD42R5lCQzLRgY6osDdHJggWQTY1q+rA5fuAcwB T8ZD6Z9Hd+FINRGp6qFlQ2Os8NEyBIpXhBpMTadLQeuGlzrxCDZ2r7XCECrPz1WOFZ+w pXUCChukOTysUW+4ciy+EW8k6RP3LPdcAJrFRWCs8Vv1tYUDUtQHubsNesoFQzp+RZHs 3W7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kKNj9Nqn; 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 h4-20020a170902b94400b0016da06eea1dsi4833140pls.130.2022.07.27.11.20.01; Wed, 27 Jul 2022 11:20:17 -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=kKNj9Nqn; 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 S240568AbiG0Qtz (ORCPT + 99 others); Wed, 27 Jul 2022 12:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240640AbiG0QtJ (ORCPT ); Wed, 27 Jul 2022 12:49:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADDD56172E; Wed, 27 Jul 2022 09:32:40 -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 8393B619C0; Wed, 27 Jul 2022 16:27:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93EB5C433C1; Wed, 27 Jul 2022 16:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939257; bh=vKTOit1j4oqPUe/wwvhNKAYzkOLY6aMMJK7gUc90wME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kKNj9NqnVgOzdkTk724bs/PkD7mCyhvmFYzWCUEQJjupnjHhxKjux84pAyiEHhO3i 1VCfLAwELtnNNyHwlGCrckrI4/nEGUd8PEnLtQdIOR5y6/Fm979+W70ObwC0pZdxXp 0KW6xfgrHJ6m+pAoLUUGLl2hcXXvU0JkgNMQ1GNk= 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.19 56/62] tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push() Date: Wed, 27 Jul 2022 18:11:05 +0200 Message-Id: <20220727161006.333043974@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161004.175638564@linuxfoundation.org> References: <20220727161004.175638564@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 @@ -518,6 +518,15 @@ static void flush_to_ldisc(struct work_s } +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 @@ -533,11 +542,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);