Message ID | 1689232218-28265-4-git-send-email-quic_krichai@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1647884vqm; Thu, 13 Jul 2023 00:25:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFXQqSthbAbXphWk/h8uncOiDq133ig7kil4AnSi49OpdoLZMutUj3YudooGZtanFx2Fwpp X-Received: by 2002:aa7:cfcd:0:b0:514:9929:1b01 with SMTP id r13-20020aa7cfcd000000b0051499291b01mr970619edy.8.1689233108976; Thu, 13 Jul 2023 00:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689233108; cv=none; d=google.com; s=arc-20160816; b=XSVaJt0gTH+7+0KljvymU1HQ5JPGdXezfyRKD7go2Mx+Xwp9EJlxSwzH/MDyjIh9Uw oJZh8/wGIMYFQ246sb/bg4inmERC6bcWZibyRp1J9WclhBv05xQxHw/TEYv7y7QnPcWg lFq7S6aHLmpCOpydfTfGqlpa2PuInAJJFE9+OBDuIPqTgaLa/iifLIKHZpY1zGze0eqT 1rcQUGGCD0hnhRyzEh0VCgS8QFpvg7O3ftNBYJGAh5rP8D2+iUJu2VJwnkXEAajVik9W DHEUBCmlqbV0LUiQz47aKXL7W4zE++i5JakquyhQN5BIvXYTnQzlv5aBH7aat79gbWLu LmcA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020aa7d6da000000b0051e0591969dsi6371035edr.345.2023.07.13.00.24.45; Thu, 13 Jul 2023 00:25:08 -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 S234237AbjGMHK5 (ORCPT <rfc822;ybw1215001957@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <quic_krichai@quicinc.com> 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 <quic_krichai@quicinc.com>, Manivannan Sadhasivam <mani@kernel.org>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= <kw@linux.com>, Kishon Vijay Abraham I <kishon@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Jeffrey Hugo <quic_jhugo@quicinc.com>, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771289296055105549 X-GMAIL-MSGID: 1771289296055105549 |
Series |
PCI: EPC: Add support to wake up host from D3 states
|
|
Commit Message
Krishna chaitanya chundru
July 13, 2023, 7:10 a.m. UTC
Add support for handling D-state notify for MHI EPF.
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
---
drivers/pci/endpoint/functions/pci-epf-mhi.c | 11 +++++++++++
include/linux/mhi_ep.h | 3 +++
2 files changed, 14 insertions(+)
Comments
On Thu, Jul 13, 2023 at 12:40:12PM +0530, Krishna chaitanya chundru wrote: > Add support for handling D-state notify for MHI EPF. > > Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> > --- > 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; Where is this variable being used? Also, don't we need any locking? - Mani > + > + 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 <linux/dma-direction.h> > #include <linux/mhi.h> > +#include <linux/pci.h> > > #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 >
On 7/28/2023 9:39 AM, Manivannan Sadhasivam wrote: > On Thu, Jul 13, 2023 at 12:40:12PM +0530, Krishna chaitanya chundru wrote: >> Add support for handling D-state notify for MHI EPF. >> >> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> >> --- >> 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; > Where is this variable being used? Also, don't we need any locking? > > - Mani we are using this variable in wakeup host op which is introduced on patch [PATCH v4 8/9] PCI: epf-mhi: Add wakeup host op I will add lock in my next series. - KC > >> + >> + 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 <linux/dma-direction.h> >> #include <linux/mhi.h> >> +#include <linux/pci.h> >> >> #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 >>
On 7/31/2023 11:05 AM, Krishna Chaitanya Chundru wrote: > > On 7/28/2023 9:39 AM, Manivannan Sadhasivam wrote: >> On Thu, Jul 13, 2023 at 12:40:12PM +0530, Krishna chaitanya chundru >> wrote: >>> Add support for handling D-state notify for MHI EPF. >>> >>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> >>> --- >>> 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; >> Where is this variable being used? Also, don't we need any locking? >> >> - Mani > > we are using this variable in wakeup host op which is introduced on > patch [PATCH v4 8/9] PCI: epf-mhi: Add wakeup host op > > I will add lock in my next series. > > - KC Mani, as this is being called from IRQ context do we need to add any lock here. - KC > >> >>> + >>> + 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 <linux/dma-direction.h> >>> #include <linux/mhi.h> >>> +#include <linux/pci.h> >>> #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 >>> >
On Tue, Aug 01, 2023 at 10:31:42AM +0530, Krishna Chaitanya Chundru wrote: > > On 7/31/2023 11:05 AM, Krishna Chaitanya Chundru wrote: > > > > On 7/28/2023 9:39 AM, Manivannan Sadhasivam wrote: > > > On Thu, Jul 13, 2023 at 12:40:12PM +0530, Krishna chaitanya chundru > > > wrote: > > > > Add support for handling D-state notify for MHI EPF. > > > > > > > > Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> > > > > --- > > > > 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; > > > Where is this variable being used? Also, don't we need any locking? > > > > > > - Mani > > > > we are using this variable in wakeup host op which is introduced on > > patch [PATCH v4 8/9] PCI: epf-mhi: Add wakeup host op > > > > I will add lock in my next series. > > > > - KC > > Mani, as this is being called from IRQ context do we need to add any lock > here. > Notifiers are invoked in process context. And here, the context doesn't matter as either way you need locking to prevent concurrent access to dstate variable. But I think it is safe to ignore lock for now provided that wakeup_host callback is only called while MHI is in M3 state. Even if dstate changes while processing wakeup_host, it won't affect the behavior. - Mani > - KC > > > > > > > > > > + > > > > + 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 <linux/dma-direction.h> > > > > #include <linux/mhi.h> > > > > +#include <linux/pci.h> > > > > #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 > > > > > >
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 <linux/dma-direction.h> #include <linux/mhi.h> +#include <linux/pci.h> #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;