Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp427880lqg; Thu, 11 Apr 2024 07:14:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjBZ+vIy/tz2QTOHK8mKHmt26lOmrVIQfYMeggWZvhSerkeHZmMq9WdCbOjVDFxAXTeCZKPmCuIJqgEwM0QWy4QUr02m9ERxaw1JdqxQ== X-Google-Smtp-Source: AGHT+IFNuAN9kaeTnUczuAVxTPuh7eSmLNZN1XrSY3zNyyHdZYH0TF9klYQF/7hVhpT6kyM+AoWw X-Received: by 2002:a17:902:f682:b0:1e4:4740:2114 with SMTP id l2-20020a170902f68200b001e447402114mr6371500plg.60.1712844898253; Thu, 11 Apr 2024 07:14:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712844898; cv=pass; d=google.com; s=arc-20160816; b=B+uoAEYpdPdf0gYAJdD+pAErbxB6q9TtnRKy1ySe+aNz61MD3dQMRVzA66CY74Ir/B gwMg5IRwk92zJOQz9+RNhkJ0cGYSrUlCfi5F6AvhpzyWTjWE+fJpoVVL00A0Y91pklE+ Lddofez4ODwuIWQFruieKzGzRqpSI6NzwBC2mw0lpWnVg65IouET4ApbISLtlRlzF9pX NglJiYEwh37fdvT3BoBc/q75m4pzj0Hj82kT5vVwr7DHmDlABzMJHlnoov/VTfiQWieu ybNjL8HPYj+GsQB+Qa+B16ifigb9OTardT8HoDaDB4JcOAsq+jMP9iu93WKC3ep1QK1X rQ4Q== 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=3vXds3KVcuZlRY05DFEPXFNVxq/LOtEoY1XB5geEbMk=; fh=+aLsz8LEEC7tm1hsWjSLHIZWRK/wdD2tkPur6upFDyc=; b=vatDnwJspyizOc1WcT2DjmcXVCDwJRzKUfJ33GPdYRyJaXaxHSyVZS0RBKnGxcKrle BO8soe1tlmQTiucv4u78N6NxKhMNB/0V+L4V8rGH7hw9jJNFtP5Z/8T0lc2Psqe21CWQ xYA9CY2gQhz0NiwV0ggUF/WGXirr0NMcpQ5XUZYL/ujCOJvrPyI+gugkgfZyu5BFu8xS WgGYip3NjpaYNM8ltfL2c82CdNSLHflxv7NWZLgDaWdFtTrprC9uLvJaoXYIZWocX7kL 77jfvxeaQvTNeOnddpdy/xbqh7g21H13KMHJRAXTLXTCRjwlPqOGBCN7KaghvBlJPxx4 5Bug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0NcGI5ol; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-140591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140591-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id me12-20020a170902fc4c00b001e510d549casi1387750plb.294.2024.04.11.07.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 07:14:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0NcGI5ol; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-140591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140591-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 DEC5E288F5F for ; Thu, 11 Apr 2024 14:05:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8356114F12E; Thu, 11 Apr 2024 14:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0NcGI5ol" 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 ADE3914D443 for ; Thu, 11 Apr 2024 14:03:03 +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=1712844183; cv=none; b=ShY+eCfSuPDg6gVmQdF36YHY2ZBF+joyP2mtfw0CdTONa7m32bscSctIBi/aPiaCEihGEjp7OgemYIdocOYlecedurFK9iMDZhiGqDf27y0Tl4dcpMLQQ2hlHR9t+TXYWM80lz3nWRt7FAIkPbKi4zDOBmDmncROwA65WKndQF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712844183; c=relaxed/simple; bh=6UJZZ6IjHCrKomyVcGWFI8QkbjcakZqKcaKnyTXHAhA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BPFoi6fnlV/J36uzFdoSuYJibgIK0X18L6BmUgsQwADlQlOfXV3zlyFySmSMhWxOnRdoueiiZV60tf+uyMpgFlVrRZrm2Lq17sBACBaU7K74rmxt0v/Mkr0jKKYcwq89F5vxUByl1tQ15oyvtg2fg3rtAGdql+f4oMSwKjbm+ZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0NcGI5ol; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE959C072AA; Thu, 11 Apr 2024 14:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712844183; bh=6UJZZ6IjHCrKomyVcGWFI8QkbjcakZqKcaKnyTXHAhA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0NcGI5oljWMkz32EWruHRpi43mJPvYvSKu4mleZsj5+GOQTshIcV111wtKcQHvsNp XXfxmBKYOpZh4N6vL8eBzbUdsIlu//opGukHcs5BzJI+9f8trzvxeTsj6dlgnoiYd/ 32oIUS7dqxBHJXAPFn+chDjOyRDZHMGN0+u/Y2ts= Date: Thu, 11 Apr 2024 16:03:00 +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] tty: hvc: wakeup hvc console immediately when needed Message-ID: <2024041151-crewmate-entail-62a5@gregkh> References: <20240411215017604oDcKsSipiLnfwd2SzAnsj@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: <20240411215017604oDcKsSipiLnfwd2SzAnsj@zte.com.cn> On Thu, Apr 11, 2024 at 09:50: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. > > Signed-off-by: Li Hao Did checkpatch say this was ok?