Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3563662pxb; Mon, 9 Nov 2020 14:49:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwREJhEBFrxo349oiGbvdItacyoYGA4h9bLEUJw9KxbNqthUTzRuh1VmKlWmOJfhq1i/e9D X-Received: by 2002:a17:907:4302:: with SMTP id nh2mr16897248ejb.451.1604962153427; Mon, 09 Nov 2020 14:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604962153; cv=none; d=google.com; s=arc-20160816; b=sIv31+eav6TQKnFI63GJZ9UKHl71fjdwhiy1pDSYNDeEIOjaHdu8c3Jpl0G0vQhKIl CMWwLlP2MQ9X1gJZ1gtRKZR+93iElbeviDYQFlypQtoh7fZq9aNWjBtq9/bE2JeQh0LG p209YX6So9aRUyvaPCgqgAV8/uc3rXML1MM0oSC96r58rLt4sjSWy70cn9ANRbCzX1Cz x8fUjEtCDYwJa49a8CTdYiZ4fYLtF2fTXwvbMPNKvCcwh/lv8LtaJWGt2PrvV3Dd9ztb 68xjP1FbnBWESqrv2K/uITTR1v8MgvZfoiFrQosS7h41T4IUHvohAzPmGkWTkopmkKv7 GtfQ== 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=jyGRsEid4HShrO9mYKeo8fFBfPQI1rGhmEE8jIK4E+k=; b=fBmxsKSl3Jzo37HQXip7r54oIoGSZWOJ/+ypYLY01O5vkxBV6deTAfFmgg1tR5TxzE lFAsufhSdFHCM3bf7Dh1l9RX5VXzC61F4bYn4DzjQfnAiINZPum/SbfmE2J/uHDFSkpo 1w9fCrVWvkjb96fhKNV8wKyNuWq5a4FqP5u8lUkEh+jgULmQl79BzN9rZ5gADStpVa5y UAxqabOO/mAUVyghY0QIKV0PpXOUVd6mAeeWwk5TMk1IQY3OnNbXdQsLMRo8eN29xqVn 9eyqALAhddy/IZZ+5DhAf3LpIKkqSpK95ULZM+QehcVdgeaHDsgOVAPnhKrFlG3DnVW3 3A0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=uwf3OFgG; 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 e21si8327631ejx.94.2020.11.09.14.48.50; Mon, 09 Nov 2020 14:49:13 -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=uwf3OFgG; 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 S1731194AbgKIWol (ORCPT + 99 others); Mon, 9 Nov 2020 17:44:41 -0500 Received: from z5.mailgun.us ([104.130.96.5]:56881 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730603AbgKIWok (ORCPT ); Mon, 9 Nov 2020 17:44:40 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604961880; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=jyGRsEid4HShrO9mYKeo8fFBfPQI1rGhmEE8jIK4E+k=; b=uwf3OFgGqymNLxduJqOPU82cvTq1D2bYkfwWB3sXnNUnSqxd8XVK+eSTh5vrvGCITVpnNkRk 82bBceG7yuMXmBGb6Pn8UrIQ9LTsaoWMDQl0vsqLHfm0mM52h8pv9kuNi/X2E9E0O/P+KIDC QktKgDe7fDnMG42Kqu7mJgtraJY= 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 5fa9c6418c0d657314815f10 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 09 Nov 2020 22:44:17 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B7229C433CB; Mon, 9 Nov 2020 22:44:16 +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 F0D78C433C6; Mon, 9 Nov 2020 22:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F0D78C433C6 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, loic.poulain@linaro.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v1 1/4] bus: mhi: core: Allow receiving a STOP channel command response Date: Mon, 9 Nov 2020 14:44:07 -0800 Message-Id: <1604961850-27671-2-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604961850-27671-1-git-send-email-bbhatt@codeaurora.org> References: <1604961850-27671-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to receive the response to a STOP channel command to the MHI bus. If a client would like to STOP a channel instead of issuing a RESET to it, this would provide support for it. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 5 +++-- drivers/bus/mhi/core/main.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 8cefa35..4d34d62 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1267,8 +1267,9 @@ static int mhi_driver_remove(struct device *dev) mutex_lock(&mhi_chan->mutex); - if (ch_state[dir] == MHI_CH_STATE_ENABLED && - !mhi_chan->offload_ch) + if ((ch_state[dir] == MHI_CH_STATE_ENABLED || + ch_state[dir] == MHI_CH_STATE_STOP) && + !mhi_chan->offload_ch) mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan); mhi_chan->ch_state = MHI_CH_STATE_DISABLED; diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index f953e2a..ad881a1 100644 --- a/drivers/bus/mhi/core/main.c +++ b/drivers/bus/mhi/core/main.c @@ -1194,6 +1194,11 @@ int mhi_send_cmd(struct mhi_controller *mhi_cntrl, cmd_tre->dword[0] = MHI_TRE_CMD_RESET_DWORD0; cmd_tre->dword[1] = MHI_TRE_CMD_RESET_DWORD1(chan); break; + case MHI_CMD_STOP_CHAN: + cmd_tre->ptr = MHI_TRE_CMD_STOP_PTR; + cmd_tre->dword[0] = MHI_TRE_CMD_STOP_DWORD0; + cmd_tre->dword[1] = MHI_TRE_CMD_STOP_DWORD1(chan); + break; case MHI_CMD_START_CHAN: cmd_tre->ptr = MHI_TRE_CMD_START_PTR; cmd_tre->dword[0] = MHI_TRE_CMD_START_DWORD0; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project