Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1447240pxb; Fri, 6 Nov 2020 09:49:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJywfqDl7wZvr0UAbUcgk7/nq5KkO7hFkYebxFxDFYT3jtSRsSz3TEvaU2RKFWZ2J/ERE5Mt X-Received: by 2002:a17:906:52d5:: with SMTP id w21mr3058252ejn.464.1604684986756; Fri, 06 Nov 2020 09:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604684986; cv=none; d=google.com; s=arc-20160816; b=Id4i9MkWng5PyEimQLwsU/9BkyIbdTNzfrYnwITxGBTk+6oR9Tm6F9tCiBlhGbTsH1 yTDft5X0JLlGsb37rr3meq9mPk2kdfZbyrKvz/+gBs07icxMLMQ5XapViU5xC5aN7X4C I8R300BiYDTwh27qmy1Hj/Xps3ld+twroUDC4nKhjCnN6O+O7ov2olLHXpXe9MVgZWXO kc+VNYpoVNEPb0Y3eu85PGrv712pHUDr7iuic9Rqsth9Ib/iqzG+vDDDb8gHtxovOkPi v7YzFlmdfkJSrEXUXTifptQc9QG8RJ4EclApn6BfPUAx28tyzJA4++AROG1f9zDnNuzH MmjQ== 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=V4CHFKR34/uZIWbAcGq2ffwz+Zxr4xVWl+nmSBXtrsU=; b=Lz8C4J7Oy+5+whuVPcuXn1ZNmt/XuuoEjAv5hdA8H0XWp4Ein4hsq7M/nzOCAISPtf rrkcSywv4KGGmQWRlgksZyrMYnC0eudMGaqNRdTNYqv7qxrZ5l/L+Ab7sxOGXqU93D9S cY6/e0pXEbwLw27dQNpcHOLiqU1bpivoAUkjQsPhyZ4JuMnMAT1VsyITd+QeSsoSF/0J F3k1CO6oxPHgaP2BsAWbad9ONhIeSJdj+ZbzDvS/leVFAA5lWvjNzlaZR5/4qTkkZ1Fq /hrokHrRZ2mSSmSOL2lPCoigusWmufL7qReqr5jnR466xVS5DXoeQFXQ8yUMjSqeV3lu 3cqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Z3woHTPc; 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 j19si1386324ejs.634.2020.11.06.09.49.24; Fri, 06 Nov 2020 09:49:46 -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=Z3woHTPc; 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 S1727855AbgKFRpW (ORCPT + 99 others); Fri, 6 Nov 2020 12:45:22 -0500 Received: from z5.mailgun.us ([104.130.96.5]:33020 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727679AbgKFRpC (ORCPT ); Fri, 6 Nov 2020 12:45:02 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604684701; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=V4CHFKR34/uZIWbAcGq2ffwz+Zxr4xVWl+nmSBXtrsU=; b=Z3woHTPcqPifsTFLUoJQW2CX615DD+WNJ5x39tcY+oOwcZYtb9vId44zzeiX9RDOZf9jJwgD bXxxbICAqH7k3KmvLq3tHaSShSbwIKhVZJnkmrcQ180+UwK40Jt2SuN2u115d3Z2BtGkDQ4g G13fkV8PLBpgr7BOSTvnHZk+iZY= X-Mailgun-Sending-Ip: 104.130.96.5 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 5fa58b9d51f9d6623f4c06ab (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 06 Nov 2020 17:45:01 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 19EA1C43385; Fri, 6 Nov 2020 17:45:01 +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 5D8BFC43382; Fri, 6 Nov 2020 17:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5D8BFC43382 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 6/6] bus: mhi: core: Skip RDDM download for unknown execution environment Date: Fri, 6 Nov 2020 09:44:50 -0800 Message-Id: <1604684690-31065-7-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604684690-31065-1-git-send-email-bbhatt@codeaurora.org> References: <1604684690-31065-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/bus/mhi/core/boot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index 16244cc..6f0cfb9 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; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project