Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1765471rbb; Mon, 26 Feb 2024 23:38:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW937hRQNcWXFMJ937J/0GVamGyeAQRIcdu+vtX6unRj/AQrJFEGxL93otTWBHP1Ayb2fzanT21o1JiI6Wxe9rc3FMfPfwWDribeKe+cw== X-Google-Smtp-Source: AGHT+IHqX31nODGPmmSEao6azq2rMMtD9eX2FtCdfWcnhRIFGfOExnYk83I1b1tDxgGnh6xSb/HK X-Received: by 2002:a05:6512:3194:b0:512:fd84:6d0f with SMTP id i20-20020a056512319400b00512fd846d0fmr4019892lfe.50.1709019517495; Mon, 26 Feb 2024 23:38:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709019517; cv=pass; d=google.com; s=arc-20160816; b=N8BSHgGXivuVuyu+6fyZ+XFqQ9J4MkbeutPQTFSkD6vFBhW8OciosmAn6Roox0ncsA DB6gZ0JoXP8ZgZ2XjBiqKH18QAI8nP/hpcapMIRnh53+Iyt58i6V3RPkQFUqVolBtueP Xpt5MOzauZ4yacXb+0jgCxt48z4aL2iFeIN8gp2+UdSNZ/4PztOn9yHnte8kdctw0nQS 01+Y1Mlab7EbjJlFZlo5eNhbfUZPf7bNa86dGq2j9vIXErGkNCdtC65cyJ7pepHmfpp5 nIcmom2aIIM9zg06OZlcLxouy/2gKpXPwy4B2OzTNuZwB/Sx7eDi5wGEpYziiEJQckNl 6XIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=nU88DR30Nj5YQI+Bz1I/p5HrTkiLJwjFVYR+uGcIayg=; fh=wPeaUabggSyLeuteK8wYccLQfBtfg2+eyxpp7ZukmGY=; b=xGzp4+b1lalx5vmlBC+dx6ixqkLhnPujiMRsQ6jw1ofPa2MouGwC0xKYO5HInmlCly sgL+vwt2NJaweygD9YXaVDCtwug98oxX5GHrqZEFRLsxE7UZFnWu9jBcZjdLdQEYyOu4 p1ALdzxzGfDlXf+T9t0tkMpcurhAOmuCHNNItarrxLe/DBvWo7WHxUx8+XfbAfcCzykw QRbTrlRMGdv/cb6Nmoz6Xe1oGc122DQecctX4tx9oI+9quj6Cye5u4ZWsnsah4SkxSyo NBdklhuWI5xhVw/cL4A/1zb8rGRindD23+DyZXhO2PA4/hAtLeYRKSq6+9iMlC+qtxLL 7pIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ldapwmYw; 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-82810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82810-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m19-20020a509313000000b0056568fe52eesi486869eda.565.2024.02.26.23.38.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:38:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ldapwmYw; 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-82810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82810-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 40CD61F22443 for ; Tue, 27 Feb 2024 07:38:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EF0C54F83; Tue, 27 Feb 2024 07:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ldapwmYw" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 D48D61E89A; Tue, 27 Feb 2024 07:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709019509; cv=none; b=k7Na8KIttF0dU8i6fe8ENl6K7x+8lQamL4YfMszh7fYMoVpvWmxy/7FtdVP9TvPda4QBUtZAf+E+Ta8m+PZ1b2AHxvyWFll6iIWcjCg/8iNyP2wklWcOaeS3OTUCwJbZGn/y2ju4IUUH5nidrJafZF3N4ENXcZ9LL9khONzSzNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709019509; c=relaxed/simple; bh=8P7wEXB4wTBPTemmiBXHngBFEUVYIia1gN+EfoUB+0U=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=G8nIrzoMEmg/AVSPXD6ENsMnlqiUwfIyqIlQpQqU5SySb4iZBEtAV1RFqzYS+xBMEG7gLQ3iNgA7sLA0Lu/ufrpbc8NlaE5VLNGj4ZKHJ/md3KLNytzzzC4KbhDuo69hzBUkB8sVgVcJE8tJ836FfdWfxEai1B9I/qP3XVjdxBo= 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=ldapwmYw; arc=none smtp.client-ip=205.220.168.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 (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41R7Mca8027755; Tue, 27 Feb 2024 07:38:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=nU88DR30Nj5YQI+Bz1I/p5HrTkiLJwjFVYR+uGcIayg=; b=ld apwmYw6vIj/SUgJJAvqkoqhIe3atBGsY1mbECLE7WkoLf19ON2oEJPofQj6qjJ/r O9+RMQc2wUzb7fgRaG/3K5JNRuQ1DQmhp9V4mxs9CQg8o/gcAH6oBdgZEDacAJzs 414yLN8tvfP4rzzMdx1bRHcjddy9C/+UWDYuoA+qoISniq0cINFEj+lRVlzoxFI2 gD04UZtuwtT7qvfqaylIqHbYOd32EHO2wccB/Y5GdQ+EgGFqijaJV+4iomhTPYei PkjdkTiJFs9ZIdanoLJKixSWll39tO3ReacTonQ/U6nYLKy6/9Sp94JmK85Xarg7 VYZX0r5o418BxTPkVoyw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh232s4xt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 07:38:16 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41R7cFK9019448 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 07:38:15 GMT Received: from [10.216.14.152] (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; Mon, 26 Feb 2024 23:38:10 -0800 Message-ID: <3b4d553c-401e-da56-4554-47c4cf040e8c@quicinc.com> Date: Tue, 27 Feb 2024 13:08:05 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH] PCI: dwc: Enable runtime pm of the host bridge Content-Language: en-US To: Manivannan Sadhasivam CC: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Rob Herring , Bjorn Helgaas , , , , , , , References: <20240219-runtime_pm_enable-v1-1-d39660310504@quicinc.com> <20240226155305.GJ8422@thinkpad> From: Krishna Chaitanya Chundru In-Reply-To: <20240226155305.GJ8422@thinkpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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-ORIG-GUID: oGDMTX3oJ701THTMqleJNtchrlA0al0W X-Proofpoint-GUID: oGDMTX3oJ701THTMqleJNtchrlA0al0W 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-02-26_11,2024-02-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 mlxlogscore=970 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270060 On 2/26/2024 9:23 PM, Manivannan Sadhasivam wrote: > On Mon, Feb 19, 2024 at 06:51:10PM +0530, Krishna chaitanya chundru wrote: >> Currently controller driver goes to runtime suspend irrespective >> of the child(pci-pci bridge & endpoint driver) runtime state. >> This is because the runtime pm is not being enabled for the host >> bridge dev which maintains parent child relationship. >> > > You should describe the parent-child topology first. Maybe a simple flow like > below will help: > > PCIe Controller > | > PCIe Host bridge > | > PCI-PCI bridge > | > PCIe endpoint > > Also explain the fact that 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. > > - Mani > ACK. - Krishna Chaitanya. >> 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 >> --- >> 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 >> >