mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bhaumik Bhatt <bbhatt@codeaurora.org>
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 2/6] bus: mhi: core: Improvements to the channel handling state machine
Date: Mon, 16 Nov 2020 15:52:20 +0530	[thread overview]
Message-ID: <20201116102220.GJ3926@Mani-XPS-13-9360> (raw)
In-Reply-To: <1605122473-12179-3-git-send-email-bbhatt@codeaurora.org>

On Wed, Nov 11, 2020 at 11:21:09AM -0800, Bhaumik Bhatt wrote:
> Add support to enable sending the stop channel command and
> improve the channel handling state machine such that all commands
> go through a common function. This can help ensure that the state
> machine is not violated in any way and adheres to the MHI
> specification.
> 
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
> ---
>  drivers/bus/mhi/core/init.c     |   6 ++
>  drivers/bus/mhi/core/internal.h |  12 +++
>  drivers/bus/mhi/core/main.c     | 163 ++++++++++++++++++++++++----------------
>  3 files changed, 116 insertions(+), 65 deletions(-)
> 
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index 4d34d62..c9b1de8 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -51,6 +51,12 @@ const char * const mhi_state_str[MHI_STATE_MAX] = {
>  	[MHI_STATE_SYS_ERR] = "SYS_ERR",
>  };
>  
> +const char * const mhi_ch_state_type_str[MHI_CH_STATE_TYPE_MAX] = {
> +	[MHI_CH_STATE_TYPE_RESET] = "RESET",
> +	[MHI_CH_STATE_TYPE_STOP] = "STOP",
> +	[MHI_CH_STATE_TYPE_START] = "START",
> +};
> +
>  static const char * const mhi_pm_state_str[] = {
>  	[MHI_PM_STATE_DISABLE] = "DISABLE",
>  	[MHI_PM_STATE_POR] = "POR",
> diff --git a/drivers/bus/mhi/core/internal.h b/drivers/bus/mhi/core/internal.h
> index 2df8de5..f4efb15 100644
> --- a/drivers/bus/mhi/core/internal.h
> +++ b/drivers/bus/mhi/core/internal.h
> @@ -369,6 +369,18 @@ enum mhi_ch_state {
>  	MHI_CH_STATE_ERROR = 0x5,
>  };
>  
> +enum mhi_ch_state_type {
> +	MHI_CH_STATE_TYPE_RESET,
> +	MHI_CH_STATE_TYPE_STOP,
> +	MHI_CH_STATE_TYPE_START,
> +	MHI_CH_STATE_TYPE_MAX,
> +};
> +

As said in previous patch, this needs to be moved to a separate one.

> +extern const char * const mhi_ch_state_type_str[MHI_CH_STATE_TYPE_MAX];
> +#define TO_CH_STATE_TYPE_STR(state) (((state) >= MHI_CH_STATE_TYPE_MAX) ? \
> +				     "INVALID_STATE" : \
> +				     mhi_ch_state_type_str[state])
> +
>  #define MHI_INVALID_BRSTMODE(mode) (mode != MHI_DB_BRST_DISABLE && \
>  				    mode != MHI_DB_BRST_ENABLE)
>  
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index ad881a1..1226933 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -1220,56 +1220,120 @@ int mhi_send_cmd(struct mhi_controller *mhi_cntrl,
>  	return 0;
>  }
>  

[...]

> +static void __mhi_unprepare_channel(struct mhi_controller *mhi_cntrl,
> +				    struct mhi_chan *mhi_chan)
> +{
> +	int ret;
> +	struct device *dev = &mhi_cntrl->mhi_dev->dev;
> +
> +	dev_dbg(dev, "Entered: unprepare channel:%d\n", mhi_chan->chan);

Please get rid of these debug prints. We have some of them right now but they
should be removed at some point. For debugging, use ftrace.

Thanks,
Mani

  reply	other threads:[~2020-11-16 11:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 19:21 [PATCH v2 0/6] Updates to MHI channel handling Bhaumik Bhatt
2020-11-11 19:21 ` [PATCH v2 1/6] bus: mhi: core: Allow receiving a STOP channel command response Bhaumik Bhatt
2020-11-16  7:13   ` Manivannan Sadhasivam
2020-11-16 17:36     ` Bhaumik Bhatt
2020-11-21 17:16       ` Manivannan Sadhasivam
2020-11-24  0:23         ` Bhaumik Bhatt
2020-11-11 19:21 ` [PATCH v2 2/6] bus: mhi: core: Improvements to the channel handling state machine Bhaumik Bhatt
2020-11-16 10:22   ` Manivannan Sadhasivam [this message]
2020-11-11 19:21 ` [PATCH v2 3/6] bus: mhi: core: Add support to stop or start channel data transfers Bhaumik Bhatt
2020-11-16 12:43   ` Manivannan Sadhasivam
2020-11-16 20:56     ` Bhaumik Bhatt
2020-11-21 17:05       ` Manivannan Sadhasivam
2020-11-24  0:45         ` Bhaumik Bhatt
2020-11-11 19:21 ` [PATCH v2 4/6] bus: mhi: core: Check execution environment for channel before issuing reset Bhaumik Bhatt
2020-11-11 19:21 ` [PATCH v2 5/6] bus: mhi: core: Remove __ prefix for MHI channel unprepare function Bhaumik Bhatt
2020-11-16 12:47   ` Manivannan Sadhasivam
2020-11-11 19:21 ` [PATCH v2 6/6] bus: mhi: Improve documentation on channel transfer setup APIs Bhaumik Bhatt
2020-11-16 12:50   ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116102220.GJ3926@Mani-XPS-13-9360 \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=bbhatt@codeaurora.org \
    --cc=hemantk@codeaurora.org \
    --cc=jhugo@codeaurora.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®