From patchwork Wed Dec 2 09:41:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 335959 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp777927ejs; Wed, 2 Dec 2020 01:44:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+gK7oVgTmmIHbYd760+zQ02qsmwFfCIB2ONQFomJJGfg1B76Ii2n1vJQp2VEb8KbNYtaX X-Received: by 2002:aa7:c558:: with SMTP id s24mr1768365edr.257.1606902296229; Wed, 02 Dec 2020 01:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606902296; cv=none; d=google.com; s=arc-20160816; b=e5YYubiS6oTputfuCf37LO8FeKyXWcPJMr/5S8a+PxdqILZPz2Dol3d1MTP4W/NNKY BWYn8Lq26MqvTltmw08OtkGrp4uKojChJRrlUpcmvNNQNRhzxq9w1Oqh3PlMYWoK3o3e yax9L+DHycRmO8NIlWYLC3uYhQpexScv34uGxrWIeZhL6tOr+a9mRXdeKDFLCYsi7itn 8SUN/1cXQUkbPfhJWzQidQrW7v2J82UGzHsaiyUiHaDawe+0ZuOdz/TKQYWKyLnosUW7 HnR3BQ4nUigqCF1KSilZoXsts3eJ8+di5b22+7YOHxhcfMruMChXBCyyGOaGu9XNqYfc xQAQ== 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=As+64t4In9qgfO6oiaQfB+CQCXZv+hCjtZ0HhYLGPu4=; b=RV1pGQv3fT9fIzpo1wUc2ovIhq57xFPhL365VaTdV5tX7fSKgvM8JQzGrn+f0eseTQ /WeKD6s3CXOfaMlKBfO8RLuxc9vh9Nbjw3eHvlSlG0UhfISaY338vJj53/MoA5ALLvqU XmHwJECFqORXNsnOBuHbObMQOzDEtqMfWHm6yoxzYqyBhylfmfEu05LHdAFygwvj83OT FUo+2jLXFIEGVvGjHcRNt6aXqcDMW2RCOxXDQg9SxDaQMzK2I8IdeyEHBP44nhBGa8hr AzLD3HN7cWIS+0iJ3Rd6EF0cNT/uyzqocoqlTe3MxCWxqucTbQ1daTPIVjynHBD2gRRk ofbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nHfys83G; 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.55; Wed, 02 Dec 2020 01:44:56 -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=nHfys83G; 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 S2388531AbgLBJod (ORCPT + 15 others); Wed, 2 Dec 2020 04:44:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388552AbgLBJod (ORCPT ); Wed, 2 Dec 2020 04:44:33 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B91EC0617A7 for ; Wed, 2 Dec 2020 01:43:14 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id t37so751680pga.7 for ; Wed, 02 Dec 2020 01:43:14 -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=As+64t4In9qgfO6oiaQfB+CQCXZv+hCjtZ0HhYLGPu4=; b=nHfys83GpKTfu7SddXUVTvpPDZ29CmUwRuWoieNCtEPlo5MQbR/JT/Ja3uw4zBYu6u WmI5zSwtECGNAJy1QMmYmfO7MSpTwd5GRHCfWfjPg7+7RCdS4VtfIezZjoFvzsvtqLuO CyYgqnqJ+71LDwrgEOJy+4nrmSoR4aKE5Ali/yLsgPKgpHP8XzsIx3zC58JamYaQZZnD Z45Aa1fHE+q/gXnkjli415odxozqBY1XZxpdblLpYUcyFKuTptwPOJRor0w34GrniwDZ uHq1GoA5ODIRduQGSb+GvESMHGjtp6VKlLen9pDYJMGNE1v8sAlcQaXddVkRVuimZCOZ GcGw== 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=As+64t4In9qgfO6oiaQfB+CQCXZv+hCjtZ0HhYLGPu4=; b=rJM4J/9m8ekmVeeW6amLcBYMcbtEPm//kwb6tm2/aNJlU2YDrY3kTYBPlr/xw0df4R 92FCibk8kDZFon0JVmWT6kK2ExzCYUPXZcgHpb/R142JVttoR38CVtLBCxqBVC+DDLQy 6z5DdibZ+cUz/WYrGRUkLRXv1KOEIEixsH9uWiWiTGjXG8NcDxHDHfJkd4aza5KqJN9n xoWHqCtPQKN7YRsciGUzjalT5P5IMQmQ4zhObvANh+L5mWEpp/amFn4b/QfmaCDORw5B K65Usb7uFahgZJ0mIILC4SI1a4yO0fCMZE4ZsOLRk4ntzRrPzSpRafVkiBctOVOWN/93 ekcg== X-Gm-Message-State: AOAM533VpRl8WPAZtwebR6KYhe9Xld6XS9wwL09/eBC911gQSnAlhWzV 23O+V1yBGU7VwiE6KBb1nmim65e+CrYp X-Received: by 2002:a62:8705:0:b029:198:22e5:adcd with SMTP id i5-20020a6287050000b029019822e5adcdmr1769218pfe.74.1606902194040; Wed, 02 Dec 2020 01:43:14 -0800 (PST) Received: from localhost.localdomain ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id bg8sm1393990pjb.52.2020.12.02.01.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 01:43:13 -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 12/29] bus: mhi: core: Skip RDDM download for unknown execution environment Date: Wed, 2 Dec 2020 15:11:42 +0530 Message-Id: <20201202094159.107075-13-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 MHI is unable to determine the execution environment during the panic path, host must skip the RDDM download. This can happen if the BHI offset read or the BHI_EXECENV register read fails indicating that the underlying transport is unresponsive. Hence, there is no need to trigger an RDDM using SYSERR or request an SOC reset. Suggested-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/boot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index 16244cc8fbe7..6f0cfb9922b4 100644 --- a/drivers/bus/mhi/core/boot.c +++ b/drivers/bus/mhi/core/boot.c @@ -92,6 +92,9 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl) * image download completion. */ ee = mhi_get_exec_env(mhi_cntrl); + if (ee == MHI_EE_MAX) + goto error_exit_rddm; + if (ee != MHI_EE_RDDM) { dev_dbg(dev, "Trigger device into RDDM mode using SYS ERR\n"); mhi_set_mhi_state(mhi_cntrl, MHI_STATE_SYS_ERR); @@ -139,10 +142,12 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl) ee = mhi_get_exec_env(mhi_cntrl); ret = mhi_read_reg(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, &rx_status); - dev_err(dev, "Did not complete RDDM transfer\n"); - dev_err(dev, "Current EE: %s\n", TO_MHI_EXEC_STR(ee)); dev_err(dev, "RXVEC_STATUS: 0x%x\n", rx_status); +error_exit_rddm: + dev_err(dev, "RDDM transfer failed. Current EE: %s\n", + TO_MHI_EXEC_STR(ee)); + return -EIO; }