Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3029911rdb; Tue, 6 Feb 2024 05:22:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKs9ZkNVa14LkFcg3irVPXURv6f7EQm/p+vQJvNtSD32xxBhV+ksf483m9i83tbfXpf50Q X-Received: by 2002:a0c:dd8b:0:b0:68c:88fd:d926 with SMTP id v11-20020a0cdd8b000000b0068c88fdd926mr1773452qvk.56.1707225756477; Tue, 06 Feb 2024 05:22:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707225756; cv=pass; d=google.com; s=arc-20160816; b=mE2X3oYnBmFAQVOtc+VniKO4Gy0ogshC0RC56paAxuxQ4uWBtLsIXgFdEZdQHCRxGC /Mu4qxKeZhR8xdun96w3CDftDnNhEa6oMj8pfR5HChvvZmNMOtMZr8aU6mRuxmrJHUMa PIRsem7b5ObkBCspmF/PA3McaAFk0GI3pDMvfYhoHogQfcG6UziyMNOYQquIyu0nTqwv TsXUcs/jrLoYEb1wU0n4xkMb9vXjseB3oUeAvmtVfHyjnCK8wHYZpjdQm7vGgTKyPOAL +RT1zK0aOqsjQjuqgbvgsMDdXTYsz6RNB0TvsNBBHiVnqencTmRlavVY3VpVKFfUBlUC dDrw== 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=MjwD+9pJe0JPapngs21ZXK/TWqkW9UAlrBD88LWjvXU=; fh=Tj0pyxzKYkxy2h2W2/AoOM4ketIQ0rNkE4eeYo/XNBA=; b=Zf9zjY6HoEEdJ+6ZRDFEH1F6zq0JjjaLE24yHJxvWYpchxn+TCyygkuh4IHAe4wds3 yGRXC1Gc/+y+5EDUbjFoPCfV/8cNtGrlvKGYua+p2Pm6fisCnseki/e7WAsI0WgfYcHn XferHz9xdlJOR7rFu/jWUmxjef5FxRj7CpKGIx9s7dNWQVCIn311WG9C9nEevGiQ35QS Whz7EQOXpNFnqlaQUkcCYDThvfF8dX5q4WPOcWehGnBZdDQ9jNYPVZOIPfyGZTMMmgRo E0noAmEGjzdmWH3hpXT4eqxauzQ3Zq2cbbV39u2okFewMoh/X7SIAyPtvWBYkfDGOiit ZCTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=kyRXYNsP; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-55011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55011-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXfr32KzDdtSc3ROA3wsvIBMWV2/sAVrwGonOaXCTgI8SPA9upeM3zKC/i5NGeY256/XZjmdwD28HBZkfXj/ZaJ7V2XHtqr52nqxPHWEw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id el6-20020ad459c6000000b0068caef783a3si2135072qvb.491.2024.02.06.05.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 05:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=kyRXYNsP; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-55011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55011-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 297D41C210F0 for ; Tue, 6 Feb 2024 13:22:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 994DE130E24; Tue, 6 Feb 2024 13:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="kyRXYNsP" Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) (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 39BBD12FF97; Tue, 6 Feb 2024 13:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.50.62.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707225747; cv=none; b=Ss4VPSqsCLgY/S9tps+d92j9888qy+1uHXBDGEn6V3v2fg2meezAQ/8Raclny61Dlg0FdoX4Im8ONrmy0nBQ9i/nXbg6Rtx+ptmerMaVqGgdkiGHhTjkUWYD9mDcS52s50KvyI+CJQ0J8gYJjPwMVePdyq2ZjxxA4smg4ecmrzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707225747; c=relaxed/simple; bh=iWQ751Umn75UfafL9LXPbsEQPtgj8ZyLiC5Gw52znGU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a2SOha+hjx3UZYuGY5jO2gHfQzLr2QFnzbjxOOtIwG665+UjZvqRJq3Bg3k8AswoOXB/Fq81lc1GNccoSEQi0bIeHoo+DxuPV9HaDRRN9as5hZgnLFO2YX58e4M7cjiXt+GHK/ZVHEL9Q6+nblGmEcw/A8bKF7pWc5saGI12E08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com; spf=fail smtp.mailfrom=atomide.com; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b=kyRXYNsP; arc=none smtp.client-ip=74.50.62.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=atomide.com Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 073DD6050D; Tue, 6 Feb 2024 13:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1707225744; bh=iWQ751Umn75UfafL9LXPbsEQPtgj8ZyLiC5Gw52znGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kyRXYNsPAQNClbcvX9psK+p4JTHYkaBWtnFBDwjQvcS/aQLak0g6khRvcqbypFOyF +fqEFG+nHaNy4+EwIaLtgyTKDoZXw07mCgxKnhC80OkyksrJC3CzVKUWToqa02eT5u hSqF+jdpLZRxMhNv+40y+j/zif/Mp/4Puhrbjl+sDrNiy+V5UNVMtjCVgYrvXTQXKR ZdUnjtAbC0hLL2qZ++IuFS/Qyfh3998L+cuAVIBUhPxqcQJQH1VlfPM9LxilZjIVhd UGH787yC0HKXmdxqVnA2kYN0CF3Le+QbqKcccaH3qHRIdq+H7Bwi66NMZ+wrRToXDj WKQUy8XOPE3/g== Date: Tue, 6 Feb 2024 15:21:55 +0200 From: Tony Lindgren To: Andy Shevchenko Cc: Yicong Yang , gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, john.ogness@linutronix.de, tglx@linutronix.de, yangyicong@hisilicon.com, linuxarm@huawei.com, prime.zeng@hisilicon.com, jonathan.cameron@huawei.com, fanghao11@huawei.com Subject: Re: [PATCH v2] serial: port: Don't suspend if the port is still busy Message-ID: <20240206132155.GH5185@atomide.com> References: <20240206073322.5560-1-yangyicong@huawei.com> 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: * Andy Shevchenko [240206 13:12]: > > static int serial_port_runtime_suspend(struct device *dev) > > { > > int ret; > > ... > > uart_port_lock_irqsave(port, &flags); > > ret = __serial_port_busy(port); > > if (ret) > > port->ops->start_tx(port); > > uart_port_unlock_irqrestore(port, flags); > > > if (ret) > > pm_runtime_mark_last_busy(dev); > > And obvious question here: why in case of 0 we can't mark this as busy as well? > I.o.w. why do we need to mark it only when error is set? No need to call in the 0 case. The last time driver was busy was when pm_runtime_mark_last_busy() was called, and in the 0 case we just runtime suspend based on the autosuspend timeout value. Regards, Tony