From patchwork Tue Apr 1 04:42:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14034346 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 7E3B61D5176 for ; Tue, 1 Apr 2025 04:43:12 +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=1743482593; cv=none; b=d+jcoQMeVNaOdMO3lhaxGLJEsKnPg+M6KKJEcFHNoMsIjsZCmhEoCl7yqh5bNkKI2FRgnCWXmdiJF286TisSnf06sSCCQti/86SjP0VvdTU9jYyq0wxG8rFDW9gli3XrUIxai6MyLcoI5FYBrJNYRcVAQQrDUG7ud6YSACMDsXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743482593; c=relaxed/simple; bh=2UXuX1AMMSWXufAarokzPiIVXoyWp7dxY3qIHpMjNV0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uK64pJGQAdsncplAZk2DPwV8O7NaxJea7RxaQXiCljG02xKoV9EeE/ueSB1bgmPYBbgKgMpzcPO+1NzfbrrgHsoIP602ogDU92eFaj0nCs9/iNeTZwZB4nlBqqVX9hpEoMe8hVwjgEqmjz/gl6EodWG6CKvMa7MSnl3WQmJNqxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=M9O2IJyn; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="M9O2IJyn" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52VFCqIw002313 for ; Tue, 1 Apr 2025 04:43:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JVIxJwxtqh/xBODLl5IXRK6VBOMqf0w0YODMOA6QzRM=; b=M9O2IJynXFoDzenr pBNT31zm7s24cADWSAflMeDqnW95lxcs8fw9+DHltGD0mHkAhfmrp+mX2NTwYmB+ pWK5P9L9cLnuWDCiYqzisQAKt+g/LGRg3v0WPgjOtHWs2n7mtgInXl91v3IYCpDC MpCpz5pcLtkO+UuHJd2JFCZdNFAa7ZWCO/fQQoGOoOEXnsuxaiwzgK3tN/A36ewU uRAO9J/rpQ7+A0gin5LZRjd+yBCdeUmBfUDSeGrOdDT5BTAwb8CJSsC34I49ouuj KaW3ElrrbzruWHJLQiLnbqiuC2DCmx15s1FeVN8ymyhLBjTcS0s1tRj420NE6WyT LTdz/Q== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45pa5bpccq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 01 Apr 2025 04:43:11 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-22412127fd7so73051115ad.0 for ; Mon, 31 Mar 2025 21:43:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743482591; x=1744087391; 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=JVIxJwxtqh/xBODLl5IXRK6VBOMqf0w0YODMOA6QzRM=; b=j+Cx0WkXlouA5GFU9xpamaXIqD+cxJy4x105ui/iNZIgbzKoI2+GT2Qz4V72DJ7C21 fAYXUvOqx7c1iKkZhU6QGzGzUCL7vAqo62bac2fFnak4dONrj9IzGxb7uB/dtJyq/BAr kbaZzaXbdSIrYIsc1f4tLpJkUjYPX5BxVCCAkIBqhmyLauMBZTuveOjwVtGaFClbOKX1 h6w2LfWuZolMCcQCuoUe/Y9qth5UyeAco40fdDvMaAPolbRkxHqBwtDKGjDnkBGFDcTi Cr8z0gS+MSFx65Y2bWPQfBIcQWQVHOUj7ALcgmL5rrzvN2TvaYMUkQLFw6eNEI3+pbRN ukaA== X-Gm-Message-State: AOJu0YxXl77iodmG3EILwP/ji/BSPSEacGgpoNLtR31QnqrHucjWtRN6 q/s9b8E8fb+sS88dQS+ClTRQuPBkgNbTAkuK6KyigaKKBuzeg0kfr67cV44ImbBH2DKQgqX/ogA G/ekX/XfC2mrizPAyUiIoLm/GlehqE/i2Rfb/C68e/Y5CEyAuwuxSXUw9o2taw8h9 X-Gm-Gg: ASbGnctx3wJ97D2evuLi9ngZnvwyEcrlavMuUdiAyw3J9QdwFa4EaN6hD1bLqMaEZcO pq5/8fzbBAZ0mN8CIZNTXau7XAVaAv5dYZjskQHoC4whxgvz7BsHq43vAk0gh+wK8OfzoZk+RzC eEjJjna0zzm2YHNSr95tJbnDXv+hhZ9zYnUjNEM6gG0VlC+BAwh3rCM38EQ6XHbDuIfd8HjxRU4 xsl7xCFqhy8LGRzpU9WK6eKawT7YnCG6MA214ZAKFfoFOWvrhhsONPwwBe9zxdxFBqK27fA96UJ zx4G05ugzYYzVj/YVJgxQMddN4lQ4bUbafo6Ipkbw9uD8pGgA8w= X-Received: by 2002:a05:6a00:174b:b0:736:4d44:8b77 with SMTP id d2e1a72fcca58-7398035e5a0mr20017522b3a.8.1743482590722; Mon, 31 Mar 2025 21:43:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkiKWztDqATdQNpbZRYBaPGQgHWo+VlBH9KP8WuISMtoSn2CXyo3vvSN+1gB6r7L7E3CmI4Q== X-Received: by 2002:a05:6a00:174b:b0:736:4d44:8b77 with SMTP id d2e1a72fcca58-7398035e5a0mr20017488b3a.8.1743482590309; Mon, 31 Mar 2025 21:43:10 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73970deec96sm7940294b3a.34.2025.03.31.21.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 21:43:10 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Tue, 01 Apr 2025 10:12:43 +0530 Subject: [PATCH 1/2] arm64: dts: qcom: sc7280: Add wake GPIO Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-wake_irq_support-v1-1-d2e22f4a0efd@oss.qualcomm.com> References: <20250401-wake_irq_support-v1-0-d2e22f4a0efd@oss.qualcomm.com> In-Reply-To: <20250401-wake_irq_support-v1-0-d2e22f4a0efd@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Bjorn Helgaas Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743482582; l=1775; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=2UXuX1AMMSWXufAarokzPiIVXoyWp7dxY3qIHpMjNV0=; b=eZZVwPLsgOyNPjDKIyKq15fq9fDVPgcVYf/nmmwSIFP+3mz/qsDsy2REynACuaZ/ncVN12WrX b0uwBygfq6fC/lAftKtrPZv7LsLC5a9+cU3u9G4Rcd98XkPsHekneMG X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: nZ85H08c6tW8pLwkTYjsLCiKHMuw-aaP X-Authority-Analysis: v=2.4 cv=YqcPR5YX c=1 sm=1 tr=0 ts=67eb6edf cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=_k9ig2nQFDp-gxZIyLcA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: nZ85H08c6tW8pLwkTYjsLCiKHMuw-aaP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-01_01,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 phishscore=0 impostorscore=0 suspectscore=0 mlxlogscore=889 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504010030 Add wake gpio which is needed to bring PCIe device state from D3cold to D0. Signed-off-by: Krishna Chaitanya Chundru --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 1 + arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts index f54db6345b7af6f77bde496d4a07b857bf9d5f6e..ebfe2c5347be02ea730039e61401633fa49479d2 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -711,6 +711,7 @@ &mdss_edp_phy { &pcieport1 { reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; }; &pcie1 { diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi index 60b3cf50ea1d61dd5e8b573b5f1c6faa1c291eee..d435db860625d52842bf8e92d6223f67343121db 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi @@ -477,6 +477,7 @@ &pcie1 { &pcieport1 { reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; }; &pm8350c_pwm { diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi index 19910670fc3a74628e6def6b8faf2fa17991d576..e107ae0d62460d0d0909c7351c17b0b15f99a235 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi @@ -416,6 +416,7 @@ &lpass_va_macro { &pcieport1 { reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; }; &pcie1 { From patchwork Tue Apr 1 04:42:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14034347 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 A81631D5CFD for ; Tue, 1 Apr 2025 04:43:17 +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=1743482599; cv=none; b=aNXJyTYIrcaqsfnpFTyu2crdFBROr1BUrX8TFGx/BOglV3tueFms9dvFV34UaYfaAqN/XM9SgzzR/qKfdAJ1AFilB02wU/QawZUueWmcqhkA6m+wCs9DI7iwTbmM7EA9RatHOjPq/J+R19xD2EQDxWtdxfo46ERg8JRgl4uBA7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743482599; c=relaxed/simple; bh=ux2W3fa5UF+jdQyyWQKpB6Q0rrH+j8lj+L+VJ6ZwaEc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fe3SFhxR63KAHf7EAmksOo0RTEEwA+TDi6C+RvrkeWDrBsjT6/pa0D66PIpDGKBeFuG4O1fbzrzHHLaFfd1pRg8u/3h7BHML5zRzNV6cO2kjsySeROvrNbGQ/vHWF0kZKgXLdBT4FLvW7/ZIVVMYjuXg8OyqPDpk/ANjhu6VEOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZyPtIp/Z; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZyPtIp/Z" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52VKCLts019535 for ; Tue, 1 Apr 2025 04:43:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Bhbf80HBiZjeWneDSbVO1CX4rg1V65JnwlZBLRmEgRg=; b=ZyPtIp/ZGEaJeLgw k3v0qQyWNrseS532oecOPu7m+If9/Q/3UtsuAOBkaE5Jusp6fBPv6Ezqvrt1kG9B H1UZTF8IVzjSA8+YCw+oBKMZKS9cipbcit9UudQYI8Jg+xTpcwdBuz61DhIngEWL jir8MvW403vIKQOIwh0v99Sq4PWl+I16lVYq63+xIxLN+WulgY7b37m0/ycJeYI0 JtoJEc1rTQ1MpUkGyyJeHKdDcHQ5rqsddzB3iw7txmoCW5h4KubuFnkkx0BYsm3w TOYt6MUEtUp3aKnKaTcZQbsILmghvCfQ45yaByRk6jCLvGF/aEuRijtv9vxh0Dar Gx4+3A== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45r1vn8xje-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 01 Apr 2025 04:43:16 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2ff798e8c90so8322750a91.1 for ; Mon, 31 Mar 2025 21:43:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743482595; x=1744087395; 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=Bhbf80HBiZjeWneDSbVO1CX4rg1V65JnwlZBLRmEgRg=; b=VK1FCgGdVyhZuCv2QhHJmUuu/h8pkl+Iv+qsVeuouJDpLcFbOItc8T/P4Oq4LoXcdg VJ9M2tfNpR0VrISrdZIjFMJJMAgsUzQmQob/BBLMHn1BV1SF1NBh09TbEIBJrV2loJIk zmiHbBZxjHgVG5Kz15m2kRPQfWWHRSkU/XNaIoN9Qnnbh2h7K8WkpRiTpoQ0XXmnJuOb k6oNYHHc+TL4Yn2XHDOnZcH09cRVc64qoofRxF80RS7Tjfztzb68LKaLGos3cblgKCUH LVHmWSeLf5ANmVoghgpxmI9ORH4Yeg8rOeqs5w8M7KTkyZnoT9Hex/41g5DNMlJeoZtw i2hA== X-Gm-Message-State: AOJu0YzWYgTMtVHdMZf33MYRPh6gPSmFlZchoBeON5zkeJ695T7uUU/Q auIGYWs71rQmtVXmJgpAnwfPG9SBFmxKN+pQfYuXXnRfnSxrykE5kj0t0TRrD+eXv5V/0CVdRK7 dXDoWcbPjIjK87YyyPILcFlLPlzm1uoXGN+FYO4eFF5QfZv1wZxnfm/oku15lEyEs X-Gm-Gg: ASbGncssrJwd7WAUvyZ5bJZT/dtiVhtupxkULDwKAGXbQA3JQrkFyyWMfCeHwX2InrM QM4roUBowSxjQ6LSK0OTKaq4FBkwXOOlJddRnMhVmyRrTKCPhlLZpH93JcLVqSBDzCLDaxIpvzK AmKieIya3ds3zgPR6uJOQ8M3SEqL1HnMery4+4/hSHnrP8AguYoarWKQQU+AOCLiN7ZJoo8BVia aJYXvw7DvR6vikaUykHFGFtxeyXvhHhen4Pfa77+pgOG7KMHO6JCPvBF2vqYFPXZJ/F7f0qCQJg 8J0ys9/CHcKBRTr6Uwl+ZbGF99MtFHt/k3rHW0fCQhoXPiEretk= X-Received: by 2002:a05:6a00:1784:b0:736:8c0f:7758 with SMTP id d2e1a72fcca58-7398038028cmr16685917b3a.10.1743482594819; Mon, 31 Mar 2025 21:43:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHz+MOxmKD2YZ5JuPKKSQQaWVdGpFuYmspO+ReGzpMU1Pa0EptpT2IjBujNxWCzYr7pQoED6A== X-Received: by 2002:a05:6a00:1784:b0:736:8c0f:7758 with SMTP id d2e1a72fcca58-7398038028cmr16685882b3a.10.1743482594367; Mon, 31 Mar 2025 21:43:14 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73970deec96sm7940294b3a.34.2025.03.31.21.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 21:43:14 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Tue, 01 Apr 2025 10:12:44 +0530 Subject: [PATCH 2/2] PCI: Add support for PCIe wake interrupt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-wake_irq_support-v1-2-d2e22f4a0efd@oss.qualcomm.com> References: <20250401-wake_irq_support-v1-0-d2e22f4a0efd@oss.qualcomm.com> In-Reply-To: <20250401-wake_irq_support-v1-0-d2e22f4a0efd@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Bjorn Helgaas Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743482582; l=4789; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=ux2W3fa5UF+jdQyyWQKpB6Q0rrH+j8lj+L+VJ6ZwaEc=; b=j77PZzhEvi2s1vAWkryDc1cbVK09KS8RrSQxK5DVlcoCLxjZGd2QdV+Zrd/IBPCbx75WNPsfh JmTXTmY9JXjDyN/iPT4ihlhT3Ud411gAn1DSnypn1fVq6gnvAXNHT/L X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=UL3dHDfy c=1 sm=1 tr=0 ts=67eb6ee4 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=iljMX2kAvVRlE-iODa4A:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: v2oxUAR-JhHwbqVGrKOX-WH6Oh9LUDQk X-Proofpoint-GUID: v2oxUAR-JhHwbqVGrKOX-WH6Oh9LUDQk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-01_01,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504010030 PCIe wake interrupt is needed for bringing back PCIe device state from D3cold to D0. Implement new functions, of_pci_setup_wake_irq() and of_pci_teardown_wake_irq(), to manage wake interrupts for PCI devices using the Device Tree. From the port bus driver call these functions to enable wake support for bridges. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/of.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/pci/pci.h | 6 +++++ drivers/pci/pcie/portdrv.c | 6 +++++ 3 files changed, 72 insertions(+) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 7a806f5c0d201bc322d4a53d6ac47cab2cd28c55..abb0ba001edf604170aaa118f7fdc1a1709c171f 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -7,6 +7,7 @@ #define pr_fmt(fmt) "PCI: OF: " fmt #include +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include "pci.h" #ifdef CONFIG_PCI @@ -851,3 +853,61 @@ u32 of_pci_get_slot_power_limit(struct device_node *node, return slot_power_limit_mw; } EXPORT_SYMBOL_GPL(of_pci_get_slot_power_limit); + +/** + * of_pci_setup_wake_irq - Set up wake interrupt for PCI device + * @pdev: The PCI device structure + * + * This function sets up the wake interrupt for a PCI device by getting the + * corresponding GPIO pin from the device tree, and configuring it as a + * dedicated wake interrupt. + * + * Return: 0 if the wake gpio is not available or successfully parsed else + * errno otherwise. + */ +int of_pci_setup_wake_irq(struct pci_dev *pdev) +{ + struct gpio_desc *wake; + struct device_node *dn; + int ret, wake_irq; + + dn = pci_device_to_OF_node(pdev); + if (!dn) + return 0; + + wake = devm_fwnode_gpiod_get(&pdev->dev, of_fwnode_handle(dn), + "wake", GPIOD_IN, NULL); + if (IS_ERR(wake)) { + dev_warn(&pdev->dev, "Cannot get wake GPIO\n"); + return 0; + } + + wake_irq = gpiod_to_irq(wake); + device_init_wakeup(&pdev->dev, true); + + ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, wake_irq); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to set wake IRQ: %d\n", ret); + device_init_wakeup(&pdev->dev, false); + return ret; + } + irq_set_irq_type(wake_irq, IRQ_TYPE_EDGE_FALLING); + + return 0; +} +EXPORT_SYMBOL_GPL(of_pci_setup_wake_irq); + +/** + * of_pci_teardown_wake_irq - Teardown wake interrupt setup for PCI device + * + * @pdev: The PCI device structure + * + * This function tears down the wake interrupt setup for a PCI device, + * clearing the dedicated wake interrupt and disabling device wake-up. + */ +void of_pci_teardown_wake_irq(struct pci_dev *pdev) +{ + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); +} +EXPORT_SYMBOL_GPL(of_pci_teardown_wake_irq); diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 01e51db8d285af54673db3ea526ceda073c94ec9..6e3d90db4b2505dd3885b482d4c5eafa033714e7 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -820,6 +820,9 @@ void pci_release_of_node(struct pci_dev *dev); void pci_set_bus_of_node(struct pci_bus *bus); void pci_release_bus_of_node(struct pci_bus *bus); +int of_pci_setup_wake_irq(struct pci_dev *pdev); +void of_pci_teardown_wake_irq(struct pci_dev *pdev); + int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge); bool of_pci_supply_present(struct device_node *np); @@ -863,6 +866,9 @@ static inline int devm_of_pci_bridge_init(struct device *dev, struct pci_host_br return 0; } +static int of_pci_setup_wake_irq(struct pci_dev *pdev) { return 0; } +static void of_pci_teardown_wake_irq(struct pci_dev *pdev) { } + static inline bool of_pci_supply_present(struct device_node *np) { return false; diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index 02e73099bad0532466fa10f549cc3c5013aa1bbb..fe1da757e9eca0f82ae0d8043c0e4547ac9c30b6 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -695,6 +695,10 @@ static int pcie_portdrv_probe(struct pci_dev *dev, if (type == PCI_EXP_TYPE_RC_EC) pcie_link_rcec(dev); + status = of_pci_setup_wake_irq(dev); + if (status) + return status; + status = pcie_port_device_register(dev); if (status) return status; @@ -728,6 +732,8 @@ static void pcie_portdrv_remove(struct pci_dev *dev) pm_runtime_dont_use_autosuspend(&dev->dev); } + of_pci_teardown_wake_irq(dev); + pcie_port_device_remove(dev); pci_disable_device(dev);