From patchwork Fri Feb 2 06:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 195662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp258224dyc; Thu, 1 Feb 2024 23:15:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdrCkOx5ZbB/35zARD8aZhbeBaOkDgBWTkaDfrBxfXS+m7XDzbM9ABEto8w/Q3wozOgVHQ X-Received: by 2002:a05:6870:d1c6:b0:218:f6e1:95c0 with SMTP id b6-20020a056870d1c600b00218f6e195c0mr3330635oac.18.1706858114439; Thu, 01 Feb 2024 23:15:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706858114; cv=pass; d=google.com; s=arc-20160816; b=qhWoPC/t+HMHMIwedibeU6pq8eId4fmixruAVzZ0oIqXG/mKjXhWNKJqhIkZXquZJG zv9Q3QgM9rPRCktXlHklxb7df/6cRK61mbyVeElGMaPwgRbRlimuPMpgEfv02TKDtTxS 1vQFz2g8YZoHQ42TyOmvG7R0CfZK9N33aw6zzbYD+Bjsj+maQtB1U6K7jSgDbEKZkl08 7WGAjZqF/fUaIzkK2jcIOvAtbA+8zZqwNGcpiv3GMpyvAI8tyD58QJekFu7qzr5K8xeB P+afe+1BsOkZtWtrv/43A+KuR63gMyoUDTs0JQatyDV7eAYJ41m5c/G4yFT6HcBbT+qY AIwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=Uk/bek74G0jiMAyH66uTq7eDwpxGOlToIYq9hApo/U8=; fh=T16sbaI8zjfwbM7b402r6pPhBQOqeTrLBg0arwqkNfE=; b=uD/JVMsT3PoEnLWGSFvD5uEEweRSnbB48BXOhWFBcPNPVsN1qPUa3KWPW7N50GCmc9 d7G1o6ogOzR1q8dXtk3iIpZyPbrY9/HfvzLNfJ3kim4+qhMfY78M1Yqa3LmLyv6y4iyi iluo+m92+wMhSj20hKTA3Ks/6j0waZzZcNZqch64EQaYSA9/a6ImMD9cRwoO5+zv8sXF W6LOVoMtby6dmkz8ZVZ+3xlm+ZIjR4DN6DIunNcnQIyq3Vp8HboDmZVHpzMNvSHWva3Q h+TLG2ZE9BN+/Q6dznlYT9t9UyPJbl1fVNp1BR7H8aMkO7ezZ8lznY8RD8dPl7EIzjH+ B+AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tEl+VUch; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-49312-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49312-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCVvaowrUUlVJd0nE492oOIZjDWB+i4cGetRH4C9hvlU22yaHuj2yCIEAnMIUDfFwWIiNfa20Ab677wrZ4ivVM59I93u3Q== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o38-20020a634e66000000b005d8bb714e79si1165895pgl.586.2024.02.01.23.15.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 23:15:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49312-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tEl+VUch; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-49312-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49312-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 C35F928E4CF for ; Fri, 2 Feb 2024 06:55:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 209A117BCD; Fri, 2 Feb 2024 06:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tEl+VUch" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92A0C179A8 for ; Fri, 2 Feb 2024 06:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856873; cv=none; b=Zt8hbK1kkPCw8AnhSHhhIUZZHBrWBZBPN/n78nNiBzXQAoPzTPt8iK7rV9UimgI0QCAKuxGeXbK/mnYIPecNulHcvM+wDrw9lNn/PLwfWQWT6GFhZ1FMM4e20KoBLgpmVdUAsvwNA4xKrpJ5hmh3CZxbSdh9zugFcKxi2v8FN1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856873; c=relaxed/simple; bh=xYjw+OluseaVhWQ3IUAx0cVvhKzCoYdlybhgeyqTDc0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gd+6I+yHkjHp5vJuW/ryPc4ky83uNqDV3A/4OIv3is/w5IOyMmJPMo3n+hSeVNphZ9mYYUyLalvJAp5tmpCxb1z6Y81eBUusbyCcDLu8/sfU3P2iH52O3Ht6zvNTk2KmBAPAm/UHPUntFwhGs9W8+G95HxNnOPbLrWCxlT4hj10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tEl+VUch; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6ddc5faeb7fso1466019b3a.3 for ; Thu, 01 Feb 2024 22:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706856871; x=1707461671; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Uk/bek74G0jiMAyH66uTq7eDwpxGOlToIYq9hApo/U8=; b=tEl+VUchxT0VEbEc0As9hc80hzkjCRY8yi3xxsZGmMwbdMmW3cmIoHO33XPH+8a6Nl qrM1g2tKd9Ag4ef+wAdAxVhmCVmF2XU0vnuGpTNoJe3jNfftnAh/dzsJy7R5NuqcNEUz /FXWCI2rdYwan5yJdH8HE9YdTtrEaUj4BhXmr2bKsikkYGdI49fQZ8HgYKOd8zp9upCU lyVv5pXKmOMiPotrBquC6pxme0Ccm+HrKI4IrzNQDP3Yoofoigmpf9q40C5AckpsYkXY B3sPMSKFXh2S8aFGvnYSs+5wN/K9v93JqTrv6Un0ZR4bwAlDD93QPKSOVCPgQZ5jgb/0 LYKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706856871; x=1707461671; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uk/bek74G0jiMAyH66uTq7eDwpxGOlToIYq9hApo/U8=; b=BsjRz3nvgwMNkZVdn8rCinlJiA3In4fL20IkzR7LygSk0NxojL9idlq0Ya7zUgkMpM X6PwjS69rIHRL1aTYI+87VZhjWDs1kTAxpjbrWf6YTbs1z9Kh2a3TSqF4gHKa5Tlizgg 4yKgsiPeDsO9x91cQ1VqNZfZzw2/2H6v1abKq8ZmNSDMyaKN6y/pHb42+htV3kzvTt5u RA176g3eVoa4jzU1J1drGSpyy+o/NMtXT2OVdd0lm9m09XorLRtXUT95EYRY20b0WlxU wV9ZrYGY5FLdjq8zrpJSqvL1+IyqP5ldm6M4mFaM5Igjcx5Wj64pHgM0R8AOEow+nV26 Nmdg== X-Gm-Message-State: AOJu0YxBGP7Uc41ZQJhli3TaYZkUiq4NpzuRmI1TUM+vihzadfDK5MJ9 2UDzF9u+RdLV6pqJGKjcEl2a/NljfPtEoXuDxH7HcOA+8YENXZw1QOfRr740sg== X-Received: by 2002:a05:6a20:2a26:b0:19c:8ed9:7b94 with SMTP id e38-20020a056a202a2600b0019c8ed97b94mr6656445pzh.51.1706856870780; Thu, 01 Feb 2024 22:54:30 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWFOQGso3wcZmDDWcgRX3YBc5uxcoc+fXMD50OvsoLNgUWo9Y/GK5Xy4R/J3g1ootKdcYSkcJuiFLDkLZpkESJU1X+jyLXdc2vDFOTYClnqWoqT88vH2ERqI9VHVb+TR3WpdpdijWvyeNAjHoCcpG8Q1b6DamMWK5/QEi+GpEBBYF6Xvj355Z+X3ewVvSs527ppotRJrYtL69AtGO1k2VGrLmvKGiFWk2FW2A8d/lrGAc6Napbk9PV65om0KvaUJz+Vi4hPqfdXI1fS1z0nbF8QsLMT6XOVmpmHxnb+vgni76szR1PEFK0u7rSisoutrW7AhKceVe1LddB3ZmaAxAyRmSnQb/gR2l8cYRiq/aVLFnrtSMNz9nAqFDxwcw28Z06rMd9esHA0fg0+CrU6QFQQn9sSHPSl8/vGJHOZU/pdUnv468b62Q8mJQ== Received: from [127.0.1.1] ([120.56.198.122]) by smtp.gmail.com with ESMTPSA id r16-20020a17090ad41000b00295f900f38fsm984763pju.11.2024.02.01.22.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 22:54:30 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 02 Feb 2024 12:24:17 +0530 Subject: [PATCH 1/2] PCI: Add a flag to enable D3 support for PCI bridges Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240202-pcie-qcom-bridge-v1-1-46d7789836c0@linaro.org> References: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> In-Reply-To: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> To: Bjorn Helgaas , Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring Cc: Lukas Wunner , Mika Westerberg , quic_krichai@quicinc.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=xYjw+OluseaVhWQ3IUAx0cVvhKzCoYdlybhgeyqTDc0=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlvJGcsxB5kZn0o16QvDlMle5WSwnkPHe6+RfAg ZVMNj0qD+KJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZbyRnAAKCRBVnxHm/pHO 9Sv5B/96AqSxhGvdFRYINn0qXI6I//m9YdiLPDz1KUMSNZ/KMy9wrSif+UWJNsuUjejpB8xi0T2 t0OqZ/KlnzEzTa8eQZRKNxESHRpPxnZSF/3+Cyo9kgxGD2G6buDxjl8Im+j1aDdET3oIhz/S80u kHQX5/HUm79erLggYeqOi189Q/Sc4Zm5e8o7z9ZN9hWztTky/t/PdGh2NIifNytb67sjE7gF9b0 sDPhkUVLB/QWV9hYFA7cYajeQqot29YY6KvX5dpz7Rxzzkjn2Z8QdMFr2/nJy25waTdFvFba4dn 7dcHRCcAabBAdRL6eLCB4ixpYsempTbi95CQCKei3iQsJ4Av X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789770454096325987 X-GMAIL-MSGID: 1789770454096325987 Currently, PCI core will enable D3 support for PCI bridges only when the following conditions are met: 1. Platform is ACPI based 2. Thunderbolt controller is used 3. pcie_port_pm=force passed in cmdline While options 1 and 2 do not apply to Qcom SoCs, option 3 will make the life harder for distro maintainers. Due to this, runtime PM is also not getting enabled for the bridges. Ideally, D3 support should be enabled by default for the recent PCI bridges, but we do not have a sane way to detect them. So let's adds a new flag, "bridge_d3_capable" to "struct pci_dev" which could be set by the bridge drivers for capable devices. This will allow the PCI core to enable D3 support for the bridges during enumeration. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/pci.c | 3 +++ include/linux/pci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d8f11a078924..8226a65d8ca1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3127,6 +3127,9 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) */ if (dmi_get_bios_year() >= 2015) return true; + + if (bridge->bridge_d3_capable) + return true; break; } diff --git a/include/linux/pci.h b/include/linux/pci.h index add9368e6314..161c0acf2b3e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -376,6 +376,7 @@ struct pci_dev { unsigned int no_d1d2:1; /* D1 and D2 are forbidden */ unsigned int no_d3cold:1; /* D3cold is forbidden */ unsigned int bridge_d3:1; /* Allow D3 for bridge */ + unsigned int bridge_d3_capable:1; /* D3 capability for bridge */ unsigned int d3cold_allowed:1; /* D3cold is allowed by user */ unsigned int mmio_always_on:1; /* Disallow turning off io/mem decoding during BAR sizing */ From patchwork Fri Feb 2 06:54:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 195654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp253166dyc; Thu, 1 Feb 2024 23:02:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLkA5LD3ge4JkrgO64iv8JRZMssH4qEUHeILB4YCjQJTbF5ekpqUeePxUBzXH+jF1x77uI X-Received: by 2002:a17:90a:4591:b0:293:bdef:ce72 with SMTP id v17-20020a17090a459100b00293bdefce72mr7288747pjg.9.1706857362148; Thu, 01 Feb 2024 23:02:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706857362; cv=pass; d=google.com; s=arc-20160816; b=hequ3p1uQO0fNKmFSMYAkk8BD+iITsPuOB5eIF59EKiqnoag5xcCqcD1TLhBT5hP/T qt8CJHRp8Ayg5DnsKnlQAwFMwZ2u9rRKHUVpB+eN3H0FSeZEqPJ2w0Zzr+fotNmdGR0E Bg6so/D6BJzYtYGhPf6MnQFVbf5Me/B5zs748brkuVnDj0Gk+jpOE57fL0WApLt5DcCB rSBMUah7xtEQj5BFdCnwhgZ7S7U+ll3peUS39n5VPrUnQDbg5X+JHeO09v1jGR86Ju5M Dx3UFrCV+0DpsNm7RH7WYGByuThmc/VfS3RRnsldjmp8xk6qzFrICU/wdmKjThuqTo1P XN8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=h/x9xuKD51JJrFalnZZ10uYlZwdWv4nb3yUwtxcC2fc=; fh=R7a1I+lwG9JT+Q84Th1AkDERBXm0C49Svhhb9ozAilQ=; b=hNNmRbuOVrgemv6kQFVNS+lDIIygtUPXjMvxE+CRmM3sIPRumDFHV9vAis6UTglMWt Hjl6l81X6irGRTG3Vq8ZDqa/kqzfQozv/9MrO+56r4vptLhSTxGHArrBys24dBcevnmC VACJwVNfrbz97NvfJgU36B8pW+RaVz4RwoSBDjJJtZIZ0oC0abSr664ERQMACi3YZCWv mxTmszcvnsdyMpSxUc9sHgnw48F1cXoC3HcMwT1xl+ho1UzHOWqz6DUCNZ0BIL00kLV3 kapVLNCcuvdvsUmHn8c3Ojc/g1kk8aNYUj2haYWskgyK/xAQFSc21vVm3/cnkqcKLDVh q1ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ytfTPLfL; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-49313-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49313-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCWlqn9dG0ctIquvudH/BuNI5yaVpMPuZaZDEcKKxEVyhZyAyxOenKfxf4LG0N8Dm3GX8UrjLLQ3++z2RrPe4RzvlP9gTA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id gd10-20020a17090b0fca00b00295fea213fesi1240110pjb.52.2024.02.01.23.02.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 23:02:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49313-ouuuleilei=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=@linaro.org header.s=google header.b=ytfTPLfL; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-49313-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49313-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 5AC2928EBDC for ; Fri, 2 Feb 2024 06:55:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3427C17C7B; Fri, 2 Feb 2024 06:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ytfTPLfL" Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B60FC17BDD for ; Fri, 2 Feb 2024 06:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856878; cv=none; b=lFSDEyluDwGJWDp6uYCzN4On7B2SwAGUP+e5rDYX2pO469VlXcJwJq5mV5pcD8blMfEChJIn82krJRCQ5/4fWTNcJBsHdiNz8uwXi658HOuzFpZ4iwmkO6LFATF8HrJtIRLO0f3RhFJNP2r1pq4athKOTU0AecSK+CR3FNZ56GE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856878; c=relaxed/simple; bh=8a+0oyI0cSJoqWk2V6P5ZLmO6u2tJ1UClYhfKKZ2QWw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k2le2oG5CTblA8h3J39aY6zVcuvC7HO0W/6VirMpoExlUEojU/BVomruP7BQ4HWLwDe6YUUrmsy2UFJJVaZWnpdM75u7vEzgUigrnnIvYI044q4hB/As7BRw98R2FJsC9UoAIzQfv1YYBmBEnqlDaFh0+8D+QXId0iM6oZq117o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ytfTPLfL; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-295a7fd8eecso1302747a91.0 for ; Thu, 01 Feb 2024 22:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706856876; x=1707461676; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=h/x9xuKD51JJrFalnZZ10uYlZwdWv4nb3yUwtxcC2fc=; b=ytfTPLfL6b5yFwmrwF2tJ1Giu9g/HOMPwRIC51omxKZtBi7gpWl+HWY2IHSfx0A5Dc QBYHpuSbRvO3f6PX37qDW8tvGjc3/AAqH0DjuJ0I1do3Tphq639bot4OVg4/igJtmh5+ JpNd7haYCM18x91TP9EPkJj6Mk0zMpmNjZ+qyQIN1h344+ltvFzLa596c5sFyZBNrG0F M6Y231WGp8J5BuvRM18rugq7gNvoVF9kbXjcDsaLgM9iteMDCKN/rQGRkO7dRDatBm57 1e67a8sIi+eLA4J2+pGa6dfWnagSGdVHgm26UWRXFFDCo07w0ZdpmvIefk9cmP8KBZIG T1IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706856876; x=1707461676; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h/x9xuKD51JJrFalnZZ10uYlZwdWv4nb3yUwtxcC2fc=; b=stY+rDyekTIKyp3H8eCOr7uaTp/WAyILgvNoAQWUFjvtuK7GIHI88tVAt0WY98sLkV BBmmXUz6ve9YPQaW2FpZShcmLf2nxp0X7DHROUF1OqAejAJDyCmYZCPasvbOo4fpyAuH 2Fx9mSZZb9pthB+Ht/LVffflw2MgaDpGIfyjq/VRHay5EtIgBxzagK/iMlEf0/yo7GLd iIVVLQ1T6FoeZMx5wRpUlz9RuQlNOstgppbwF8SusjKpH1tal6ZaUYeI04titCdFgD1T lvkoSXTl1SrbBOxZYRwKx57Uje0InKSyfJedPdfFHMxFk/izXdrMcZLT2Rk+O63njZEI OIxQ== X-Gm-Message-State: AOJu0YzVsLHQI3OkB7XNka+yLYa9i3zueMhQn1++7akk+1M+1fgM7Z7u OmidbQxaxWr00tACi0w71rfh39aDC8FDpSYGzquEzqOeeEtqiNEGn53XInBIyQ== X-Received: by 2002:a17:90a:6b46:b0:296:2fe3:cd28 with SMTP id x6-20020a17090a6b4600b002962fe3cd28mr2273163pjl.0.1706856875975; Thu, 01 Feb 2024 22:54:35 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCU5Jb1FDbEvfLgI5xEQaw+rAxd3rh1NLDc++Z9GSqA8boFyE/4tJGNkVMmL+J3MHUPd00O9sWjbw/T7FmnwE17PzhgMW9Egiqz1VqLkq2sVcaaEXCXgYS3cRNL4GAFTdQIdfsap6ppvCHeeGP83EyYsaMd6xdQMmJjNSzkSFpQ+aAysiNhA+k4AlUf4iPkJjU1hEhDRW9f0glweYChXypIbS18lHIGvQClqXGrW7jIchleOTaGXLTWRrXvMn48PnQeCl3mIG4th5+2SXrYDfsKwVW6snheHd1RauWcFHtZC+no01zkIpbx36tvgU3Hp36mDnU/xnXzpQv6cmBDNo5Q2DKajMkMfjXbOvdZfJCyTBRrN7d0EDwfRV2HYA/lTr2ApwXNbTzWUhBbf2138ZKh8GP/m+nF4s7Wxn9EqYwO8uYQNnWWtJ001sg== Received: from [127.0.1.1] ([120.56.198.122]) by smtp.gmail.com with ESMTPSA id r16-20020a17090ad41000b00295f900f38fsm984763pju.11.2024.02.01.22.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 22:54:35 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 02 Feb 2024 12:24:18 +0530 Subject: [PATCH 2/2] PCI: qcom: Enable D3 support for the recent PCI bridges Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240202-pcie-qcom-bridge-v1-2-46d7789836c0@linaro.org> References: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> In-Reply-To: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> To: Bjorn Helgaas , Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring Cc: Lukas Wunner , Mika Westerberg , quic_krichai@quicinc.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1737; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=8a+0oyI0cSJoqWk2V6P5ZLmO6u2tJ1UClYhfKKZ2QWw=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlvJGciN/Y0zChE5M99t5u9KSV9M2KE/HUNCrvm er3fnw8mOGJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZbyRnAAKCRBVnxHm/pHO 9S1nB/4jumZoFbgNps6BZOB3a0lMhegz7WtIlzbRJv+6L1+sIUWkv2tHHcWN5uABhRb9v4ObLcp H328Xl2mbuZZDJFZmaNqd22ihNpYSZ1yj5+fIsAwXXw6PGjKuunjkZs/dv7tQRD61dDr9I/jyec W0mh4Iu1xSe/g6Qo0c5ODfo6SWOcl8y17Mo947xnafjV8URXtcZf+tUrKgDHKgDbc92UK88zBSK a5xvY0Mu1G1/Cj5NYsq2JJ3M0pJgPw0k7RxzgD7dR97Li86IjCxVfO8inkLlo5KZjXpY+ROWIGv oFDw78TWDPlJ0PCuqMTdcG6iCHi9rkpSyifMG3nDQMhOnYFc X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789769665632433933 X-GMAIL-MSGID: 1789769665632433933 Make use of the "bridge_d3_capable" flag to specify the D3 capability to the PCI core so that the D3 support (in turn runtime PM) will be enabled for the PCI bridges. Currently, only for the recent bridges with PID "0x0110", this flag is set as a fixup. Because, there is no guarantee that the older bridges will support D3. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-qcom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 10f2d0bb86be..a6ae78d2ce92 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1649,6 +1649,11 @@ static void qcom_fixup_class(struct pci_dev *dev) { dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL; } + +static void qcom_fixup_bridge_d3_capability(struct pci_dev *dev) +{ + dev->bridge_d3_capable = true; +} DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0101, qcom_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0104, qcom_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0106, qcom_fixup_class); @@ -1656,6 +1661,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0107, qcom_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0302, qcom_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x1000, qcom_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x1001, qcom_fixup_class); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0110, qcom_fixup_bridge_d3_capability); static const struct dev_pm_ops qcom_pcie_pm_ops = { NOIRQ_SYSTEM_SLEEP_PM_OPS(qcom_pcie_suspend_noirq, qcom_pcie_resume_noirq)