Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3500101pxb; Mon, 9 Nov 2020 12:52:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5S1IvuxdsLEkLMXpPTXt7ouuxEbfzr2NVBQ+KSVqryvVyULch3zkokMQOW9iol/XfKGdV X-Received: by 2002:a17:906:4c99:: with SMTP id q25mr5095717eju.67.1604955160171; Mon, 09 Nov 2020 12:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604955160; cv=none; d=google.com; s=arc-20160816; b=Lx0PJ1+jk2M3SrY3JMi9RjGYYbdPh3Tqm3R27jYwNUtioL3YghOknkp1Otub/eA5eC 0S4+2Jz/X5saYzLQTPpO2tVGjIHbtepPdgc6EFL2KYcdmY8uoXjn+2/LgNFhnV16mEEp xTpKh56TuuytqLIBIEZt8vnBwirl2lrKS5XloImkkg8n/LUXEuZk5aAxiiJdZH2zyTmR PYeZdiMymqYEUtVLXNWOPcT1nztPYMpsFbvWibUA1YRIBXwho6IPKWc8zxum6+pqoI3Q ELeM01VPdRts/Rh3TANpdi5y4qj+s7RoH52/8qb39R483zQxafc08oQr57EWMtXKYhiL LkKg== 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=sG+Hz7q1w0f+xVvgAmIqgk5pLO8+fZGC0xGXb78HCWI=; b=D+Cvnpu9F7GDu1QLizQddD5XeVC/6+PU65RlJt9pxH1csmZqqVvOjTirIDGNTIux8u S8ZtGP+5ZujqgKqsXdRvxpJ0GMqHiJ2IT1wDkKgXm5Qaop7jFaQb0qrxbQxuMDmOS54L 7ZfPposQ6TTKWOcEPHrrPx32p/g8zbd8+Y5a2OaniPErDNbjkbOVeZqv7bFbNHa7hB35 M6bXOqzGEN69f3zDQHTIUvD/n0UWaf3r3ltV+ojIAga3vG4479Z7ObGvFiWzJNkUa8Bn mABaWbEJJISbxfGboe2yYXiAHsFXoWayW6n97gxw+gp1ys35maSJklucCsS97onwLLTn 5nvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=H3dcbPfM; 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 v15si5472721eda.117.2020.11.09.12.52.17; Mon, 09 Nov 2020 12:52:40 -0800 (PST) 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=H3dcbPfM; 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 S1730187AbgKIUsO (ORCPT + 99 others); Mon, 9 Nov 2020 15:48:14 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:48366 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730482AbgKIUrp (ORCPT ); Mon, 9 Nov 2020 15:47:45 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604954865; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=sG+Hz7q1w0f+xVvgAmIqgk5pLO8+fZGC0xGXb78HCWI=; b=H3dcbPfMRWY9MJburjz1/V7hbSQ1jNR8r9rWIRRs/v5oWwKxl4CUvuy5RP96wSs7d34//F8c Qz61iVEktZEmSEKlCmLtlsz4Rf5irIjxyl0KQfScyHKETrFJotn0fihwfLFEuGiUPlzOa/Aa WVupe1l1zoRwORzoDXmCM+I+4P8= X-Mailgun-Sending-Ip: 69.72.42.4 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-n06.prod.us-east-1.postgun.com with SMTP id 5fa9aaf0f8c560b580a21b3b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 09 Nov 2020 20:47:44 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2A475C43385; Mon, 9 Nov 2020 20:47:44 +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 61DAFC433C6; Mon, 9 Nov 2020 20:47:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 61DAFC433C6 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 v4 08/12] bus: mhi: core: Move to an error state on mission mode failure Date: Mon, 9 Nov 2020 12:47:27 -0800 Message-Id: <1604954851-23396-9-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604954851-23396-1-git-send-email-bbhatt@codeaurora.org> References: <1604954851-23396-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 Reviewed-by: Manivannan Sadhasivam --- 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 0299196..06adea2 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -383,10 +383,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