diff mbox series

[v4,2/3] bus: mhi: host: Add name for mhi_controller

Message ID 20240701021216.17734-2-slark_xiao@163.com
State New
Headers show
Series [v4,1/3] bus: mhi: host: Add Foxconn SDX72 related support | expand

Commit Message

Slark Xiao July 1, 2024, 2:12 a.m. UTC
For SDX72 MBIM mode, it starts data mux id from 112 instead of 0.
This would lead to device can't ping outside successfully.
Also MBIM side would report "bad packet session (112)".In order to
fix this issue, we decide to use the device name of MHI controller
to do a match in client driver side. Then client driver could set
a corresponding mux_id value for this MHI product.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
---
v2: Remove Fix flag
v3: Use name match solution instead of use mux_id
v4: Update the description of new member 'name' and move it to
right position
---
 drivers/bus/mhi/host/pci_generic.c | 1 +
 include/linux/mhi.h                | 2 ++
 2 files changed, 3 insertions(+)

Comments

Jeffrey Hugo July 1, 2024, 3:13 p.m. UTC | #1
On 6/30/2024 8:12 PM, Slark Xiao wrote:
> For SDX72 MBIM mode, it starts data mux id from 112 instead of 0.
> This would lead to device can't ping outside successfully.
> Also MBIM side would report "bad packet session (112)".In order to
> fix this issue, we decide to use the device name of MHI controller
> to do a match in client driver side. Then client driver could set
> a corresponding mux_id value for this MHI product.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
> +++ b/include/linux/mhi.h
> @@ -289,6 +289,7 @@ struct mhi_controller_config {
>   };
>   
>   /**
> + * @name: device name of the MHI controller

This needs to be below the next line

>    * struct mhi_controller - Master MHI controller structure
>    * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
>    *            controller (required)
> @@ -367,6 +368,7 @@ struct mhi_controller_config {
>    * they can be populated depending on the usecase.
>    */
>   struct mhi_controller {
> +	const char *name;
>   	struct device *cntrl_dev;
>   	struct mhi_device *mhi_dev;
>   	struct dentry *debugfs_dentry;
Slark Xiao July 2, 2024, 6:36 a.m. UTC | #2
At 2024-07-02 00:27:15, "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org> wrote:
>On Mon, Jul 01, 2024 at 09:13:50AM -0600, Jeffrey Hugo wrote:
>> On 6/30/2024 8:12 PM, Slark Xiao wrote:
>> > For SDX72 MBIM mode, it starts data mux id from 112 instead of 0.
>> > This would lead to device can't ping outside successfully.
>> > Also MBIM side would report "bad packet session (112)".In order to
>> > fix this issue, we decide to use the device name of MHI controller
>> > to do a match in client driver side. Then client driver could set
>> > a corresponding mux_id value for this MHI product.
>> > 
>> > Signed-off-by: Slark Xiao <slark_xiao@163.com>
>> > +++ b/include/linux/mhi.h
>> > @@ -289,6 +289,7 @@ struct mhi_controller_config {
>> >   };
>> >   /**
>> > + * @name: device name of the MHI controller
>> 
>> This needs to be below the next line
>> 
>
>If this is the only comment of the whole series, I will fix it up while
>applying. Otherwise, fix it while sending next revision.
>
>With that,
>
>Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
>- Mani

Thanks for that^^
>
>> >    * struct mhi_controller - Master MHI controller structure
>> >    * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
>> >    *            controller (required)
>> > @@ -367,6 +368,7 @@ struct mhi_controller_config {
>> >    * they can be populated depending on the usecase.
>> >    */
>> >   struct mhi_controller {
>> > +	const char *name;
>> >   	struct device *cntrl_dev;
>> >   	struct mhi_device *mhi_dev;
>> >   	struct dentry *debugfs_dentry;
>> 
>
>-- 
>மணிவண்ணன் சதாசிவம்
Manivannan Sadhasivam July 3, 2024, 1:46 p.m. UTC | #3
On Mon, Jul 01, 2024 at 10:12:15AM +0800, Slark Xiao wrote:
> For SDX72 MBIM mode, it starts data mux id from 112 instead of 0.
> This would lead to device can't ping outside successfully.
> Also MBIM side would report "bad packet session (112)".In order to
> fix this issue, we decide to use the device name of MHI controller
> to do a match in client driver side. Then client driver could set
> a corresponding mux_id value for this MHI product.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>

Applied to mhi-next with fixup to commit subject and description and also fixed
the issue spotted by Jeff!

- Mani

> ---
> v2: Remove Fix flag
> v3: Use name match solution instead of use mux_id
> v4: Update the description of new member 'name' and move it to
> right position
> ---
>  drivers/bus/mhi/host/pci_generic.c | 1 +
>  include/linux/mhi.h                | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 1fb1c2f2fe12..14a11880bcea 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -1086,6 +1086,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	mhi_cntrl->runtime_get = mhi_pci_runtime_get;
>  	mhi_cntrl->runtime_put = mhi_pci_runtime_put;
>  	mhi_cntrl->mru = info->mru_default;
> +	mhi_cntrl->name = info->name;
>  
>  	if (info->edl_trigger)
>  		mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger;
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index b573f15762f8..d45058d3dbed 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -289,6 +289,7 @@ struct mhi_controller_config {
>  };
>  
>  /**
> + * @name: device name of the MHI controller
>   * struct mhi_controller - Master MHI controller structure
>   * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
>   *            controller (required)
> @@ -367,6 +368,7 @@ struct mhi_controller_config {
>   * they can be populated depending on the usecase.
>   */
>  struct mhi_controller {
> +	const char *name;
>  	struct device *cntrl_dev;
>  	struct mhi_device *mhi_dev;
>  	struct dentry *debugfs_dentry;
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 1fb1c2f2fe12..14a11880bcea 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -1086,6 +1086,7 @@  static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	mhi_cntrl->runtime_get = mhi_pci_runtime_get;
 	mhi_cntrl->runtime_put = mhi_pci_runtime_put;
 	mhi_cntrl->mru = info->mru_default;
+	mhi_cntrl->name = info->name;
 
 	if (info->edl_trigger)
 		mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger;
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index b573f15762f8..d45058d3dbed 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -289,6 +289,7 @@  struct mhi_controller_config {
 };
 
 /**
+ * @name: device name of the MHI controller
  * struct mhi_controller - Master MHI controller structure
  * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
  *            controller (required)
@@ -367,6 +368,7 @@  struct mhi_controller_config {
  * they can be populated depending on the usecase.
  */
 struct mhi_controller {
+	const char *name;
 	struct device *cntrl_dev;
 	struct mhi_device *mhi_dev;
 	struct dentry *debugfs_dentry;