Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp517798rwd; Wed, 17 May 2023 23:26:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dAg0N4uTwRl0fhlKPyZVRqAr7teEwr9IyyavoxxynOTDYUScUfGctNbm92/G3J+rerjHj X-Received: by 2002:a17:90a:5a07:b0:253:2816:2a12 with SMTP id b7-20020a17090a5a0700b0025328162a12mr1318201pjd.14.1684391205311; Wed, 17 May 2023 23:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684391205; cv=none; d=google.com; s=arc-20160816; b=mUhrUogVJGQjGFxR5KU5Vauw6bHWqGOdJY91ZLg9q5TS47Jnay2TXXc3j+g1LN+O9t r3+CeCjOXg8q6uyXac83yU6GGkKnSbrzWM9epUXfMkuROo1KyeB6/F5sj+Z0oAMt8uT8 n/tq6VCYNL4Jo/Fr/UZsmE37P2R5KqkjNaIJpefoW03MkqC89Y2A8BFgFChDxcsAYAGd uu785alZ2LG61dcySbifilZrAbl+ddCy95eoFnHEb0mUbWA2TZyQ7spBc4zzWCQRyjqn n34VvJRRdOSXDNGKOpi0aSQv+uRrIaUM3Ki/lyxy2SToIF8Ot4irSMFTsiLwuP7eEjeS bIZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=/AnDV/3xdVdl08tsQzbCGrmi9kVas80L/eRnAlVjl2Y=; b=DPtWKF/XOw7DMKkP/JOjfuLOL0O2R4EieyLGvaDMtkRID7XmYe517b596KnCQ1mgWi KcBTR5ctPxJQfmWNiNPfJHRFOIGcLV3+J3AMGDrRuuAIn2tK0Aw0OA+DmgAtwQw2RU0L ua0vb9GtFErRvqOBWGwrsBrjjEGfzyyf+Sqza3OYrNoA+L7jq0aAX9fLvQa9474nCCs5 1S9jF2dpbO1oqMtnnAdBJ+hC/peuSMWwyXiThiekQxcNpZYFdcuAyZEVu3rxxg5QiMyQ amuQC104BVS2o49ZFZxoaLdoN9p1qZjry81KthSsEZTApqVZ5MbqNdPEpaL2H87yFqHB DMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iXRPJHn3; 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 x10-20020a656aaa000000b0052c3f0ae398si738722pgu.158.2023.05.17.23.26.30; Wed, 17 May 2023 23:26:45 -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=iXRPJHn3; 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 S229958AbjERGW6 (ORCPT + 99 others); Thu, 18 May 2023 02:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjERGW5 (ORCPT ); Thu, 18 May 2023 02:22:57 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98DC8172D; Wed, 17 May 2023 23:22:56 -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 34I6293I028055; Thu, 18 May 2023 06:22:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id; s=qcppdkim1; bh=/AnDV/3xdVdl08tsQzbCGrmi9kVas80L/eRnAlVjl2Y=; b=iXRPJHn353Qba/JTaMUgSh9jxQT44cimj1THGW//7NODvMF1Nw+xXiJzqQigmr6V78ZF BSQcR/5f+w0Fudz2ORF0reJeUWYHVjHqsFhQfP/XbBIt5xFDxcxIK+qvkAIR6KtJg8k3 tcWQ9jJqOvt/VBVZam2LGxqmFC684mwkyV/8jlhMcBatE7UMKt2gDB+FVs0UsRap7dcB pS1qINfjBZNIjSvrQMCajoxlv3F0quQ5eS6MG9VS3KbPKu8vyHrvvx3AkqKXeXUlKOS7 L4QCx09mD0Gw9lYqc9LJVF9y8UsYUhpfUGDZtHsbhXcQiDhm/qpyw0kswci4rys2+aJq 7w== Received: from aptaippmta02.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qned3018r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 06:22:46 +0000 Received: from pps.filterd (APTAIPPMTA02.qualcomm.com [127.0.0.1]) by APTAIPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34I6MhvR000555; Thu, 18 May 2023 06:22:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APTAIPPMTA02.qualcomm.com (PPS) with ESMTP id 3qj3mmf043-1; Thu, 18 May 2023 06:22:43 +0000 Received: from APTAIPPMTA02.qualcomm.com (APTAIPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34I6MhUJ000550; Thu, 18 May 2023 06:22:43 GMT Received: from cbsp-sh-gv.qualcomm.com (CBSP-SH-gv.ap.qualcomm.com [10.231.249.68]) by APTAIPPMTA02.qualcomm.com (PPS) with ESMTP id 34I6Mh6P000548; Thu, 18 May 2023 06:22:43 +0000 Received: by cbsp-sh-gv.qualcomm.com (Postfix, from userid 4098150) id B4353477B; Thu, 18 May 2023 14:22:41 +0800 (CST) From: Qiang Yu To: mani@kernel.org, quic_jhugo@quicinc.com Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_cang@quicinc.com, quic_mrana@quicinc.com, Qiang Yu , stable@vger.kernel.org Subject: [PATCH v4] bus: mhi: host: Skip MHI reset if device is in RDDM Date: Thu, 18 May 2023 14:22:39 +0800 Message-Id: <1684390959-17836-1-git-send-email-quic_qianyu@quicinc.com> X-Mailer: git-send-email 2.7.4 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: VRvzgFQvJEKTXqb3lmMNlJzqZ0vbclas X-Proofpoint-GUID: VRvzgFQvJEKTXqb3lmMNlJzqZ0vbclas X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_04,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1011 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180047 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 In RDDM EE, device can not process MHI reset issued by host. In case of MHI power off, host is issuing MHI reset and polls for it to get cleared until it times out. Since this timeout can not be avoided in case of RDDM, skip the MHI reset in this scenarios. Cc: Fixes: a6e2e3522f29 ("bus: mhi: core: Add support for PM state transitions") Signed-off-by: Qiang Yu Reviewed-by: Jeffrey Hugo --- v1->v2: use ~75 columns in commit text, add Fixes tag v2->v3: update Fixes tag v3->v4: add review tag and CC stable drivers/bus/mhi/host/pm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 0834590..8a4362d 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -470,6 +470,10 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) /* Trigger MHI RESET so that the device will not access host memory */ if (!MHI_PM_IN_FATAL_STATE(mhi_cntrl->pm_state)) { + /* Skip MHI RESET if in RDDM state */ + if (mhi_cntrl->rddm_image && mhi_get_exec_env(mhi_cntrl) == MHI_EE_RDDM) + goto skip_mhi_reset; + dev_dbg(dev, "Triggering MHI Reset in device\n"); mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET); @@ -495,6 +499,7 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) } } +skip_mhi_reset: dev_dbg(dev, "Waiting for all pending event ring processing to complete\n"); mhi_event = mhi_cntrl->mhi_event; -- 2.7.4