From patchwork Wed Dec 2 09:41:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 335955 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp777893ejs; Wed, 2 Dec 2020 01:44:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzboJjqZBf0vwR2ZrgcYa3ZQ8RjATjvas2DdVU6mIlk9fGRoJfEtm6GLtMa1yRlLD3B8Sud X-Received: by 2002:a50:d8c8:: with SMTP id y8mr1747081edj.82.1606902293334; Wed, 02 Dec 2020 01:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606902293; cv=none; d=google.com; s=arc-20160816; b=sNbfZRVXgetkycF5/b8hYH7Hkg2wnyJVxgGCkd+/r7+4e/Bwm8jMVN69b8Vc8dLTu4 isVimMkq0k9ba/o87xkV/LqnPuUfIe3xEXvSVVjp8dz9v9eTYh7hKJ64oSp7j7IE5+6I QOxxUZUck7xu2+uvaLiQPDcjWnH9tauP4m2XUahK5syNT/paP+9LYRW9Wy2uQVIsaY93 A3vJN0aOlNfR2YCPHN4ZbdTUNvC1ijNpcZpCtI1OGyMLR5AWkbP2+Q/hKj/JeT6+Rfl9 1NcEeD3rYD9tfkKwxpgeBRsaBD52+1+xVy3UCOkAu07BVt8So6J7aXM9ooXr15nNNH08 rB4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aCsmJ1k49Ua8PjKSNyR1qR4vjZ+Bg7VpSSpGmvdAxP4=; b=D4fkoqsHInHVCLyxGbfWyS25u7mGXmkqHODxaieRPe8Xv+gWsGYmEH5svn4fep9j/L hJnIhbuY1yO4pPQE1Cc3OOTlsAdbXETaBNJ99M3sRJA4ZhSLeM5mj9LDHCDIePhEm+dW A/kaYjH1OeFHS7CgzCl3cFUdyjIC3RWQnTd1ID2n906XLf+h8Re9yZMYdRKIVfMXudPg SYAGldCRE0cYHwhiaE3PI+XjjNDqjWaqNZfYHLP0x5j5WImxvSP7uHmT7JZb4+81H4MR d05LUA4adWw+R8/MATxrBfMLATlhg6Hci820FtiLff+MPWtLib6CR+G+D8/DW82+wdRG ThzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iURQzayB; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do13si531726ejc.286.2020.12.02.01.44.52; Wed, 02 Dec 2020 01:44:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=iURQzayB; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388374AbgLBJo0 (ORCPT + 15 others); Wed, 2 Dec 2020 04:44:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728701AbgLBJoZ (ORCPT ); Wed, 2 Dec 2020 04:44:25 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F0AC09424A for ; Wed, 2 Dec 2020 01:43:45 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id v1so704127pjr.2 for ; Wed, 02 Dec 2020 01:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aCsmJ1k49Ua8PjKSNyR1qR4vjZ+Bg7VpSSpGmvdAxP4=; b=iURQzayB6DZcAa6cIYUASPN9FTCA/rrz22OrT9v/7F9lTCleMF4QmpQWCJKUdxeYb6 VZVXrz/e0pPSGKvrnswS0l3+fv9vvB/kLMUK4IekhjY9lNBv3o5dHs76bIXg4bZ6S348 l5Dq0b2z4bRJ6UigcPOdRLyow/h4T9Q4nLJOfaFNYiGp6gmYAKN9ukGjhQYimcsJE4WM TGU5Gmda75k6nJgeQ9PBfFweTYEBGbnWMls4tQ5Vvy5+ybAZ/lUB/Sw5Ioj7hmfKxbhX TPYpWhKWBlmn7MOZ0KwIPSDVummw0SjctlVWN73UojBkgVsCNdmUJxFV3wvS8bAPowx+ zp0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aCsmJ1k49Ua8PjKSNyR1qR4vjZ+Bg7VpSSpGmvdAxP4=; b=T0MyeIM2W4swkoajy1r0PQKTwv2ZiONMkDvA8bmbh8iRIvuMLJZcPkq4tcg7GCciyD bUYe/NOpf/71slpFrsNUdpU7MrUMaJAHkBh8Zur+4lbJshLGCDig/2cI13NWmVNfUx5P M+JliYWleaCjrSSn1B/7oMAsufbr4IAkaxUMLjAfCk8eG7wm+Pc7Pm4ojCEqwiWrGMw9 eVzI7AWgwJTt/rvdDQFyLEmBp6VuGRS6fyYE4hJK2PD/OvTQlff4Dw4n6RYO70E2KWDR lTHnDPRi1qDWLRvsldelzumMIxEvDzIiSTQTl5CiF/Ilph+MnvbANSLr+sXev4JKnGGI +NOg== X-Gm-Message-State: AOAM531Z7ppzhaeCdcSf50JezrRdFZ0JHjWrCKSFZBoB5xYPWIPbWwvw pdVDkRu7dBy3tmeNU7TQ5o7v X-Received: by 2002:a17:90a:7d0c:: with SMTP id g12mr1588052pjl.77.1606902225327; Wed, 02 Dec 2020 01:43:45 -0800 (PST) Received: from localhost.localdomain ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id bg8sm1393990pjb.52.2020.12.02.01.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 01:43:44 -0800 (PST) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Manivannan Sadhasivam Subject: [PATCH 20/29] bus: mhi: core: Move to an error state on mission mode failure Date: Wed, 2 Dec 2020 15:11:50 +0530 Message-Id: <20201202094159.107075-21-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201202094159.107075-1-manivannan.sadhasivam@linaro.org> References: <20201202094159.107075-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhaumik Bhatt 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 Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/pm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 029919647002..06adea2580d2 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);