Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp220877pxb; Thu, 25 Feb 2021 00:12:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+3rJdye+S5LG2P1lGs+NZF6x2fi7cAZrgOtzhQFNY/6UXtfgdTZdLe8htqgNIGyIcMH4s X-Received: by 2002:a05:6402:1853:: with SMTP id v19mr1752249edy.10.1614240751403; Thu, 25 Feb 2021 00:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614240751; cv=none; d=google.com; s=arc-20160816; b=YHvrCDUilAFKyNsAWlSW+QxManniaVIWrkZone1qeTByJnXVrvvC+s5y3y/sAXeLRz Vys7cHn0kV+7m3ZTmqAP1uGeREsCLkTvWW3B2PURQGtk6Hofy3U+5+y7npzpRlBmkmwj 7mb/z1uJOL0bHxskEJZIhu/076FX4ZvTdzkSEKJvUyz/j/zveYSWjyBETPep+R4zUGaz xEJD9Fkh5JeSq8gFhkoA69bYU8aMAPR60lGf35dr7766cTULqc4+MEfCuh0fFK91/SIM ci8I7azgHCJRZYkFih8QOI6/6w5GH529p3t+UlDf9IN7J3A8FZhDOTZG8nnGGEZGEl3Q h7Bw== 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=fyuTlAO3vB+Mn96a0UMu0l9OIZLkZw2lfkiewOW3LhY=; b=n8+1wH3Ah2VnjLWKXz7mQ7yb9pGX7PYpzQExcvxry4ftheEbcC7Xx1YnlBXbjZDCRP ZTrLSw+5I53Ys1dzECWv4LZCwWCKM0LbbWEQWev3zLnyfKDdiPjKiniIzeR0+39EsAYE Xw4HxTL/jkQ5CDT19w7dNKit5Ij3fSC1wFZC4vVH7R995g33mhoB6KF+v3HJKAvL6Pog n9TfKFX6m+f9TDFTzej8NRKDTCmQ8LyKMRIr9EGV9YyIHGgLJVhrZBIqBc1ooVsNhc8m FnQuGe5ALG3QhOTiRzAuf7eEDPxQucT+1+y4w+g3zxTYcuHEKqRT8KIebqM+Or0GHfL3 D86g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=eyskfTcp; 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 l1si2853771edk.364.2021.02.25.00.12.01; Thu, 25 Feb 2021 00:12:31 -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=eyskfTcp; 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 S236297AbhBXXYc (ORCPT + 99 others); Wed, 24 Feb 2021 18:24:32 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:47162 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236223AbhBXXYF (ORCPT ); Wed, 24 Feb 2021 18:24:05 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614209017; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=fyuTlAO3vB+Mn96a0UMu0l9OIZLkZw2lfkiewOW3LhY=; b=eyskfTcpJOoW20bh32I2ARKQKatRBayYdMX3dSb5zdjTQT2cTWgVnZln+s42U2794o/6PK3L T5xP9y+32zGAvUxzRVbjFmvtWtTlFf/GwtBSnyq85Mwbn9kza9bnx/CKg0drs25mt0typtFR jYrTIshyMd8V1iowlS67PLmUSic= X-Mailgun-Sending-Ip: 69.72.42.2 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-n07.prod.us-west-2.postgun.com with SMTP id 6036dfe0ba0866383071de13 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 24 Feb 2021 23:23:12 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id F1BB5C43464; Wed, 24 Feb 2021 23:23:11 +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 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 CA05CC433ED; Wed, 24 Feb 2021 23:23:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CA05CC433ED 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, loic.poulain@linaro.org, carl.yin@quectel.com, naveen.kumar@quectel.com, Bhaumik Bhatt Subject: [PATCH v6 0/4] Serialize execution environment changes for MHI Date: Wed, 24 Feb 2021 15:23:01 -0800 Message-Id: <1614208985-20851-1-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v6: -Add patch to improve debug message -Fix switch-case fall through warning for EE serialization patch -Address review comments and update commit text v5: -Update commit text for "clear devices when moving execution environments" patch -Added test platform details that were missed out in the cover letter -Merged two if checks in to a single one for EE serialization patch v4: -Addressed review comments for additional info logging for EE movements -Updated switch case for EE handling in mhi_intvec_threaded_handler() v3: -Update commit text to accurately reflect changes and reasoning based on reviews v2: -Add patch to clear devices when moving execution environments Note: This patch is first in series of execution environment related changes. During full boot chain firmware download, the PM state worker downloads the AMSS image after waiting for the SBL execution environment change in PBL mode itself. Since getting rid of the firmware load worker thread, this design needs to change and MHI host must download the AMSS image from the SBL mode of PM state worker thread instead of blocking waits for SBL EE in PBL transition processing. Ensure that EE changes are handled only from appropriate places and occur one after another and handle only PBL or RDDM EE changes as critical events directly from the interrupt handler and the status callback is given to the controller drivers promptly. When moving from SBL to AMSS EE, clear SBL specific client devices by calling remove callbacks for them so they are not left opened in a different execution environment. This patchset was tested on ARM64. Bhaumik Bhatt (4): bus: mhi: core: Destroy SBL devices when moving to mission mode bus: mhi: core: Download AMSS image from appropriate function bus: mhi: core: Process execution environment changes serially bus: mhi: core: Update debug prints to include local device state drivers/bus/mhi/core/boot.c | 51 +++++++++++++-------------- drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/main.c | 76 +++++++++++++++++++++++++++-------------- drivers/bus/mhi/core/pm.c | 10 ++++-- 4 files changed, 83 insertions(+), 55 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project