From patchwork Thu May 11 02:33:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Yu X-Patchwork-Id: 92350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4078221vqo; Wed, 10 May 2023 20:17:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62ovHwrORtNDdVUUvMI91xPWJJKP9LZvhXbV1a2itrbsbBqFfRQtohfT53gdQoe1EyGI87 X-Received: by 2002:a17:902:c946:b0:1a5:22a:165c with SMTP id i6-20020a170902c94600b001a5022a165cmr24693394pla.0.1683775071598; Wed, 10 May 2023 20:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683775071; cv=none; d=google.com; s=arc-20160816; b=Yrnk7sJIJ0mR1hiQzVRHW6gvG0QDYo6Kzpwgd1Rxz0UEtQ4f6EOBsswUoBjvEM0cZ8 QadhkQIcMBR61miJJ/SU3Oj0UcRHQwLJ8mlHazkEECYrVGRAKl64kOJ9ZAVkbtZFVcfK lz5wPM63g08FKKmoCRoEOA1Rq7U78vNj/Vsut/SmmW1RHY7xmXRRGLpY4NyaEeuIw67f hsz4m9AjD+DOw5twjo0RYuM0G1iAaiHAZ5W22kX3D4tkFvx7n9qcIZEyvIctpDbwm0Ai 9ZVGjyG5WIN00PcvVT1X6wl3Z3dvkoXxwmSY5pksDiToos4mai0w8lgOWHv1TSyl3WIh c3og== 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=4AA3n98gc9v+2QvDZFHA07an/528pf8iT9/Hjg3vocs=; b=gox8bazA5yZ0oGHhP5DV0bubgN1juVcrwzmIDdsRjuE8TGBtL9qLIBKP7895UxXjcv kUxPOrt6m+WPq5NHWmFmwnlEsdHmqUEktrVEzsP/QCOgyIIylYVkVxAzyMpf3hnxYeLs RGt4ATyiLE00o8ILjESwjg7KmU3Q51+br3RUA8hRka/OXXRF/CMXEDnmtkr360GWbpL7 +YYFyFQtreBF1t3hQLhzQ+gwZPfdCgT0b8gYndh1OaQazIwpr+6UFLp8KxhIo+HiBgN+ xzh9bmd64xBNmsM7uqtc6L/s5HZ24g/XxTlOS0B8r9Xb2baEy+e+kFCeLCupNc8Wvo+I x1+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=niFNWGRU; 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 ba1-20020a170902720100b001a80c0abba4si3028488plb.184.2023.05.10.20.17.39; Wed, 10 May 2023 20:17:51 -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=niFNWGRU; 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 S232030AbjEKCdl (ORCPT + 99 others); Wed, 10 May 2023 22:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEKCdj (ORCPT ); Wed, 10 May 2023 22:33:39 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85CA1136; Wed, 10 May 2023 19:33:37 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34B2Helv012689; Thu, 11 May 2023 02:33:30 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=4AA3n98gc9v+2QvDZFHA07an/528pf8iT9/Hjg3vocs=; b=niFNWGRUI62FKX7ps1HYILcaVLoInC6Iqvh4ZJnknTs+MBmbZl9tt9bZQYqVYgEKg/8Y nuPjJhoBMVy6syOl2zzr1L1EZejEtUy3eLz6T0kOF9xvN4WmwC6zUFFDBYA2HFNbBE8M g0spYXzbV5UW15BDM9PcYYWP6XjytjTmEds6kY8lRZfRLAUHD2duJbyN4NUyr6aH3D9J 0XXX9r+LtlMji9MFBYSJHxKI9ACa2Qpw8I45y0IjHK8PzW0Ku6ZsFKOdXliNEGNYu4bn fpusOXIc9u2ouWps5dXNZ+eyhqrEBbp6y9TC2b1qiQQTRzFkPst0wLygVzEZcY7TykIj Xw== Received: from aptaippmta01.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qgett0ygd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 May 2023 02:33:30 +0000 Received: from pps.filterd (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34B2XRJV005797; Thu, 11 May 2023 02:33:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTP id 3qdfykpm2g-1; Thu, 11 May 2023 02:33:27 +0000 Received: from APTAIPPMTA01.qualcomm.com (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34B2XRUw005792; Thu, 11 May 2023 02:33:27 GMT Received: from cbsp-sh-gv.qualcomm.com (CBSP-SH-gv.ap.qualcomm.com [10.231.249.68]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTP id 34B2XQsF005791; Thu, 11 May 2023 02:33:27 +0000 Received: by cbsp-sh-gv.qualcomm.com (Postfix, from userid 4098150) id F16EA4639; Thu, 11 May 2023 10:33:25 +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 Subject: [PATCH v2] bus: mhi: host: Skip MHI reset if device is in RDDM Date: Thu, 11 May 2023 10:33:24 +0800 Message-Id: <1683772404-13192-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: S-Q3QvP_uH6CUecUqShdrrYw_48JD0xv X-Proofpoint-GUID: S-Q3QvP_uH6CUecUqShdrrYw_48JD0xv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-10_04,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305110019 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765566129562888259?= X-GMAIL-MSGID: =?utf-8?q?1765566129562888259?= 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. Fixes: a0f5a630668c ("bus: mhi: Move host MHI code to "host" directory") Signed-off-by: Qiang Yu --- v1->v2: use ~75 columns in commit text, add Fixes tag 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;