Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4029148rwb; Sun, 30 Jul 2023 23:14:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2EsK6/tFZ83oezYZ62GTZnYjVuFJE638H4mMhrmLE9OpkEjtwKppd4CvlMN+isdPasIOd X-Received: by 2002:a05:6a00:1898:b0:687:2d90:acfc with SMTP id x24-20020a056a00189800b006872d90acfcmr3909257pfh.2.1690784057210; Sun, 30 Jul 2023 23:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690784057; cv=none; d=google.com; s=arc-20160816; b=H1lUqzPa8O4cANzqaa3R92QqXwKkqVzrv3sN8WZ+yNDjl3DcgM1t/koCBmSEAkGAGn qbMb6zS1mFSs2I7rib+3IZupbzTDfs0PqaWdTIGwFWdqbRFIS/zMMeXf0dlzaecdc0Rk wQdYrri8Nad+eQq0Fsn7Q5ADfOC2kctQam1w8nlsqHri5Okq/nMMU6TJtrsJbihme4H3 P5xUPJJPm3YCCCZZWh2BXTgMr9euqSqOk/Y2UIpnfZ+WUqQxgBFpaR/+xNEFr41I8eB5 e1mD51/miE09wZ3V3u2zEq8zFqEKcW4AhWPFfOiSADHnIvhBMNhwkwoEpun1gquWnTOO GVtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=auBQ1fqo5sO0Ek7pY/4g3MLb2S7HCFjPcq5AVgVBzKk=; fh=2Xk9LUG/hB4G43s7/MjxDobdxWIhDquV4PXDvD60z4A=; b=ApYhqBn4/QH59+EIE2UH08NlxJPHpLLG9Ci9drNpBVou+IOfSlT29Kqjv5WizrzBZV 2ickNmtJPBPoJuge6+yTd/glEQyNGruBdZOUvkbS9vqzoC9/GR9coiIa9L3/Mdn+3Nui R0TkVG6qDFN+dT9ZNf+8CVaQR0VokZxZ63qxGE1fDz20WDBrIAiUgamnrJEtoVcMF5r+ oBPZpJ90sUk13Oue/mExdoOnRXCldGzrbOU6qGx8h/O5PjQXBHPrOFrivgFeoMJtC/ok tIWZoFn3MyaPIVi4xKCkAeSospIKuB2xL0hZ9k4EaVJZ0FtdISblSpfPPehb2dw6okXC GkmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WEHeaiKj; 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 fi35-20020a056a0039a300b00686e7b259fcsi6990270pfb.184.2023.07.30.23.14.05; Sun, 30 Jul 2023 23:14:17 -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=WEHeaiKj; 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 S229909AbjGaFfx (ORCPT + 99 others); Mon, 31 Jul 2023 01:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjGaFfw (ORCPT ); Mon, 31 Jul 2023 01:35:52 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46C12E6A; Sun, 30 Jul 2023 22:35:51 -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 36V5RCex019032; Mon, 31 Jul 2023 05:35:37 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=auBQ1fqo5sO0Ek7pY/4g3MLb2S7HCFjPcq5AVgVBzKk=; b=WEHeaiKjczAeD5XZE14ipuw123ZRGyNo2ozmoSjNGRkZTSvbDr4KJopmJgL+O31zsQ0f XiS+1jXhG8rEkW6OtP0i15yNWtO3Y+Ln/SqwcOz2EezmGq9mjri8eyGaT19Ek2PbopZR 0VFkxp8EAM0nuLY/ewToEgJOxVeTayqCoDlufd3EMEHjssRwWVAECuuU2urEodsA4dUG XMbpboNYsQ0krT6TAqKZwzY8MwruM/P6L0tGEpVOgGMmyI0SXayECv9D8nzm2XlotMHH Wu2yXbh0dgb1d81gbYpKRQE9xyAl6UNf/660pedLA2SjzsdWv6nOe4v/5BkkYsPfMXOx Og== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s4v2djnkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:35:36 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36V5ZaTa012622 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:35:36 GMT Received: from [10.217.219.216] (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.30; Sun, 30 Jul 2023 22:35:31 -0700 Message-ID: <1cfa6656-8130-ce1d-e28e-3665f12cc76a@quicinc.com> Date: Mon, 31 Jul 2023 11:05:28 +0530 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 v4 3/9] PCI: epf-mhi: Add support for handling D-state notify from EPC Content-Language: en-US To: Manivannan Sadhasivam CC: , , , , , , , , , , "Lorenzo Pieralisi" , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Jeffrey Hugo , "open list:MHI BUS" References: <1689232218-28265-1-git-send-email-quic_krichai@quicinc.com> <1689232218-28265-4-git-send-email-quic_krichai@quicinc.com> <20230728040949.GF4433@thinkpad> From: Krishna Chaitanya Chundru In-Reply-To: <20230728040949.GF4433@thinkpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] 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-GUID: z-ofuw4beMbPqNgejJqFB81DA6v6rK6s X-Proofpoint-ORIG-GUID: z-ofuw4beMbPqNgejJqFB81DA6v6rK6s 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-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 mlxlogscore=903 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 impostorscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307310050 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 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 >> --- >> 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 >> #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 >>