Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1626274pxk; Fri, 18 Sep 2020 19:05:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzScFdtJvWzZpub1EwywshHCcq13gxxXtmR01oDfkacU1NuQbl2ZmXl4nISgPqSqBl4+aAF X-Received: by 2002:a17:906:b784:: with SMTP id dt4mr41055828ejb.376.1600481113233; Fri, 18 Sep 2020 19:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600481113; cv=none; d=google.com; s=arc-20160816; b=Yh6yu5KjcsaSJXHpfdgWOV/TRvgj7/1QubBw7UapHw8uC6gEU0la9TPZO33yWZEX0m NmIrvOm9FqR4dnAavjRDNpVPntjW/ocYLexyIbStrQSbBileVHnRg/w5fWKZqlpPQ2Aa t1SzQ2kNRhyfAMUEvE1Lr1V8iPvFStHNopiba9a+uhCgczcgEezap8IV/sthnIEXfiGx WsRSAKH/DltUzpLbOkJDyolT3SGLhBnqsFz1+E2NzhZVxANjHGEp2c/9568CXMYHtkA5 772Tm5UGDDGFXevdJ/4rDwDE4xo+EFLdHmCUcoRmB77k1FY5Wl1SfCzRt6CxyWCRTKaW JzkA== 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:dmarc-filter:sender:dkim-signature; bh=cRcGwkQSVTHEDXa91ckMmY9qCdNq/tuh96PqZPfubRE=; b=YmYkFX3Rnn+sAU6X4aeKUOtxp1RMUTkjBvpk0SdcU5C7lcLf10W1P13OkjO6iw2P1H gvw5SDRjGAdlU0jBCIXrCwBNbtiqRFBKWhCd+hBBRLi8LiloZiplzcrXnik05XeHRVtw libBL2vuXv5RwOsPAMd4IERcIjX6Q7YgMvXrmGFAP6zyNeLVp+no+6PbGIFqvA0iMGuD m04KcDj65AfgHYNrN7mMq7T4IvSZhi7pamqkidsLx/q2wFQMayQK2yQwWQ6nLoEiPdBO u0JFo8o9OtzPSTU+IDBF8JBlnWK/NIJTP5RUMjpXu3itxCtlIBANHnTDH4h+oJnfyrhx akgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ZXy9new3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si3383905ede.201.2020.09.18.19.04.50; Fri, 18 Sep 2020 19:05:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ZXy9new3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgISCDI (ORCPT + 99 others); Fri, 18 Sep 2020 22:03:08 -0400 Received: from m42-11.mailgun.net ([69.72.42.11]:55682 "EHLO m42-11.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbgISCDD (ORCPT ); Fri, 18 Sep 2020 22:03:03 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600480983; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=cRcGwkQSVTHEDXa91ckMmY9qCdNq/tuh96PqZPfubRE=; b=ZXy9new3iB2lkqO7KpfkNR9iU/yYaQFZWQGz/qAxG9zDMn/GevtCssf0HTeyihBLsBAf57QW baDyR1UcVvjN+pSiTk9BF43tRVAoAXLPmFTxnho2eqEsQS126mBigFcQM+9jUGWc05+9wB0A mERQw9huHGukxkF6UZHdtqpFKI8= X-Mailgun-Sending-Ip: 69.72.42.11 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f6566c90915d303577050bf (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 19 Sep 2020 02:02:49 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B9AE3C433CB; Sat, 19 Sep 2020 02:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id 148E2C433FE; Sat, 19 Sep 2020 02:02:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 148E2C433FE Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v1 09/10] bus: mhi: core: Move to an error state on mission mode failure Date: Fri, 18 Sep 2020 19:02:34 -0700 Message-Id: <1600480955-16827-10-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600480955-16827-1-git-send-email-bbhatt@codeaurora.org> References: <1600480955-16827-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the host receives a mission mode event and by the time it can get to processing it, the register accesses fail implying a connectivity error, MHI should move to an error state. This helps avoid longer wait times from a synchronous power up perspective and accurately reflects the MHI execution environment and power management states. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index bce1f62..16c04ab 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -384,10 +384,14 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl) write_lock_irq(&mhi_cntrl->pm_lock); if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl); - write_unlock_irq(&mhi_cntrl->pm_lock); - if (!MHI_IN_MISSION_MODE(mhi_cntrl->ee)) + if (!MHI_IN_MISSION_MODE(mhi_cntrl->ee)) { + mhi_cntrl->pm_state = MHI_PM_LD_ERR_FATAL_DETECT; + write_unlock_irq(&mhi_cntrl->pm_lock); + wake_up_all(&mhi_cntrl->state_event); return -EIO; + } + write_unlock_irq(&mhi_cntrl->pm_lock); wake_up_all(&mhi_cntrl->state_event); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project