Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp231093rdb; Thu, 22 Feb 2024 01:44:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+GufvAgDf5929TTeOIQ3yEGQJl8Lc1iIv7O/lqYkRRSCsWpPpGGNk+t/GEqXm2fA/lh93lJkn+4dUu7QZTESIFYYYqkYsBezRiYj/DA== X-Google-Smtp-Source: AGHT+IHpGbOEh9okW/8yDHj5f4SHEt2otw0hW3EVIva+9R0Ye6Q5q4s7++ViKsOH2Rl/9TSXbsZC X-Received: by 2002:a17:902:f68f:b0:1db:ca53:41d with SMTP id l15-20020a170902f68f00b001dbca53041dmr20166581plg.31.1708595097197; Thu, 22 Feb 2024 01:44:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708595097; cv=pass; d=google.com; s=arc-20160816; b=GsA0uk9KM4xhHxheC16vsKUUCLvU928WBIM4rgO1bw1lYeyJbmgu5s7bSdjliW5xR3 q8kSEFvMghFCaMgH+iqt2jR2Zz9dL5Z/gUJdZZD18lpCv0tbOqodCuIzCN6M4YZp24tJ LXHvEYdAVWAFw4zGWPttVO13srZUMhvh6JPm43S/i/IMSWDkXgJ6rjBtuQNMO7Tqj6/9 8HA/ZypmZ55O1HjRaoctm1c1RxnFDGsaKcoIpk633Dz3tXFoXBlUnWZo54DxKnFJ+wrN hPRiqIXbFEWaQugTjvH8uUNzjFSRO6QHI6v38+GES1fFhp4mBV2U+Eiyv4QesZXfudLo 1dJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:to:subject:cc; bh=tux/eye9D9JLBcmtUY4FhS+8SgO2it99nNEgVTARIcM=; fh=L/Mmz4SsLc7J3cUsxD92a5kHQysSwecC+uilMs+4IzE=; b=vAACglAP6l5ptg5YXmD2pCDZ5/raWdZ3SQEKIkxkimMmo7pinQrimA76ksYDKyuZFg V7+/vhjhNd8dzt2CI+wfYJU0TwrdguTgA6SRw98Fb5Z95DrKBGeEW8OPYnAgVmHGopwm zkf4ogzKdP5mwnXtk2uzXmGEdLoRJzlxqq5Qf8VWMGCiHSN6BD/icqJWSpL3Ap1KYI9c Ai5x4ZtqnnIA4qDdv/xuqpESOPVss4YUaCwkCcCKl2/2/ydTvEm+Lf1vGWRtiD6xmcqo 6iFg6NnD8oRYmQBDAXaEaobgGbSBZouKlKAAxeSiEDJLaVneFc72nbo9vx1DFr3PVqh4 j9oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-76254-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i8-20020a17090332c800b001d015cec684si10121828plr.238.2024.02.22.01.44.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76254-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; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-76254-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 36BA0285409 for ; Thu, 22 Feb 2024 09:44:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 050E541740; Thu, 22 Feb 2024 09:42:11 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 86EDF37152; Thu, 22 Feb 2024 09:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594930; cv=none; b=ivmb15ob6BD6qEs1C6XuoMisCSEH1U4dWfQ0Ev4ulwqeF00u8PGoBIjNFjU3V6p/VHEWgPJ1ofNpNsUGyb9X0YXm4z55C7fsjjy034hx22SVCXI5OKiznsIQJ7ndzoL1GwDRD3p1ZZ1ZD6cayQazn7S28SVJl1RcYmvSSl+tz+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594930; c=relaxed/simple; bh=nB7akApCyMJjlIrdgWz8NAIOpjWP2HJ57h/ete1dFZU=; h=CC:Subject:To:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=KF88ZjMZl8v0L7HKCKxwh/fCSSRkq7HJbDGUxYdeib3ekUUDBU/SjdNhNQJhAi4cLzRMMbxTq7PykMpAZT+ukU9JVTQhSZ3RNX6CSdX/I9jf8+kWgjEC/zlvhusdyZVY7CgFMWlPh49IxrRcvzUj1Ab0Gw6FhcAk1f1nGpk1mh4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4TgSmf4LZVz1Q8C7; Thu, 22 Feb 2024 17:40:18 +0800 (CST) Received: from canpemm500009.china.huawei.com (unknown [7.192.105.203]) by mail.maildlp.com (Postfix) with ESMTPS id 44C791404F2; Thu, 22 Feb 2024 17:41:59 +0800 (CST) Received: from [10.67.121.177] (10.67.121.177) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb 2024 17:41:58 +0800 CC: , , , , , , , , , , Subject: Re: [PATCH v3] serial: port: Don't suspend if the port is still busy To: Andy Shevchenko , Jiri Slaby References: <20240208075216.48915-1-yangyicong@huawei.com> From: Yicong Yang Message-ID: Date: Thu, 22 Feb 2024 17:41:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) On 2024/2/9 1:25, Andy Shevchenko wrote: > On Thu, Feb 08, 2024 at 09:27:57AM +0100, Jiri Slaby wrote: >> On 08. 02. 24, 8:52, Yicong Yang wrote: > > ... > >>> static int __serial_port_busy(struct uart_port *port) >>> { >>> - return !uart_tx_stopped(port) && >>> - uart_circ_chars_pending(&port->state->xmit); >>> + if (uart_tx_stopped(port)) >>> + return 0; >>> + >>> + if (uart_circ_chars_pending(&port->state->xmit)) >>> + return -EBUSY; >> >> Why do you do this change at all? If anything, __serial_port_busy() should >> be made to return a bool and not to return an error. Look how it is named -- >> returning EBUSY is sort of unexpected in my eyes. And if this needed to be >> done, it should have been in a separate patch anyway. > > I proposed that with a renaming, so it won't look as boolean. > And I also implied (sorry if it was unclear) that this has to be > done separately, so we are on the same page about this. > Seems I misunderstand the comment from Andy. Will drop this change which should be a separate one besides the fix. Will respin a v4 which only narrow the lock region based on v2 (per Andy). Thanks.