Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp981411pxx; Thu, 29 Oct 2020 21:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaPEQpZbtkYl2JRBCpMcx03117JCo+CC9sMoNmcxmapUu+18pEMQCo2Nszcs5WpYlS8RAX X-Received: by 2002:a17:906:c094:: with SMTP id f20mr628503ejz.550.1604031175989; Thu, 29 Oct 2020 21:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604031175; cv=none; d=google.com; s=arc-20160816; b=kJrG4aARm6tzaMBgErkQVnLgFSadNHS4bZn9JIx5Sp03ekIBVKfdrSGZfAuAwtdCOK mgbMGKBnIOFhNzJc+QJmvQg9kIqQXdSX8IXYPMJUGY9zM19VkMAH3GnzIaTfb2bHZR33 mk+HRrp/x15+aQ5lsTHRpp4QQ/oDvxuWve7YnLPW2Epa/GzCImXlQvmILwyM0xIwXaDj vw4Fm/pJxoUU+ncCZKFLuXTwnQL6Fbc7e1JJb4sm8vK3p9wbBWg/gFS+htioeMf73UCy VvJP8mkFyQ2nYaFAEbbEMhbA5GR7EnE2n0GnXUduxYWGVTtqtvtjEkQsLfL0J7AGm4Yb hqkg== 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=hjqldDKWsnPULPNQYcHPHF70i79Cgz+4TV0gpGuvnb2M0x5Ok6AO1B7ggKggJtoG1u EmFIR5V5hiKgrCqe19fMZB0A0wI2hHuCWULI29bUSKAki+wjH989SaZyJHMMr4U/j4Mo UMe4fVnZQdhIsHCEW5bLVlk+qGxte1R/sXO4S3aIHlK+xbZN+nLF6TGYtN/WVM5PYpiz zK0gRtFoFZss5s28aZR6EwKJZLdyNbCY13xGlTWZnlAlIQkkN0E33JWUThv4gBGnXVuz b0eBPQh/JrCF1UprjhJkZu/285QPLn5wbEHLpoBa4/22/Eko9DC2zY2Jro4mDMoodyqg 1D9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=rv7Pe4jA; 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 m21si3251191ejx.182.2020.10.29.21.12.33; Thu, 29 Oct 2020 21:12:55 -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=rv7Pe4jA; 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 S1726402AbgJ3ELJ (ORCPT + 99 others); Fri, 30 Oct 2020 00:11:09 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:10763 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgJ3ELI (ORCPT ); Fri, 30 Oct 2020 00:11:08 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604031067; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=xY4PN29k5L62PCzq2DaIgYzi1dFASbfPhjMQ9yHndjY=; b=rv7Pe4jA2v+K7qd3XchtQ3kQ6M39J1Y9Kek5p6/mvk75Auv6XbwVUyipL8YgVH0Z7atqIbuG 8N9JJGUvAItpcRDydQ1H5LKUVEJeF4TEIgBjx+17K/W0GwV1YgK9y7xuGqWlttppXZ4QH2Cw PoIjtFC0dq90oj3tGo9MrkUgeBU= 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-n02.prod.us-west-2.postgun.com with SMTP id 5f9b925b8335df1657a961df (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 30 Oct 2020 04:11:07 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3CD5DC433F0; Fri, 30 Oct 2020 04:11:07 +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 7570CC433FE; Fri, 30 Oct 2020 04:11:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7570CC433FE 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 v3 04/12] bus: mhi: core: Move to SYS_ERROR regardless of RDDM capability Date: Thu, 29 Oct 2020 21:10:49 -0700 Message-Id: <1604031057-32820-5-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604031057-32820-1-git-send-email-bbhatt@codeaurora.org> References: <1604031057-32820-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