Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2116037pxb; Sat, 21 Nov 2020 09:18:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTWiLF7HAAqovatk0NjXf91juTvtpMJXOkq1wBMFBJACQjYCQuodgPoOsF8jpWnBohW7XA X-Received: by 2002:a50:a40a:: with SMTP id u10mr39445662edb.16.1605979083270; Sat, 21 Nov 2020 09:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605979083; cv=none; d=google.com; s=arc-20160816; b=zotu3sqpXYD6JMr54DlaT7jUKcygDweBZ65Zm86VZhTwOx1YPD/mZbLGPN88U3rcyn 9SdaxNa79blzr2TfyM9g3HQsL6eWD+6ENMulRNzv1ZFxA79/ma+3aP+vUFRoQ66kIb3y bx7YlNgAoms1FBwdxwrnQ3SpWNJcRY1EzdC0Bp27e0yeYROpzXZeVtr5WwnEVfZFddw3 ce9Kor5srSgTLJqPAQls1RSRhaPCIRrfGDlvPN8aNz084L34+kSlovhrfp6Gq9+KhzHR JLNG/Xr+aMXoMPTHx/0TYxu0jrZs028sse1pB8mFIZ1AvsCq+bunVByaxRww6s0FS6a7 RMdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mIhGD64TVT2e/okt0H5po+f21VD7x2dMhrZto+qW1po=; b=NGqKPiCeBtANKV94kjMNmyReyJQ+0aKmgw08p6rLfh7NL6BpwNiIXUwr9U+kl/qX8A hY1+qlwdGMyrecrxMgdD5uk0g5Hh8qxo1Y/2T5V7L4CxOLVxhusaeGUha30xwogMMuE6 q8x1CheknMAlrtcxG43ChA4IHrdEUAsZkSXOT7uPSfREFEYWSOxNp7Rr6Yz54huvpu5N c8E2f94jFhDyx3cQETZC1InVt81YwVi+33hLptliKNPvfpJ3tRkW65J5E1jlfC7PWzMi Qc56DSm0PBgTLd5M666DtZ+fIyOVYkp5B/pQJ0aTS4kpL6wWav2BEnkUyEtkwlrBDm3x xD8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yxAlvJr0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si3677578eds.557.2020.11.21.09.17.40; Sat, 21 Nov 2020 09:18:03 -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=@linaro.org header.s=google header.b=yxAlvJr0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727194AbgKURQK (ORCPT + 99 others); Sat, 21 Nov 2020 12:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbgKURQK (ORCPT ); Sat, 21 Nov 2020 12:16:10 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D40C5C0613CF for ; Sat, 21 Nov 2020 09:16:09 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id i13so10233032pgm.9 for ; Sat, 21 Nov 2020 09:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mIhGD64TVT2e/okt0H5po+f21VD7x2dMhrZto+qW1po=; b=yxAlvJr0KVlf3l1unVUfJj6i1rgYO6rGgbW7JiXgntmlHT9BOq3cj5Q/jBoUHG8uZs fJOCyUYZvLc8fV740rMg5HrS9zofSi9/EGck9xT1F3lUE5aje0OJNOmdTWmEZo0Q9AZB r5yMvXelOYRfz5mpvRmnWr2Ev8DtkTTCrkWZDbmwbsnlHaA/5z797mB9D8llp08gUgNt BI/0Fg+hy8UmwJwgH9TvXBpxN8lrEURn8CCK1TTWZJAFefpXUSuXwwPeN9Typm8Ft93A FAJP4rCLUs7Hf8ovKLl0Edx/3QcfoA2ltCv4cl399+9BdqKrGDN/q4MSyIK4AsYuXu+A oQaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mIhGD64TVT2e/okt0H5po+f21VD7x2dMhrZto+qW1po=; b=YyE9I9E/TTgsmBUXrLiWobMzhuprHsbDwxKuiFKd8zduXZGMrWrCeXmtCVSQvCJIUb 5APiZlcoynHRc0Rq26vjOroL8KoD3Up2+Wh3AYzkbHA64lIZoHAntsXnhs5q4mAFpXli ub3/cvpid9HRuJiLrQ+ZbjGmsXVi3NJyKeyvnB/wYyc5WcInW8uL5sXUjE04sMoXPjTA t2IERvdpbFxtYTvZDtVg1JQrbXnKOXYYLYwHKRIdE+G+6Yf71lUdbMGZeggrf3g7ppLu ++ijuVdgC1BNk4zMwK75fZ67pyQ9CZnuEUazk1tFKkyWblbf6pTHVdvqzBhzHwepyY6o jl1A== X-Gm-Message-State: AOAM532xY5e8gUzm8VaNHFkeBKudmi/LsnVR6DxAZ21qw42UhrTRBGvc F41rqgpRV4uv2dLsaLyW2YYBYW3mm4F3 X-Received: by 2002:a17:90a:4a85:: with SMTP id f5mr17322069pjh.216.1605978969149; Sat, 21 Nov 2020 09:16:09 -0800 (PST) Received: from thinkpad ([2409:4072:6d88:a48b:4152:ad0c:a438:7e97]) by smtp.gmail.com with ESMTPSA id mv5sm8488072pjb.42.2020.11.21.09.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2020 09:16:08 -0800 (PST) Date: Sat, 21 Nov 2020 22:46:01 +0530 From: Manivannan Sadhasivam To: Bhaumik Bhatt Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, loic.poulain@linaro.org, kvalo@codeaurora.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/6] bus: mhi: core: Allow receiving a STOP channel command response Message-ID: <20201121171601.GB2343@thinkpad> References: <1605122473-12179-1-git-send-email-bbhatt@codeaurora.org> <1605122473-12179-2-git-send-email-bbhatt@codeaurora.org> <20201116071339.GI3926@Mani-XPS-13-9360> <616fe76b6757e8d545cfaaba1ab3ab50@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <616fe76b6757e8d545cfaaba1ab3ab50@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 09:36:09AM -0800, Bhaumik Bhatt wrote: > Hi Mani, > > On 2020-11-15 23:13, Manivannan Sadhasivam wrote: > > On Wed, Nov 11, 2020 at 11:21:08AM -0800, Bhaumik Bhatt wrote: > > > 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) && > > > > This enum is not defined in this patch so it'll break. Please add a > > separate > > patch which introduces the new state enums alone and then have patches > > 1/2 > > as a followup. > > > It is actually already defined and present in internal.h as enum > mhi_ch_state. > > The old set of enums has MHI_CH_STATE_STOP from enum mhi_ch_state and the > new > enum I introduced is MHI_CH_STATE_TYPE_STOP from enum enum > mhi_ch_state_type. > > If it seems confusing, suggestions to renaming them are welcome. > Ah, sorry. I got confused with MHI_CH_STATE_TYPE_STOP and MHI_CH_STATE_STOP. Ignore my previous comment. Thanks, Mani > > Also this change is not belonging to this commit I believe. > > > I included this change here because, a channel can be in "stopped" state and > a user module could be unloaded or a crash could force a driver remove > leading > us to come this check. > > If you think I should move it as a separate patch, let me know. > > Thanks, > > Mani > > > > > + !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 > > > > > Thanks, > Bhaumik > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project