Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp923901pxx; Thu, 29 Oct 2020 18:55:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysyFrMk6CT44bWZoHm18SRBPdYdYkyLfU7nLGbDnLNRzwbIp7AH/Oh+ZU9HnEOeCBLmSvv X-Received: by 2002:a17:906:f11a:: with SMTP id gv26mr244607ejb.376.1604022914752; Thu, 29 Oct 2020 18:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604022914; cv=none; d=google.com; s=arc-20160816; b=tJx7MowjYJ24DrxXTCUbf7AwKuMtU6iDFWU/sU3b0dKdMd8BCzUHoGHOiIKUqvTw5I ATJwZFw+vp6jORNVqIPqAZ54bWOMmMSaq9bbs1xLTadTeKi+DNKQIHSrIBoqZiJBqQNk 71elJDkba/F9kio2/LzHJtMKl1kVVWv49cfhLr14PCC1pBVdQAS2vIKAFENtleQnXz5/ 0rHDeINAYbfRBAZINs0Vm8mud+3LRQD53G/BraWcbt8Mmi8G0WfNT7Jk1OE4XFVklQOb EzXSnetJHUZ2GehJE860hPXgFWCuZ8Y+h/Tx7XYQ9lQVI0A/S+a6euowprTuqCO7t4Il +s/g== 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=QwR9X2BZ9HTQSsx1ZqIfkQrMmqJlHonHvr94GgrtqSIfPXcYjiI6mXG6EpWuj3DTcw Nd/robxmiiCa4XkOCj8Uqd4qh5WbJH+RxQqijcd4hnbN1PBzhiHf3jpBbaQ43EBMNmig VLVXGtKypZNu9jF0tZqIwCxw0kZbMSVOLcKygXrWHIAjU9jtPfunJKrN50RpzgJMBpwX VgJwNyyPhXotf0cMHwdWv1eza3Fktd7toBKI20A5Xuer1q1GsHzcs0K3ARd3rUteHZhH xM3u0orHLL5XjL7vgn4SuCQ9dI1h6XBXpIO5uc4cldo2I5tzkQCFbV2u32+kYLAw5tPW bxzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OyEkHQiq; 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 g15si3257043edy.58.2020.10.29.18.54.52; Thu, 29 Oct 2020 18:55:14 -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=OyEkHQiq; 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 S1726214AbgJ3Bwo (ORCPT + 99 others); Thu, 29 Oct 2020 21:52:44 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:15865 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbgJ3Bwm (ORCPT ); Thu, 29 Oct 2020 21:52:42 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604022762; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=sG+Hz7q1w0f+xVvgAmIqgk5pLO8+fZGC0xGXb78HCWI=; b=OyEkHQiqmlW9fvPizHHWQUS5Zhs3cHdigYGpHog+I/ZyFprrTBf0DIvJQUTI7DOZtmCpxAnm lDe0kQG19ymb/wZJa/7ST/uTZEqyYSSAvQAdWUQZBwbm2Ax23adn+v2+7xAFKhUxjC4lE9g/ Kk3IRht+aGnxK+FcG5gwKiQGuZ8= 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-n05.prod.us-west-2.postgun.com with SMTP id 5f9b71cfc3d7c9858ad1429f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 30 Oct 2020 01:52:15 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4E388C433C9; Fri, 30 Oct 2020 01:52:15 +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 6C5B5C433F0; Fri, 30 Oct 2020 01:52:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6C5B5C433F0 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 v2 08/12] bus: mhi: core: Move to an error state on mission mode failure Date: Thu, 29 Oct 2020 18:51:59 -0700 Message-Id: <1604022723-34578-9-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604022723-34578-1-git-send-email-bbhatt@codeaurora.org> References: <1604022723-34578-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