[v8,4/9] bus: mhi: core: Update debug messages to use client device
diff mbox series

Message ID 1617311778-1254-5-git-send-email-bbhatt@codeaurora.org
State Accepted
Commit cde61bb0470df8cfb5d49ebe88e9802fb0f817f0
Headers show
Series
  • [v8,1/9] bus: mhi: core: Allow sending the STOP channel command
Related show

Commit Message

Bhaumik Bhatt April 1, 2021, 9:16 p.m. UTC
Debug messages dealing with client devices use the generic MHI
controller or parent device along with a channel number. It would
be better to instead use the client device directly and enable
better log messages for channel updates.

Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
---
 drivers/bus/mhi/core/main.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Manivannan Sadhasivam April 7, 2021, 6:27 a.m. UTC | #1
On Thu, Apr 01, 2021 at 02:16:13PM -0700, Bhaumik Bhatt wrote:
> Debug messages dealing with client devices use the generic MHI
> controller or parent device along with a channel number. It would
> be better to instead use the client device directly and enable
> better log messages for channel updates.
> 
> Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/bus/mhi/core/main.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index 710ca0f..94fdbf7 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -1238,7 +1238,7 @@ static int mhi_update_channel_state(struct mhi_controller *mhi_cntrl,
>  				    struct mhi_chan *mhi_chan,
>  				    enum mhi_ch_state_type to_state)
>  {
> -	struct device *dev = &mhi_cntrl->mhi_dev->dev;
> +	struct device *dev = &mhi_chan->mhi_dev->dev;
>  	enum mhi_cmd_type cmd = MHI_CMD_NOP;
>  	int ret;
>  
> @@ -1316,7 +1316,7 @@ 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;
> +	struct device *dev = &mhi_chan->mhi_dev->dev;
>  
>  	mutex_lock(&mhi_chan->mutex);
>  
> @@ -1340,13 +1340,11 @@ int mhi_prepare_channel(struct mhi_controller *mhi_cntrl,
>  			struct mhi_chan *mhi_chan)
>  {
>  	int ret = 0;
> -	struct device *dev = &mhi_cntrl->mhi_dev->dev;
> +	struct device *dev = &mhi_chan->mhi_dev->dev;
>  
>  	if (!(BIT(mhi_cntrl->ee) & mhi_chan->ee_mask)) {
> -		dev_err(dev,
> -			"Current EE: %s Required EE Mask: 0x%x for chan: %s\n",
> -			TO_MHI_EXEC_STR(mhi_cntrl->ee), mhi_chan->ee_mask,
> -			mhi_chan->name);
> +		dev_err(dev, "Current EE: %s Required EE Mask: 0x%x\n",
> +			TO_MHI_EXEC_STR(mhi_cntrl->ee), mhi_chan->ee_mask);
>  		return -ENOTCONN;
>  	}
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Jeffrey Hugo May 4, 2021, 5:45 p.m. UTC | #2
On 4/1/2021 3:16 PM, Bhaumik Bhatt wrote:
> Debug messages dealing with client devices use the generic MHI
> controller or parent device along with a channel number. It would
> be better to instead use the client device directly and enable
> better log messages for channel updates.
> 
> Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
> ---

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>

Patch
diff mbox series

diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
index 710ca0f..94fdbf7 100644
--- a/drivers/bus/mhi/core/main.c
+++ b/drivers/bus/mhi/core/main.c
@@ -1238,7 +1238,7 @@  static int mhi_update_channel_state(struct mhi_controller *mhi_cntrl,
 				    struct mhi_chan *mhi_chan,
 				    enum mhi_ch_state_type to_state)
 {
-	struct device *dev = &mhi_cntrl->mhi_dev->dev;
+	struct device *dev = &mhi_chan->mhi_dev->dev;
 	enum mhi_cmd_type cmd = MHI_CMD_NOP;
 	int ret;
 
@@ -1316,7 +1316,7 @@  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;
+	struct device *dev = &mhi_chan->mhi_dev->dev;
 
 	mutex_lock(&mhi_chan->mutex);
 
@@ -1340,13 +1340,11 @@  int mhi_prepare_channel(struct mhi_controller *mhi_cntrl,
 			struct mhi_chan *mhi_chan)
 {
 	int ret = 0;
-	struct device *dev = &mhi_cntrl->mhi_dev->dev;
+	struct device *dev = &mhi_chan->mhi_dev->dev;
 
 	if (!(BIT(mhi_cntrl->ee) & mhi_chan->ee_mask)) {
-		dev_err(dev,
-			"Current EE: %s Required EE Mask: 0x%x for chan: %s\n",
-			TO_MHI_EXEC_STR(mhi_cntrl->ee), mhi_chan->ee_mask,
-			mhi_chan->name);
+		dev_err(dev, "Current EE: %s Required EE Mask: 0x%x\n",
+			TO_MHI_EXEC_STR(mhi_cntrl->ee), mhi_chan->ee_mask);
 		return -ENOTCONN;
 	}