Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp774763rwp; Thu, 13 Jul 2023 00:15:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlE5y8KTgKtsYTj3Y1Ypcq86yiC0LLe6vPFjr/aDbWF5nXabQidfRm0TMwjkGQ9sZf8+8rc0 X-Received: by 2002:a17:906:51d4:b0:992:a9c3:244f with SMTP id v20-20020a17090651d400b00992a9c3244fmr666148ejk.4.1689232556808; Thu, 13 Jul 2023 00:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689232556; cv=none; d=google.com; s=arc-20160816; b=AB0OMzKQcBn5e6Yz+KJxquOIlu/z0kDS88rImanwhykQ+vWlVUiUXWKJYiAfd78Slj qBR7QUlwxg/zUzpbJSQkf72WBkeZq7WdJlsbFLecZ/vvR9+3KNdPwObfekmM6IXot+vA tMEwKaQnfDVcDbsJcOLCEdfTBxSMtihOUA3grLM3JETPrwvA1gTc1s6FOC2sSX2Wg7yg iZwXYcqClSDGYkodJR4b6mPyhz+ga4peLmr5Hr75NjqdAer2qHIdo856eLCSTNuq+ek/ PTdTNIVZN3rNAgpLXvDIF815WXGqgD3i3quy0LXwmEZf9d+yyocciyBGaW+uXn2F1sz6 aE2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=iv9VMeggZweWL3QOIkADDj2WzrjlhjhC5j1kulPSJ7c=; fh=mo08ARgMWVLkOXQO+n9fXCAyH6rFBGHgOh2lu+mOKe8=; b=Koq1YGTpFEdXECCUjWjoSiwo0SNFxqhLDu1RLBKSo9nuxYR+zkok97Jz68cX7B1oFk fiwkXe7kxO1K6UnHsqI0Bablq0m5lN0njA8cLHAaIGalYm7ax15fdMDzgiU/mKPucaqA 34I+4iu2udy0YAue99KowmsE2PdcT69j8t0LXR7Bw7qQ0/Cc3CPoc80eRWU2f3ZNnUdB S5ds4LEVmo0fuqvTv0FUwTeHiliyU1DhbPWF4aVqgSHB5ALoXcE/wahRQUAH7ZSr2aVa QZYw1BR9q0c31km1W94rmSbPNRc921X8sRKGv3MRpFE7w2zMmHo7vSEnKahE6WgfExB2 3gWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gtCdxhPg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl5-20020a170906e0c500b00992bfd14c42si6252482ejb.949.2023.07.13.00.15.31; Thu, 13 Jul 2023 00:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gtCdxhPg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234132AbjGMHK5 (ORCPT + 99 others); Thu, 13 Jul 2023 03:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbjGMHKr (ORCPT ); Thu, 13 Jul 2023 03:10:47 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175AA212B; Thu, 13 Jul 2023 00:10:39 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36D5BExj018681; Thu, 13 Jul 2023 07:10:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=iv9VMeggZweWL3QOIkADDj2WzrjlhjhC5j1kulPSJ7c=; b=gtCdxhPg+9VEksJ/0PlRl6HBkNSZnWmXHhwOxLZvH7QcSpv1G0X/Ab4iRbxWOkNJeRu2 nKb9RabvN/5uFF3bS+RjUJAYvvosEx4E7gK0Y+GR5dznN91y6YDNMssk6Jd/uBOg7N9f qpDcbpDMy6w4n7nlsvcYdBbOn1votgMeOqkOlUY269wctarXqiTwm2R1DbqxUwFYUYZ0 s++VLEC5tc6ZRPIIhe9cw9QJSbnvrWSYzmh71MgVk74SxeeK1Fq9ckrQQUUgDC4pM3bF FWanCjs47aLjdogwBhOU8hWNd6qOrImkLG/kSqtDQzNgrwQT5UbGGEkHeC+rWNvKw22R VQ== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rt3qfguw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jul 2023 07:10:30 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 36D7AQLm030210; Thu, 13 Jul 2023 07:10:26 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3rq0vkymhq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Jul 2023 07:10:26 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36D7AQAA030196; Thu, 13 Jul 2023 07:10:26 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-krichai-hyd.qualcomm.com [10.213.110.112]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 36D7APOC030194; Thu, 13 Jul 2023 07:10:26 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 4058933) id 46B4147AD; Thu, 13 Jul 2023 12:40:25 +0530 (+0530) From: Krishna chaitanya chundru To: manivannan.sadhasivam@linaro.org Cc: helgaas@kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com, quic_nitegupt@quicinc.com, quic_skananth@quicinc.com, quic_ramkri@quicinc.com, krzysztof.kozlowski@linaro.org, Krishna chaitanya chundru , Manivannan Sadhasivam , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Jeffrey Hugo , mhi@lists.linux.dev (open list:MHI BUS) Subject: [PATCH v4 3/9] PCI: epf-mhi: Add support for handling D-state notify from EPC Date: Thu, 13 Jul 2023 12:40:12 +0530 Message-Id: <1689232218-28265-4-git-send-email-quic_krichai@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1689232218-28265-1-git-send-email-quic_krichai@quicinc.com> References: <1689232218-28265-1-git-send-email-quic_krichai@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: ZPkHoeyBi-N2ftytMKAd0llsQjP6yA45 X-Proofpoint-GUID: ZPkHoeyBi-N2ftytMKAd0llsQjP6yA45 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-13_04,2023-07-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxscore=0 suspectscore=0 adultscore=0 priorityscore=1501 mlxlogscore=773 phishscore=0 malwarescore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307130061 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for handling D-state notify for MHI EPF. Signed-off-by: Krishna chaitanya chundru --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 11 +++++++++++ include/linux/mhi_ep.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 9c1f5a1..ee91bfc 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -339,6 +339,16 @@ static int pci_epf_mhi_bme(struct pci_epf *epf) return 0; } +static int pci_epf_mhi_dstate_notify(struct pci_epf *epf, pci_power_t state) +{ + struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf); + struct mhi_ep_cntrl *mhi_cntrl = &epf_mhi->mhi_cntrl; + + mhi_cntrl->dstate = state; + + return 0; +} + static int pci_epf_mhi_bind(struct pci_epf *epf) { struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf); @@ -394,6 +404,7 @@ static struct pci_epc_event_ops pci_epf_mhi_event_ops = { .link_up = pci_epf_mhi_link_up, .link_down = pci_epf_mhi_link_down, .bme = pci_epf_mhi_bme, + .dstate_notify = pci_epf_mhi_dstate_notify, }; static int pci_epf_mhi_probe(struct pci_epf *epf, diff --git a/include/linux/mhi_ep.h b/include/linux/mhi_ep.h index f198a8a..c3a0685 100644 --- a/include/linux/mhi_ep.h +++ b/include/linux/mhi_ep.h @@ -8,6 +8,7 @@ #include #include +#include #define MHI_EP_DEFAULT_MTU 0x8000 @@ -139,6 +140,8 @@ struct mhi_ep_cntrl { enum mhi_state mhi_state; + pci_power_t dstate; + u32 max_chan; u32 mru; u32 event_rings; -- 2.7.4