Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp743604pxb; Mon, 8 Nov 2021 22:39:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyENt+k+kT9mRsAnvCislCK2YzOaq4GBKZxcaFkOo9w6umOITmo6EAW6FYDZa4TffLpy9s0 X-Received: by 2002:a05:6402:205a:: with SMTP id bc26mr6892159edb.119.1636439962389; Mon, 08 Nov 2021 22:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636439962; cv=none; d=google.com; s=arc-20160816; b=fKqXcW8/M34BG1suHa57KRM2YLt1QCpn9BmfhOMKmZDtst1ZCkPc6GGSTF0UkNeEPQ QGVeKCBsvhjflBU85CSxHQzln+W80rvP/+Kx2M0QWEx47fX5Ee8mablFryJzEuSTUOLl LAR85wni32mAEVaVF+rUT9UCqw+KH0WeXAGQqh5FNrb178pnY8DQPYgOymdZtnQK2LI0 GNeNPlOqnxjI6xzDzUYSS0gahptYGPBOQ2iM6jkBb9PLXsNUh/ChGTEs1AVVexsRumVY RR1bZjwwemi/w6YBmxLjjKxNI8/PWDCB4cbMSv0We4J88pgSg2mLlmY7CvHQsKgR3I+M U/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=OVbAu503m2OjDJ+olw7/qCqtm3SJRr6hxHct9Rj2XTM=; b=iJ5VNTZF0h4b9ws9ufhPblqM2LD8Z/7YoR2DVeJsKPx4s+gHMfKSQ9KyblFJcINec6 mzJxXWIjDTXHAat657JJuJnjRiq7CuLGTVHK04o+821tmD+aOy+voclOYlvePlXRNwte SQpVQdgzoRJZQgbwwFycMXS7QRGHn62h2iOnFXPnATteA7aKiqlYScrv95DKArZzSCeA cMHHfohayj4fgOlcvQAsNqwr244yCwC97LiUsjPqBLbP5uTIhEriAnzrI8buET5l7B77 wBt9etE6iuC3fUWIzpRSlHH5hBlk3g0c4UQzU9SkSzz4Mh/+xLURB4TwlJiGMkHOmwHi nMXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="o0PZ/K//"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si11979411ejz.261.2021.11.08.22.38.58; Mon, 08 Nov 2021 22:39:22 -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="o0PZ/K//"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239555AbhKHWWb (ORCPT + 99 others); Mon, 8 Nov 2021 17:22:31 -0500 Received: from m43-7.mailgun.net ([69.72.43.7]:20034 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbhKHWWb (ORCPT ); Mon, 8 Nov 2021 17:22:31 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1636409986; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=OVbAu503m2OjDJ+olw7/qCqtm3SJRr6hxHct9Rj2XTM=; b=o0PZ/K//YU1AeswSBwBKXuLGraQZiNpOkPqLiUFk+cqj/OrV4jHl5rkrHCp1bzmek92bADaG Bkh7NhCGRRudd2xkE94mPcfJP7FtJHnHClhWGtO0qpFU9KzTZ4mdAUeyeiyisCO8fWKvZkTC Xsqcw/BG/o+U/1MOeLSa5qOiQJI= X-Mailgun-Sending-Ip: 69.72.43.7 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-n01.prod.us-west-2.postgun.com with SMTP id 6189a2816b778b5a19cf2308 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 08 Nov 2021 22:19:45 GMT Sender: quic_bbhatt=quicinc.com@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4D993C4338F; Mon, 8 Nov 2021 22:19:45 +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 autolearn=no autolearn_force=no version=3.4.0 Received: from vivace-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 DBAB5C4338F; Mon, 8 Nov 2021 22:19:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org DBAB5C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=quicinc.com From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, quic_hemantk@quicinc.com, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Bhaumik Bhatt Subject: [PATCH] bus: mhi: core: Use macros for execution environment features Date: Mon, 8 Nov 2021 14:19:38 -0800 Message-Id: <1636409978-31847-1-git-send-email-quic_bbhatt@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bhaumik Bhatt The implementation for execution environment specific functionality is spread out. Use macros that help determine the paths to be taken. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 2 +- drivers/bus/mhi/core/internal.h | 3 ++- drivers/bus/mhi/core/pm.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index 0a97262..74295d3 100644 --- a/drivers/bus/mhi/core/boot.c +++ b/drivers/bus/mhi/core/boot.c @@ -417,7 +417,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) } /* wait for ready on pass through or any other execution environment */ - if (mhi_cntrl->ee != MHI_EE_EDL && mhi_cntrl->ee != MHI_EE_PBL) + if (!MHI_FW_LOAD_CAPABLE(mhi_cntrl->ee)) goto fw_load_ready_state; fw_name = (mhi_cntrl->ee == MHI_EE_EDL) ? diff --git a/drivers/bus/mhi/core/internal.h b/drivers/bus/mhi/core/internal.h index 3a732af..9d72b1d1 100644 --- a/drivers/bus/mhi/core/internal.h +++ b/drivers/bus/mhi/core/internal.h @@ -390,7 +390,8 @@ extern const char * const mhi_ee_str[MHI_EE_MAX]; #define MHI_IN_PBL(ee) (ee == MHI_EE_PBL || ee == MHI_EE_PTHRU || \ ee == MHI_EE_EDL) - +#define MHI_POWER_UP_CAPABLE(ee) (MHI_IN_PBL(ee) || ee == MHI_EE_AMSS) +#define MHI_FW_LOAD_CAPABLE(ee) (ee == MHI_EE_PBL || ee == MHI_EE_EDL) #define MHI_IN_MISSION_MODE(ee) (ee == MHI_EE_AMSS || ee == MHI_EE_WFW || \ ee == MHI_EE_FP) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index fb99e37..0bb8d77 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -1068,7 +1068,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl) write_unlock_irq(&mhi_cntrl->pm_lock); /* Confirm that the device is in valid exec env */ - if (!MHI_IN_PBL(current_ee) && current_ee != MHI_EE_AMSS) { + if (!MHI_POWER_UP_CAPABLE(current_ee)) { dev_err(dev, "%s is not a valid EE for power on\n", TO_MHI_EXEC_STR(current_ee)); ret = -EIO; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project