Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp286441lqs; Tue, 5 Mar 2024 01:49:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUhZAr8NT0sIDgzALR9oXw0EMbX34gzeLf9/0v9ksRF/M6maEgJrvQGE8M7K+6IU3Uh87+wkimh4q1M0m61acYRbV1VeND5F0B0X42lew== X-Google-Smtp-Source: AGHT+IGGFaA/N0XbzYu8QxODyqaJNbn2MIe02hcD2FGXp+lJb9sCO+Uotq3B1E6aAG+UbMluwav9 X-Received: by 2002:a50:c943:0:b0:566:14e3:2262 with SMTP id p3-20020a50c943000000b0056614e32262mr7357899edh.36.1709632176906; Tue, 05 Mar 2024 01:49:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709632176; cv=pass; d=google.com; s=arc-20160816; b=BobPnnp75eNAWdGVGMBRELcrrdSMqR5E4mB7yFw6r72NB+F/6/pkWoyG5Nj8/64vl+ Hh4dp/NdFp9MkEB8DmlZK3qHxxZNVL8S1h2kL7aBzLgrMCnSh+eXzFcJY5yLxwXGPic2 zXiW+41l15HJFHEmGzOfXSWeu9VwDmM3lLePNtmznRxI2q5A+BBqqr1h6/Vohwm4xMSl G9zWGWIhIg1NSW9T2hm9xtHIXuGNtvSDewHQwFvqEq1pjQfX5EdXrU+HmRmrrnNkZAHE XmGKr76bQTS6iaWDGI6KzgvVyvNMHlFd49q5emC8o8ZqhjcbJmQyjkrecKi8VE21Kih2 LC/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=37xRd+lDnWXrIknF2wufL57eoqOYbhNwCDos2tpE4Ww=; fh=Y45W6gNqcLJQ20Kkv5RbmoHaySKcJQw1vc3n52ecCq0=; b=uuy9Ruj9qW0lmadXxj9wBE1gOFeHX2makgOfLE0U02NWbA3PFCfecj80TZ9WX5bPNe ubk9bcA2RxP6S5rky+1zHYn3m3hszXk8KjzfjrvmG2T1x/UzTPI2mZphRKQazRGzLGYk BURjiqf5WuxM6MQPlWugOzc2HLoXi8bfNpqkGLgyzt5Q3CQ+VK+H67ZRo5GYABkRfpO2 bAHEwVTmKBBjMyTuazMxRQeqpeAVVKfkAFgEI4ZI3dPT36DQZJxtM97bItCLZrRDcmOk 7tJU6MJbBGUW547O6w6wpvFruxMIoMfArneQw/gwubFenpRimYNuRz6WQmZOax0uLC81 ipbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Hab/4V8O"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-92025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h22-20020a056402281600b005676b7a8762si1184883ede.446.2024.03.05.01.49.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 01:49:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Hab/4V8O"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-92025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 77CFC1F217D8 for ; Tue, 5 Mar 2024 09:49:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C85CC5339E; Tue, 5 Mar 2024 09:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Hab/4V8O" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 3CFC4535AB; Tue, 5 Mar 2024 09:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709632165; cv=none; b=vDPM8pmJAXzsCfTmuxXpkvHXhjRak1z64OVgJW86lGl37LfSqpiHI+HlVcIfqlUKnnxW9MpjWxT9SZUtE9e6JXFdJZHsxpFbwWq+GYbT5BNpwE6PBGRDrtKyVLAuQ5+X/AAbu7iCFnhd+W6CmHSHc6UBpaHy4UmKCnTBeoWB1ik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709632165; c=relaxed/simple; bh=5E821RFhqqoYavc661H3Vby84CJMt3ugUPHZ0daBHkQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:To:CC; b=J34ayuFnTShzCoNz2IzGUiRMq+Fub0F8RR7X+iyEZK5LutwANf0ntxkDFIIKUEMjjHAZk0l4xr0T4ZScr8PgMrULALhEc9/Rau0CxgxVer1s/aqmQ/SvFj/0AP0+itr2z+yTcxQdhaU0EBtj8ekpIEu5+5YXtio9QAWw/bGf91o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Hab/4V8O; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42553t6u029981; Tue, 5 Mar 2024 09:49:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:to:cc; s=qcppdkim1; bh=37x Rd+lDnWXrIknF2wufL57eoqOYbhNwCDos2tpE4Ww=; b=Hab/4V8Ogipy1SXWbej rMZBfN3pqRBAz3DiXVp4xm0NN+92fBoUapenjI+UKuiizakPcH+g57a0NRyhzF5w 6TJd5OffvbQgMx/c4CwQWes4JkfXmUcXWy3lJQXup7C4/PRS0aUtKQ7Rjpr2Dmbx zpjlwrPrCHuyqARt5HlP/q4vYUeEPQL5HsCVHWCp1xq6PSh7TuD7vKcttIbSLCIK CmNvCjUjReQJGhztLMlubHgP7Apl5a+sDS043N2TJ1TLfJ52xUAF1F7Rd8KXGlDF BNVavQBL4krIDByDToWLAlrC/3DFmVwg7d+H/AGxHZdaW2tW7DoAG0ms+1lk9f3v Eyw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wnucrrnxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Mar 2024 09:49:14 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4259nDpM027674 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Mar 2024 09:49:13 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 5 Mar 2024 01:49:09 -0800 From: Krishna chaitanya chundru Date: Tue, 5 Mar 2024 15:19:01 +0530 Subject: [PATCH v2] PCI: dwc: Enable runtime pm of the host bridge 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="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240305-runtime_pm_enable-v2-1-a849b74091d1@quicinc.com> X-B4-Tracking: v=1; b=H4sIAI7q5mUC/32NWw6CMBBFt0Lm25pOeRj8Yh+GEGhHmUQKttBoS PduZQF+npPcc3fw5Jg8XLMdHAX2PNsE6pSBHnv7IMEmMSipCqmwFm6zK0/ULVNHth+eJAaj8VJ jMZhSQtotju78Ppq3NvHIfp3d57gI+LP/agEFCpPXVSVzlKUsmtfGmq0+63mCNsb4BdVSMm60A AAA To: Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas CC: , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709632149; l=2100; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=5E821RFhqqoYavc661H3Vby84CJMt3ugUPHZ0daBHkQ=; b=G3dl0g0NBTsD6FjHqaBqA2TnM9x871FV2qppYqJMGXtQaJdm33pKXg7Ni/R7iYxTsnA96q7N+ 6SffEACZtmWBb2JTyyKrdpHHrJwKU5dwkObI0hkvKQHyB6LNZzDUhlr X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: bBbxfCd8AWUJgsQOvlJrv9AZuqxY1ORy X-Proofpoint-ORIG-GUID: bBbxfCd8AWUJgsQOvlJrv9AZuqxY1ORy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-05_07,2024-03-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 bulkscore=0 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403050078 The Controller driver is the parent device of the PCIe host bridge, PCI-PCI bridge and PCIe endpoint as shown below. PCIe controller(Top level parent & parent of host bridge) | v PCIe Host bridge(Parent of PCI-PCI bridge) | v PCI-PCI bridge(Parent of endpoint driver) | v PCIe endpoint driver Since runtime PM is disabled for host bridge, the state of the child devices under the host bridge is not taken into account by PM framework for the top level parent, PCIe controller. So PM framework, allows the controller driver to enter runtime PM irrespective of the state of the devices under the host bridge. And this causes the topology breakage and also possible PM issues. So enable pm runtime for the host bridge, so that controller driver goes to suspend only when all child devices goes to runtime suspend. Signed-off-by: Krishna chaitanya chundru --- Changes in v2: - Updated commit message as suggested by mani. - Link to v1: https://lore.kernel.org/r/20240219-runtime_pm_enable-v1-1-d39660310504@quicinc.com --- drivers/pci/controller/dwc/pcie-designware-host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index d5fc31f8345f..57756a73df30 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "../../pci.h" #include "pcie-designware.h" @@ -505,6 +506,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) if (pp->ops->post_init) pp->ops->post_init(pp); + pm_runtime_set_active(&bridge->dev); + pm_runtime_enable(&bridge->dev); + return 0; err_stop_link: --- base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d change-id: 20240219-runtime_pm_enable-bdc17914bd50 Best regards, -- Krishna chaitanya chundru