From patchwork Fri Mar 8 12:28:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Heimes X-Patchwork-Id: 1909682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Trlpq2kqyz1yWx for ; Fri, 8 Mar 2024 23:29:23 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1riZLd-0003q6-Oj; Fri, 08 Mar 2024 12:29:15 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1riZL3-0003Qx-HW for kernel-team@lists.ubuntu.com; Fri, 08 Mar 2024 12:28:39 +0000 Received: from T570.fritz.box (dslb-084-057-174-001.084.057.pools.vodafone-ip.de [84.57.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 249CE40EF0 for ; Fri, 8 Mar 2024 12:28:37 +0000 (UTC) From: frank.heimes@canonical.com To: kernel-team@lists.ubuntu.com Subject: [SRU][J][F][PATCH 7/8] hvcs: Use vhangup in hotplug remove Date: Fri, 8 Mar 2024 13:28:19 +0100 Message-Id: <20240308122820.316586-8-frank.heimes@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240308122820.316586-1-frank.heimes@canonical.com> References: <20240308122820.316586-1-frank.heimes@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Brian King BugLink: https://bugs.launchpad.net/bugs/2056373 When hotplug removing an hvcs device, we need to ensure the hangup processing is done prior to exiting the remove function, so use tty_vhangup to do the hangup processing directly rather than using tty_hangup which simply schedules the hangup work for later execution. Signed-off-by: Brian King Link: https://lore.kernel.org/r/20230203155802.404324-5-brking@linux.vnet.ibm.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d432228bc7b1b3f0ed06510278ff5a77b3749fe6) Signed-off-by: Frank Heimes --- drivers/tty/hvc/hvcs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index d3c95b2c8eca..83748197465e 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -840,12 +840,11 @@ static int hvcs_remove(struct vio_dev *dev) tty_port_put(&hvcsd->port); /* - * The hangup is a scheduled function which will auto chain call - * hvcs_hangup. The tty should always be valid at this time unless a + * The tty should always be valid at this time unless a * simultaneous tty close already cleaned up the hvcs_struct. */ if (tty) { - tty_hangup(tty); + tty_vhangup(tty); tty_kref_put(tty); }