Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp147804rdh; Tue, 13 Feb 2024 12:06:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZjs9DqVsYKKwxFiIhf56N33J69yYDbrAvrCZ4RWj6GDBE8kPhAOlYb+rY5nfPyV7VHNK/kvgMisWGrT0yQU/nJ3OeO8MXyyS53cTNmQ== X-Google-Smtp-Source: AGHT+IEJZs41bjYEovggFYEd8kCx89XbRcb6w7plivPWShmXk/YjkuNlzURJmJQvI5HhCHBD9yp9 X-Received: by 2002:a05:6a00:1b52:b0:6e0:9ec6:71e9 with SMTP id o18-20020a056a001b5200b006e09ec671e9mr333607pfv.13.1707854817009; Tue, 13 Feb 2024 12:06:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707854816; cv=pass; d=google.com; s=arc-20160816; b=TqtCUoBsYhopIZwFq9u8jY+RFyVL1xKQapHd4tN65FbMWgwQyAap2DH0Ey4Ccl6RSB aGSAHanezecKQ+6RdZAJQseSjEObrT2rrwLo+QKH99Zo8bJ7D7dmca3icBRLOuFnbval xtl8qOylQ16D+gspVG0/ruj4tGLRbBRJkAdAKPiL1KkcbcGsTOqJUeZAeZGIIb1VJT2n FDY4YT0WIOVWvDJaJxjALnREg286ydpBGE0JyGKKCYy1CruucakllDFFJshXDFtxrina +pH1ovkofIfdtqlz4kvEtLrpbHRHxT3ux1Ml7/yjE2+NXpOmkgGSAZwQSQG2QsjA7QtR jvHg== 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:message-id:subject:cc:to:from :date:dkim-signature; bh=9eFHUS5KyxE5BngUK73D4RLR+zU2emCAo1PTOYefLeU=; fh=zNcvWBoAwe1hkcEhdxlZ/vAKLbdlkxSogDS0Iu8DWGU=; b=i1aDOfrcdWrHv41+Nvin+yZQg68cnI9YbkcR9vOY7NoTnSQGb4MyJ7L+YFoOAx0ELr qjGtP0Q7t7gY14kSimNm8MWjgfxoWiXEJtA+wFHkixtccZVoSCCmTLpMyGM93DMJGxru N2Hd47fNMpHXpSDNQXKMsTDmuDgY9DFfsfaVea8IRJwnwPcjyh2o05xBSoLvni6g5QPk yn8bXZX1OErdB3iOaqPT8tiXYlUM+kcLi8IJiPkhr0Rj1W+FzOXmcnw0IDvw87IyXoVf GxG+9Zrfg5bVCpIZ5FkK3K4noS2jnk9ZyNQG7tXi6qIwCuqQw88ZFr6KPO+RixogJlgv TngQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YzOuvNFC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVf+bWutiUOvFL9iStNmhf0bBM+CfWTS5ZLo2LffKgdMFO89IIHb4NuaISczj9p7wxeoKpYORHRxeQ6Qq6zesiRmMGa8besMuihsnTVhw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k4-20020a63ba04000000b0057d7cff25besi2458709pgf.829.2024.02.13.12.06.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 12:06:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64208-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=@kernel.org header.s=k20201202 header.b=YzOuvNFC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A87242823BD for ; Tue, 13 Feb 2024 20:06:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53FBB60B97; Tue, 13 Feb 2024 20:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YzOuvNFC" 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 6DC8C60B80; Tue, 13 Feb 2024 20:06:50 +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=1707854810; cv=none; b=G1BAwd+jAsqhjQWJ4CD6wZS9r4bhjvmEeJCO4DXOEbMcM1WLVZp1yJFvoRg/b+4WZorzhhdg7QEMP7v5yr+ljrSTKUEsaHYsstbCwmhEVnfRfhzxyNo0zppdpmKJGrS2L9tcfpqrdLOdQ7YXlkIik9rNVVvy6IQUeJZzorisqEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707854810; c=relaxed/simple; bh=RzFf6vbxBZCp7I/zmIIZfylRvNPWVW5m73wNUuf/KTg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=d3KMCNvwsSE0MxQFvdXPjdX8nnsUzGDIA40ztjCz+03ZuE8YKSXy8mAV91tS/nv0hoQI1ASAl46loo4A7l8qMvMfxtQKr7VRGpYg6Il74qYhYEILQVgMyxhDGANYjJEd78Gj43WyhWzBEBOp9HGC+cIxAexOuE/D38KnXqAfZ9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YzOuvNFC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A698DC433F1; Tue, 13 Feb 2024 20:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707854810; bh=RzFf6vbxBZCp7I/zmIIZfylRvNPWVW5m73wNUuf/KTg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YzOuvNFCgNTVxBos7zSGMPQvUzsw6Yv3J3Sg9RgEpq6nzmFjdZXt41tSNXKofGJJP l51fvJDjrLZmRveZZi53xDZ360E9ZPL5+kcrXOT0g7ca5VMrbqN2uRQ9zYN/fdypsh ApM62ix+PjJHq29YU0P15tzNLa4doqXtZxnILUuO7qAmIlnm2YpkAC6lOzcT3hDgcv psDsTv6zjf6Y4E1x3njmPo3t2D5WAN4/5XUM+jgQkLGqA28RlcJw8vWa1wHvudnvik w1st1rjo2oyZihNQ7g4ggUPY43U8ZU+gPwQlULn8qXTCSlXJjB7+p1PJ0FXJzR8QXH XiQ0Z6H8NRArA== Date: Tue, 13 Feb 2024 14:06:48 -0600 From: Bjorn Helgaas To: Raag Jadav Cc: bhelgaas@google.com, jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, stanislaw.gruszka@linux.intel.com, lukas@wunner.de, rafael@kernel.org, ilpo.jarvinen@linux.intel.com, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org Subject: Re: [PATCH v1] PCI / PM: Really allow runtime PM without callback functions Message-ID: <20240213200648.GA1219964@bhelgaas> 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: <20240212063233.5599-1-raag.jadav@intel.com> On Mon, Feb 12, 2024 at 12:02:33PM +0530, Raag Jadav wrote: > Commit c5eb1190074c ("PCI / PM: Allow runtime PM without callback > functions") tried to eliminate the need for runtime PM callbacks > by modifying pci_pm_runtime_suspend() and pci_pm_runtime_resume(), > but didn't modify pci_pm_runtime_idle() with relevant changes, which > still returns -ENOSYS if the driver supplies no runtime PM callbacks. > > Fix this by modifying pci_pm_runtime_idle() such that it allows PCI > device power state transitions without runtime PM callbacks. > > 0) | pm_runtime_work() { > 0) | rpm_idle() { > 0) | rpm_check_suspend_allowed() { > 0) 1.500 us | __dev_pm_qos_resume_latency(); /* = 0x7fffffff */ > 0) 4.840 us | } /* rpm_check_suspend_allowed = 0x0 */ > 0) 1.550 us | __rpm_get_callback(); /* = 0xffffffffb4bc84f0 */ > 0) 1.800 us | pci_pm_runtime_idle(); /* = -38 */ > 0) + 17.070 us | } /* rpm_idle = -38 */ > 0) + 22.450 us | } /* pm_runtime_work = -38 */ What is this timing information telling me? > Debugged-by: Mika Westerberg Sounds like this resolves a problem report? Is there a URL we can cite? If not, at least a mention of what the user-visible problem is? From the c5eb1190074c commit log, it sounds like maybe this allows devices to be autosuspended when they previously could not be? Possibly this should have "Fixes: c5eb1190074c ("PCI / PM: Allow runtime PM without callback functions")" since it sounds like it goes with it? > Signed-off-by: Raag Jadav > Tested-by: Jarkko Nikula > Reviewed-by: Andy Shevchenko > Reviewed-by: Stanislaw Gruszka > --- > > This is not marked for linux-stable for the need of extensive testing > and can be backported after a few releases if no issues are reported. If you think this should not get backported to stable, you'll have to watch the backports to prevent it. Lots of stuff gets auto-backported even though not explicitly marked for stable. This comment won't prevent it (and won't even appear in the commit log). > drivers/pci/pci-driver.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c > index 51ec9e7e784f..bb7f6775b350 100644 > --- a/drivers/pci/pci-driver.c > +++ b/drivers/pci/pci-driver.c > @@ -1382,10 +1382,7 @@ static int pci_pm_runtime_idle(struct device *dev) > if (!pci_dev->driver) > return 0; > > - if (!pm) > - return -ENOSYS; > - > - if (pm->runtime_idle) > + if (pm && pm->runtime_idle) > return pm->runtime_idle(dev); > > return 0; > -- > 2.35.3 >