Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp924944pxx; Thu, 29 Oct 2020 18:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQxouICtOSJCz68dd3YdEBoYsj0OXgikefZHJH7OgBb9STe14xW2vh5ON0bubFDc4EEXoQ X-Received: by 2002:a17:906:934d:: with SMTP id p13mr213010ejw.245.1604023053255; Thu, 29 Oct 2020 18:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604023053; cv=none; d=google.com; s=arc-20160816; b=HPPTsvReZKDTNYyT3VwN+a56tkJRp/8zLU7kFTrfCmKO8DUUpCmTaaxZdjAi9lQ6fb dmnrdTV4HTWBqDzUPozVZc3Jb+Wtt0OUSADKn0NhqAGUr+VIsyytH3clFqV/7xyKNAQN qy4WOs28I05N8RxNfmUxnS8IZSbAw6QqA/lMJeMeR7dxLwDbdQNy9PKSaQIZGxdZ3t4l JYpgY3ch5MTRo1OGarRtknvSVUsdEmszwAqAJxMsbQ8nXsVY/EdoB/Vn3mf7yHhcA2AO pVpNJhlCE7Lg53vWDn3QGI27GJI3MMmETsGTO4pbAlkcWTvon4Q2pUWeNVrtY/5o5EAw NUHw== 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=xY4PN29k5L62PCzq2DaIgYzi1dFASbfPhjMQ9yHndjY=; b=NdUO775VCNQnZFBF0iJO5ivW26nVaZlCYTHO4NmUBbc9JvnNFhJDy/amR9z3bfl4lf mUBN+evGfM51g3Ys9jnApC0PTdPP43qZHf8r8RuZs+rftR5SQBDkf2s00N3Y7nLl+2vf SeI6pVhutxDjXuWGxJ2xH3Fs3ZKPR4c8m59ECnzbnjG2mo2WsS/Nhl2TGwaQUBExwxMs eKN8ill7aH+GzZRazdk9Uld+OlTHPW5LWDSx1CEVuGiqPuS/W7THj9fOtG28Z570hJ5I Y9k+hSStLtorTsVLlvL6wpHB4kMgYZZOvIHNz3bbCEXrKcKXZsKMUuCnxGpybqL2GpDM Bq1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="TbI0V/IY"; 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 a3si3392986edn.132.2020.10.29.18.57.11; Thu, 29 Oct 2020 18:57:33 -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="TbI0V/IY"; 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 S1726306AbgJ3Bw6 (ORCPT + 99 others); Thu, 29 Oct 2020 21:52:58 -0400 Received: from z5.mailgun.us ([104.130.96.5]:46913 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbgJ3BwN (ORCPT ); Thu, 29 Oct 2020 21:52:13 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604022733; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=xY4PN29k5L62PCzq2DaIgYzi1dFASbfPhjMQ9yHndjY=; b=TbI0V/IYjt9x5ohb4msHgbOgQFl8iFCj8AmoK0aizi2qIGuRi+4zObH1ZX9hpBxuvi+ipHKc 4pNDYeVOuudD9PWwF+QmAGHwHTuc12AS7n2C/Dj+bC0V3O4BmuJeDRm2d5Vt3xbxzZEmYScJ LzFw7oF9OnwG7Vq7vwLrP0L83/c= 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-n06.prod.us-west-2.postgun.com with SMTP id 5f9b71cdc3d7c9858ad1405f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 30 Oct 2020 01:52:13 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 06FCEC433CB; Fri, 30 Oct 2020 01:52:13 +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 5C8EBC433C8; Fri, 30 Oct 2020 01:52:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5C8EBC433C8 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 04/12] bus: mhi: core: Move to SYS_ERROR regardless of RDDM capability Date: Thu, 29 Oct 2020 18:51:55 -0700 Message-Id: <1604022723-34578-5-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 In some cases, the entry of device to RDDM execution environment can occur after a significant amount of time has elapsed and a SYS_ERROR state change event has already arrived. This can result in scenarios where MHI controller and client drivers are unaware of the error state of the device. Remove the check for rddm_image when processing the SYS_ERROR state change as it is present in mhi_pm_sys_err_handler() already and prevent further activity until the expected RDDM execution environment change occurs or the controller driver decides further action. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 2cff5dd..1f32d67 100644 --- a/drivers/bus/mhi/core/main.c +++ b/drivers/bus/mhi/core/main.c @@ -733,19 +733,15 @@ int mhi_process_ctrl_ev_ring(struct mhi_controller *mhi_cntrl, break; case MHI_STATE_SYS_ERR: { - enum mhi_pm_state new_state; - - /* skip SYS_ERROR handling if RDDM supported */ - if (mhi_cntrl->ee == MHI_EE_RDDM || - mhi_cntrl->rddm_image) - break; + enum mhi_pm_state state = MHI_PM_STATE_MAX; dev_dbg(dev, "System error detected\n"); write_lock_irq(&mhi_cntrl->pm_lock); - new_state = mhi_tryset_pm_state(mhi_cntrl, + if (mhi_cntrl->ee != MHI_EE_RDDM) + state = mhi_tryset_pm_state(mhi_cntrl, MHI_PM_SYS_ERR_DETECT); write_unlock_irq(&mhi_cntrl->pm_lock); - if (new_state == MHI_PM_SYS_ERR_DETECT) + if (state == MHI_PM_SYS_ERR_DETECT) mhi_pm_sys_err_handler(mhi_cntrl); break; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project