Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1269167lqp; Mon, 15 Apr 2024 00:33:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUer+eBOMJcuchUSXoiWDMQ2/mrd2HyCtB1BBHP69Z1qhM/hd5ciw1IWgCqEeT0hTRHT4K7lm1fFI6OQd6CiVQbegV7ZIw2cqAjzQTqXQ== X-Google-Smtp-Source: AGHT+IGi87/QfvOmpo3TYHmlrIjGdUI/bAKKFWoPgSevTJECKZb9lPhLqzqXYfwG8hc/eG4GMBGG X-Received: by 2002:a05:6870:d05:b0:22e:9574:6121 with SMTP id mk5-20020a0568700d0500b0022e95746121mr11041030oab.14.1713166423906; Mon, 15 Apr 2024 00:33:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713166423; cv=pass; d=google.com; s=arc-20160816; b=a8UgEE/lP1J3+Bii3PHKkAmQ9gaydA7zCeb/tzQgZtG4WUAAl992riJZpnBu2Xw71n 544xgQiJaPUQr50CTDiSrOBONrxOY/zt3YbULdzYIwHuf1orl/QVKgIRhO0n0OIdYGKn CeyDccUBgEqbVnv9wGTkYrQosoRozP7o/2fF5AKmKnGEguu0WJodiCL8VulwYKDWjYxN J7QKLfNbbGrhLw+UsljOfN5QFYb3qdwX9vJD52PDhofr6eMpKfeiVgNm8sBKZUPMVR92 zTeLrrlvdm7Yja4n9dWxnQBhi7VwRrRAkLk8HgqgyPGWKfqvEzJfSlr88l+n2LwxnRBl g7MQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Zzoee2fqr2hA5OfQLbpuKlFWLgqT9zW3rxNXEr9h96w=; fh=+aLsz8LEEC7tm1hsWjSLHIZWRK/wdD2tkPur6upFDyc=; b=c+1cToVCPECSQ1a2hwdc4sMJ2PgmxX9Ql2lF2CeN0iEwOydgUpwVHbQk6nncVxjuu7 OQ6OOiMnIJsItrmCUF+IvTJNB/4PkYkmsDuUYIEDvkoHojgE+tmBw5+ZJVKTFxaVF6b9 gtHqq7uHODeDhXnIrkBzu6d3cO96qWXuPfzzJJmgDkobM2I77sWchzYqi0b+dPp2Fqmb YuFY+RETPdgzSthx/OF4Y3tj3LyKTExBkIpU5rR0qyQJyBKZjIOUdaNmeRWXDVkB0c0l N0XRULsQ/7qe5oVDnm6fNMHiadHffvuGWvnZeHVhCco+EIdi0yVrTjYlk17wScrkiYwB Ip4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K46aGOps; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-144677-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x22-20020a056a00271600b006ece0e619f5si7378774pfv.36.2024.04.15.00.33.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 00:33:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144677-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K46aGOps; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-144677-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 17DFD2856F5 for ; Mon, 15 Apr 2024 07:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29FC524B34; Mon, 15 Apr 2024 07:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K46aGOps" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC5E23763 for ; Mon, 15 Apr 2024 07:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713166384; cv=none; b=qa2/+mynElCm6NmTYDk+fBBdXHwDU0MJPIW5hL1lf8pfn1I3fsTaiYCytvwfnA7Qge4UZz0YX3MuE20yPQ0aMSxcuoBq9C89UGyaptLrloDQyUPk18RpEZPEhaTydHM0Uw9F3FPB/acgtxmSXVIgB6MW1W/jXjgB4Vum2ft6H44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713166384; c=relaxed/simple; bh=HulXt605iuUDWNZIZsCC+JKKUiQZcW1J0o0UnNGNdvs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hL4apzN6O+MJhlvcCH+Qnl13GBvh8m7MkArAxVv8jRODLFmXtJ0FiiyADqw7Xmns1/bDTNNxyyTrZ3DbNdn7Ai6DwAAdIKDrrEtu/JBhFSH6V0tegNZBetfqdiLpt8MVzaL+h6A6rDGfxnAIfiyyBRz+oBg54vJfaFZ2Yy73mKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K46aGOps; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CB6C113CC; Mon, 15 Apr 2024 07:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713166383; bh=HulXt605iuUDWNZIZsCC+JKKUiQZcW1J0o0UnNGNdvs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K46aGOpsj6wmLaobqllJwK4TnGyGVXDuTVnR8nBLVeWjxALN0+QdN+IFw1JCVWPnJ GeeNTiCUxWcnXevgo/1tti3AkCZUYM5qP4d4RwEArlbOz4UOFYhxQ7Q6JELQsZt58B tnU/8GTYNH/CZ+NXJbTo83skk62F3bGhkieDydVY= Date: Mon, 15 Apr 2024 09:33:01 +0200 From: Greg KH To: li.hao40@zte.com.cn Cc: jirislaby@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tty: hvc: wakeup hvc console immediately when needed Message-ID: <2024041531-caliber-overreach-2d4e@gregkh> References: <20240415152617552rmRLJBUV8aJ4lLJILh6-Z@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415152617552rmRLJBUV8aJ4lLJILh6-Z@zte.com.cn> On Mon, Apr 15, 2024 at 03:26:17PM +0800, li.hao40@zte.com.cn wrote: > From: Li Hao > > Cancel the do_wakeup flag in hvc_struct, and change it to immediately > wake up tty when hp->n_outbuf is 0 in hvc_push(). > > When we receive a key input character, the interrupt handling function > hvc_handle_interrupt() will be executed, and the echo thread > flush_to_ldisc() will be added to the queue. > > If the user is currently using tcsetattr(), a hang may occur. tcsetattr() > enters kernel and waits for hp->n_outbuf to become 0 via > tty_wait_until_sent(). If the echo thread finishes executing before > reaching tty_wait_until_sent (for example, put_chars() takes too long), > it will cause while meeting the wakeup condition (hp->do_wakeup = 1), > tty_wait_until_sent() cannot be woken up (missed the tty_wakeup() of > this round's tty_poll). Unless the next key input character comes, > hvc_poll will be executed, and tty_wakeup() will be performed through > the do_wakeup flag. > > v1->v2: > Some fixes according to: > https://lore.kernel.org/all/75dff5cd-7b0e-4039-9157-8bf10cf7ba29@kernel.org/ > use tty_port_tty_wakeup() instead of tty_wakeup() to wake up tty As per the documentation, the v1... stuff needs to go below the --- line so git will strip it away. Please fix up and send a v3. thanks, greg k-h