Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2528850rwd; Fri, 19 May 2023 07:01:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VaYXgd94QWpzcVaSxqlFdu6GMnjqEKmYiP1hMa24dpTNCG6CU+Re9PyJt8tHg/Wi2Aq0c X-Received: by 2002:a05:6a20:7d99:b0:104:ecd9:a9f3 with SMTP id v25-20020a056a207d9900b00104ecd9a9f3mr2459124pzj.7.1684504864949; Fri, 19 May 2023 07:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684504864; cv=none; d=google.com; s=arc-20160816; b=FXea2oUmCfrbh2z8DQtcIrb/rozI+0F1FrQlNsAzIB0OBUhhe5taSMoDhL2Nytvxms aQXHDgnrrHM3YEXzcozx+mb2vScVNL3dGtXZi918TxZgCDSHqEHKJeExe/Uqc7R1brhZ riJP6uEfqZRdMnEXoZGK1xzKgbMvw5SrhmOGhXPvda9oG4gAe3H1PCGVKUjfErHU5uiD yQGkD2SVtdqEih2fdHz5W2zKazPZ5T0wZFP11qjRof61rmfENokfVwtdxDl2u052j12p EcvWl9vfwnN/yyyDmPounXY+EteC06mZiFjrmgwOgD9gYe6fv9KhGcxfA3d9K0/K8xYP 4r/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=scaKtR1yxIuLNzvcbqaTg2MSrVqvL1odRQFSFvoiPT4=; b=fjgxBKqJR5Hzx638kZ/Q9wfSS7R0R65iz5wH3wzpdRlUyrmSuX8KpqZ4Egtvbogwv9 0I1fPALn95NZbdki+TGMEkbIt8CM+QiAbrwKIeVbfgkFd8zcjkzV4eBVTOpJh/4JAWU+ rxy33DoLWpth5PEt4fXdy+9jVDo1QZg+L0Ue+dlRClYEgw5NyNMLdwXlyqRfB/MzrTGL Yxzj45sy7EAOqroLFTwCFBf5CcHfkTXZ7IUkUORx0jNl/22FGRQWqwfQw5YNA5oz/UjC G0WYTpcOW6nBTdnfUoCJGdkUR24VFVzn9Boc2OxKTHFmuDnccylVHHExcyZSKroPwm3Y 3UNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vG18ZPOe; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a63750e000000b00534913980acsi722817pgc.854.2023.05.19.07.00.48; Fri, 19 May 2023 07:01:04 -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=@kernel.org header.s=k20201202 header.b=vG18ZPOe; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjESNvu (ORCPT + 99 others); Fri, 19 May 2023 09:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbjESNvr (ORCPT ); Fri, 19 May 2023 09:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A08192; Fri, 19 May 2023 06:51:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C23C2657CD; Fri, 19 May 2023 13:51:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08C1FC433D2; Fri, 19 May 2023 13:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684504302; bh=WKlnm8UtxT+qYnvDF9i2Qq122VqGCiN1FomPmbhIJpk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vG18ZPOeNSniciRdpye/diDQF7VE35xTBCVDzW3Dk9q83g/Innsdha1pyX3aj3e5W n0JHvJGpJb+JR8RnuiKBZB5MUpqYO+Zpmjg8URHAamzLMGms3uarbdAQq7aN7QtgzE /RvqHV0ofuyLa4lGKila6YWQcV5Gpab6PAdpp90l1AEOWCe5vSwciWGrLN/z8COhyt gpPAVDiOYwkFvMi/n02Bi44t0aeeIF0NOClOSc0Z3BOVI39a7H9yLn0qQ5BwGf7FWW pI9hRwRZ99lKSMFSLyJAam8AxMDYdcxVKwMN6a8OjdLWWS4faWes5zHTPYKi3AeOHs l9ijf36zoOq3g== Date: Fri, 19 May 2023 19:21:29 +0530 From: Manivannan Sadhasivam To: Qiang Yu Cc: mani@kernel.org, quic_jhugo@quicinc.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_cang@quicinc.com, quic_mrana@quicinc.com, stable@vger.kernel.org Subject: Re: [PATCH v4] bus: mhi: host: Skip MHI reset if device is in RDDM Message-ID: <20230519135129.GA4843@thinkpad> References: <1684390959-17836-1-git-send-email-quic_qianyu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1684390959-17836-1-git-send-email-quic_qianyu@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, May 18, 2023 at 02:22:39PM +0800, Qiang Yu wrote: > 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) Do we really need to check for rddm_image? Wouldn't the EE check sufficient enough? In that case, the check can be moved to the prior if condition. - Mani > + 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 > > -- மணிவண்ணன் சதாசிவம்