Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1741477rbb; Mon, 26 Feb 2024 22:27:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV+cvnk/FB0JDYDU1DC/EaDpGN2g2RzXrPgjJCEhBao5ojuaOFUkLz3gO0lEDbzmfKwsLVpG4cgBW9sMOWYrKkcWNazG2Rwl8BDAV/n4A== X-Google-Smtp-Source: AGHT+IHcP+EtcWRA4FYpYn76HygF8r4I53XjdQqdbEmLNiFG9Y76+uewHhpngNUMdC1lOc8V3wq2 X-Received: by 2002:a05:6358:6416:b0:178:a555:c312 with SMTP id f22-20020a056358641600b00178a555c312mr10888271rwh.32.1709015230304; Mon, 26 Feb 2024 22:27:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709015230; cv=pass; d=google.com; s=arc-20160816; b=tHs8SsMr7Ux31dfL8GkoPlZh3dptpb9FXwTEywBlexddbV1kEmFoUcSIaacrYVdLih fbnfF81ocm3n9Z230vGjdIVZDC511cZUMQvKmPQ3awsIfNjbyRTMH2qkZLM+8iNL5pM7 RS2gpIWNR4eyu0TraP5OXMNF0PxgzESpNW/W1djLnkWucZLmyCl5ZrzM3zg1pw0IVcx6 byWWX3K8dqTLlza8X5OzUiqnu4fEUoNlmkVAVKu0zxhpSTTsN3pyRPIZusSR0MHYI7AQ AysAm8dhdVdZIq7JpESoxN3+CstBVkJOUKuR40+kqeX2wMwTfMkzNrF7tjw+a9p32rf5 uWxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ePgoye2IrxAXdjsOMEZMvWqfczNLl/wjxRwVKXixIFs=; fh=x3WS+Q6X/QludSOZrJXyBe4LoWQAOYHjrtb9uL+RP3E=; b=f03B68dYBRZI0RQ99PfPcTy213h0KxGi3dT5CDnvAmafiUhCtcKDy7lvC/F1txPSMM k/x1LPf3Xbg69zBYHhqQX8RWanNMAAE2Fm1d+FJAyhO7bnCyyiVJF1371HhrCFtp37Qg LzvlDE1Y2euyclURG3dc4qQs5Upkyc0YQ++oqI7D72MAhuAWevKLfCdATSFPKZHlFcot wB1KpUvYoLGm0Q3BCwdLXE4AylinxDcZeLcb0+GvJfvSAlNAjF1SkJFJhi1WMo8EBvYB Dy30JqczPJVxLZH/RjKMe1MwinQHWqkc0/RsQn38/rV7VtuiReY0fDihNExUiFOEOaHL wtLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A31c+58X; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i5-20020a63e905000000b005cdfaea88adsi4817261pgh.774.2024.02.26.22.27.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 22:27:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82744-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=@intel.com header.s=Intel header.b=A31c+58X; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 F30762867EF for ; Tue, 27 Feb 2024 06:27:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CB045338A; Tue, 27 Feb 2024 06:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="A31c+58X" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 EFC9C5336E; Tue, 27 Feb 2024 06:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709015219; cv=none; b=h6NWbzQWkHCfJPr+qUbi838oejYdg1PRXG7/FN2BMX2xpoMXri89mDdVrYmEv6Nkgu5cPSNPORx8qewq2ltz6Gl4mjdbTfOyR/JcmoUV3FJiZq97sbEX+cxg9I1Zn7wOiQT0QOvYDaRLPrtCG6iQ1SXeR3JPpwuGstb9RaWnZME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709015219; c=relaxed/simple; bh=l5lw8RkSxjpG2Io4jclpM5Y8NRE451hzHP+TAbY4jv8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ktBLrGR+ZMCK1FZbpDxncmYXiAGvbnLjIII1VAlu7GzavhLA5YQt/LDNb7skl7INaw9JRI0itQGsfn26Qm6EQDDlTe9LASaZglXo2QOYTCxhwvXi5rk+/pvDdxg7tPzARtBxM5mZ2T/a28/djFuhmQpy2JhuCv8kLf2Ot5TtYpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=A31c+58X; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709015218; x=1740551218; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=l5lw8RkSxjpG2Io4jclpM5Y8NRE451hzHP+TAbY4jv8=; b=A31c+58X0uXKC9ygw6qcIVLetRr3AleUW9pFhimj0DzVzGP4nuDMlBJ7 ThIGzJDJTDfO7+oH1Uxh/hqzJwYKNLkXP8H9uYUQvDoYp3LpzxwYmx2La PETsnJ9jt/LOu/8o++Tp3pfnV+nxXZ/4u0LQxiQ4eQ6vxxAdpgmUQgDJv w6lyQiKy23SST8egem2wbYwpHZGZK7Izwt6xv1x3Ewz8uOumJMn29CI6n 0fYe9gDQSZInYcJLS6VaruP+/Rjd5P3nqz9HTwKiOjJj3o5hM7egsKSVL 9SOYkznoYDuIEAdHUS0KLLSmeSFK1MlXMKYTRlM5VyAkmBvfE4GPso/XT A==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="20785774" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="20785774" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 22:26:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="37959670" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by fmviesa001.fm.intel.com with ESMTP; 26 Feb 2024 22:26:54 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 446AA1FCEF; Tue, 27 Feb 2024 11:56:53 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 3F0871600101; Tue, 27 Feb 2024 11:56:53 +0530 (IST) From: Raag Jadav To: 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 Cc: linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, Raag Jadav Subject: [PATCH v2] PCI / PM: Really allow runtime PM without callback functions Date: Tue, 27 Feb 2024 11:56:48 +0530 Message-Id: <20240227062648.16579-1-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Modify pci_pm_runtime_idle() such that it allows PCI device power state transitions without runtime PM callbacks and complete the original intention of commit c5eb1190074c ("PCI / PM: Allow runtime PM without callback functions"). Signed-off-by: Raag Jadav Acked-by: Rafael J. Wysocki 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. Changes since v1: - Update commit message and tags 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