Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp82957pxu; Wed, 2 Dec 2020 15:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpjdfUXCUgfVMfiXtG2AVh7ME3ZaytPIZ71nJwq/mgT9ocsrqakvxg8yul3UA4MK6Q5Xak X-Received: by 2002:a17:906:a182:: with SMTP id s2mr167047ejy.249.1606952688263; Wed, 02 Dec 2020 15:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606952688; cv=none; d=google.com; s=arc-20160816; b=gkeG5CS7eOxjyZsR6rGXx6vwsyzy+j2dWyvzv56LvcDKfCgtU+qVTsKm0+DjPzmDl+ 7hBPLw79x+xO2eb94RnyPWNqFCtaAGx3aP0sF0t3N2SnQnGg2zdUidptn3Tr7z+ePZVH GoM+Fp5Q4FmaG3UHgDniKj3R8NNXugI6xyYoLl0NJpI1ySqoQut+wBiAic10DJDhlhNd 8ZaL0LS5O1gWYv5q3m4kCHI/bUg53cw7f3dqwCNQUQuft3OtRzNl1TXTBlkKg7SXJmqA doWzYVf+j66nmbSpvT1IP7JI2xAoFFJpK2GCwFFzM7ZAs6VTLyVxb4dYyHr7nvhmw585 NMBw== 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=/zZ9PrMUSfJKaZKhW4LSC93iI89BZsWElZ7hzgxB2dg=; b=kZ5HISwDlUIRsC3e7Msg2x92zmXUvq9yeZy+evr2YjJsPmGsjfo/3CHsADm18SawDR ZjPQjn/UH9h6ffFm5xbNsRkQT8pQLPgJsCXUg1vZ7cwPqgEAA/paO4er/wTtzDVi5vJb ylYUuKojfBX/yz5WGah2w5OTmdNXMVjh90niQfM8bhj8rc9TgyqO0H4D7Ya5BCZok9YS lhJ+Atjdp1c5GC9UZyXmOQ8V1EqkJQMVnW9hd1trxNuxMez3SW1G6Xf4BAusLaDEutQt 2uJ76kcP2w2eXH8Ehmfw6F0CgwE3oX/a3y4pxafsJ/8gavZK+eBGJKRqKBnR/6GDltjv 2YUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=pmF5DGRe; 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 b18si101000ejk.164.2020.12.02.15.44.25; Wed, 02 Dec 2020 15:44:48 -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=pmF5DGRe; 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 S1729029AbgLBXlr (ORCPT + 99 others); Wed, 2 Dec 2020 18:41:47 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:18514 "EHLO m42-5.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728364AbgLBXlr (ORCPT ); Wed, 2 Dec 2020 18:41:47 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606952487; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=/zZ9PrMUSfJKaZKhW4LSC93iI89BZsWElZ7hzgxB2dg=; b=pmF5DGReFPKiqSTobSRUQYwrz2GkyJKFZSZMuk0ea1I8Yh7Dj8U7pafHkY6aIWYc2FPjisH5 DfOr95pXKEopck+iravv9LCkbDl8rXA9wLu3J74v9eeIR/OiFROEiWxu3ok/WReJX7dwULZR u8PcanH9FcHDiVUa6uqJd+ED9CM= X-Mailgun-Sending-Ip: 69.72.42.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 5fc82602a5d4da3a6c5b027d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 23:40:50 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 40543C433ED; Wed, 2 Dec 2020 23:40:50 +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 8C24FC43464; Wed, 2 Dec 2020 23:40:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8C24FC43464 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, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, loic.poulain@linaro.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v3 2/7] bus: mhi: core: Allow channel to be disabled from stopped state Date: Wed, 2 Dec 2020 15:40:33 -0800 Message-Id: <1606952438-15321-3-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606952438-15321-1-git-send-email-bbhatt@codeaurora.org> References: <1606952438-15321-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a channel was explicitly stopped but not reset, allow it to move to a disabled state so the channel context can be cleaned up. As the channel remained in a stopped state, its context was not reset and cleared, which needs to be done if a client driver module is unloaded or a device crash occurs. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index f0697f4..e7b9a90 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1288,7 +1288,8 @@ static int mhi_driver_remove(struct device *dev) mutex_lock(&mhi_chan->mutex); - if (ch_state[dir] == MHI_CH_STATE_ENABLED && + 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); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project