* [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support
@ 2024-07-01 2:12 Slark Xiao
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Slark Xiao @ 2024-07-01 2:12 UTC (permalink / raw)
To: manivannan.sadhasivam, loic.poulain, ryazanov.s.a, johannes,
quic_jhugo
Cc: netdev, mhi, linux-arm-msm, linux-kernel, Slark Xiao
Align with Qcom SDX72, add ready timeout item for Foxconn SDX72.
And also, add firehose support since SDX72.
Signed-off-by: Slark Xiao <slark_xiao@163.com>
---
v2: (1). Update the edl file path and name (2). Set SDX72 support
trigger edl mode by default
v3: Divide into 2 parts for Foxconn sdx72 platform
---
drivers/bus/mhi/host/pci_generic.c | 43 ++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 35ae7cd0711f..1fb1c2f2fe12 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
+ MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
+ MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
};
@@ -419,6 +421,16 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
.event_cfg = mhi_foxconn_sdx55_events,
};
+static const struct mhi_controller_config modem_foxconn_sdx72_config = {
+ .max_channels = 128,
+ .timeout_ms = 20000,
+ .ready_timeout_ms = 50000,
+ .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
+ .ch_cfg = mhi_foxconn_sdx55_channels,
+ .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
+ .event_cfg = mhi_foxconn_sdx55_events,
+};
+
static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
.name = "foxconn-sdx55",
.fw = "qcom/sdx55m/sbl1.mbn",
@@ -488,6 +500,28 @@ static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
.sideband_wake = false,
};
+static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
+ .name = "foxconn-t99w515",
+ .edl = "fox/sdx72m/edl.mbn",
+ .edl_trigger = true,
+ .config = &modem_foxconn_sdx72_config,
+ .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
+ .dma_data_width = 32,
+ .mru_default = 32768,
+ .sideband_wake = false,
+};
+
+static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
+ .name = "foxconn-dw5934e",
+ .edl = "fox/sdx72m/edl.mbn",
+ .edl_trigger = true,
+ .config = &modem_foxconn_sdx72_config,
+ .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
+ .dma_data_width = 32,
+ .mru_default = 32768,
+ .sideband_wake = false,
+};
+
static const struct mhi_channel_config mhi_mv3x_channels[] = {
MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
@@ -720,6 +754,15 @@ static const struct pci_device_id mhi_pci_id_table[] = {
/* DW5932e (sdx62), Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
.driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
+ /* T99W515 (sdx72) */
+ { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
+ .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
+ /* DW5934e(sdx72), With eSIM */
+ { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
+ .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
+ /* DW5934e(sdx72), Non-eSIM */
+ { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
+ .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
/* MV31-W (Cinterion) */
{ PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
.driver_data = (kernel_ulong_t) &mhi_mv31_info },
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller
2024-07-01 2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
@ 2024-07-01 2:12 ` Slark Xiao
2024-07-01 15:13 ` Jeffrey Hugo
2024-07-03 13:46 ` Manivannan Sadhasivam
2024-07-01 2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
` (2 subsequent siblings)
3 siblings, 2 replies; 13+ messages in thread
From: Slark Xiao @ 2024-07-01 2:12 UTC (permalink / raw)
To: manivannan.sadhasivam, loic.poulain, ryazanov.s.a, johannes,
quic_jhugo
Cc: netdev, mhi, linux-arm-msm, linux-kernel, Slark Xiao
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(+)
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable
2024-07-01 2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
@ 2024-07-01 2:12 ` Slark Xiao
2024-07-01 21:28 ` Jakub Kicinski
2024-07-03 13:46 ` Manivannan Sadhasivam
2024-07-01 16:25 ` [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Manivannan Sadhasivam
2024-07-03 13:44 ` Manivannan Sadhasivam
3 siblings, 2 replies; 13+ messages in thread
From: Slark Xiao @ 2024-07-01 2:12 UTC (permalink / raw)
To: manivannan.sadhasivam, loic.poulain, ryazanov.s.a, johannes,
quic_jhugo
Cc: netdev, mhi, linux-arm-msm, linux-kernel, Slark Xiao
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 wwan side. Then wwan driver could
set a corresponding mux_id value according to the 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
---
drivers/net/wwan/mhi_wwan_mbim.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
index 3f72ae943b29..e481ced496d8 100644
--- a/drivers/net/wwan/mhi_wwan_mbim.c
+++ b/drivers/net/wwan/mhi_wwan_mbim.c
@@ -42,6 +42,8 @@
#define MHI_MBIM_LINK_HASH_SIZE 8
#define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE)
+#define WDS_BIND_MUX_DATA_PORT_MUX_ID 112
+
struct mhi_mbim_link {
struct mhi_mbim_context *mbim;
struct net_device *ndev;
@@ -93,6 +95,15 @@ static struct mhi_mbim_link *mhi_mbim_get_link_rcu(struct mhi_mbim_context *mbim
return NULL;
}
+static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl)
+{
+ if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 ||
+ strcmp(cntrl->name, "foxconn-t99w515") == 0)
+ return WDS_BIND_MUX_DATA_PORT_MUX_ID;
+
+ return 0;
+}
+
static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session,
u16 tx_seq)
{
@@ -596,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
{
struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
struct mhi_mbim_context *mbim;
- int err;
+ int err, link_id;
mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL);
if (!mbim)
@@ -617,8 +628,11 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
/* Number of transfer descriptors determines size of the queue */
mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
+ /* Get the corresponding mux_id from mhi */
+ link_id = mhi_mbim_get_link_mux_id(cntrl);
+
/* Register wwan link ops with MHI controller representing WWAN instance */
- return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0);
+ return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, link_id);
}
static void mhi_mbim_remove(struct mhi_device *mhi_dev)
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
@ 2024-07-01 15:13 ` Jeffrey Hugo
2024-07-01 16:27 ` Manivannan Sadhasivam
2024-07-03 13:46 ` Manivannan Sadhasivam
1 sibling, 1 reply; 13+ messages in thread
From: Jeffrey Hugo @ 2024-07-01 15:13 UTC (permalink / raw)
To: Slark Xiao, manivannan.sadhasivam, loic.poulain, ryazanov.s.a,
johannes
Cc: netdev, mhi, linux-arm-msm, linux-kernel
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;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support
2024-07-01 2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
2024-07-01 2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
@ 2024-07-01 16:25 ` Manivannan Sadhasivam
2024-07-02 6:34 ` Slark Xiao
2024-07-03 13:44 ` Manivannan Sadhasivam
3 siblings, 1 reply; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-01 16:25 UTC (permalink / raw)
To: Slark Xiao
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
On Mon, Jul 01, 2024 at 10:12:14AM +0800, Slark Xiao wrote:
> Align with Qcom SDX72, add ready timeout item for Foxconn SDX72.
> And also, add firehose support since SDX72.
>
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
> ---
> v2: (1). Update the edl file path and name (2). Set SDX72 support
> trigger edl mode by default
> v3: Divide into 2 parts for Foxconn sdx72 platform
> ---
> drivers/bus/mhi/host/pci_generic.c | 43 ++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 35ae7cd0711f..1fb1c2f2fe12 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
> MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
> MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
> MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
> + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
> + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
> MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> };
> @@ -419,6 +421,16 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
> .event_cfg = mhi_foxconn_sdx55_events,
> };
>
> +static const struct mhi_controller_config modem_foxconn_sdx72_config = {
> + .max_channels = 128,
> + .timeout_ms = 20000,
> + .ready_timeout_ms = 50000,
> + .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
> + .ch_cfg = mhi_foxconn_sdx55_channels,
> + .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
> + .event_cfg = mhi_foxconn_sdx55_events,
Weird. Why this modem is using all SDX55 configs? Reusing is fine, but it is
strange to see only this SDX72 modem using different config than the others
added below.
- Mani
> +};
> +
> static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
> .name = "foxconn-sdx55",
> .fw = "qcom/sdx55m/sbl1.mbn",
> @@ -488,6 +500,28 @@ static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
> .sideband_wake = false,
> };
>
> +static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
> + .name = "foxconn-t99w515",
> + .edl = "fox/sdx72m/edl.mbn",
> + .edl_trigger = true,
> + .config = &modem_foxconn_sdx72_config,
> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> + .dma_data_width = 32,
> + .mru_default = 32768,
> + .sideband_wake = false,
> +};
> +
> +static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
> + .name = "foxconn-dw5934e",
> + .edl = "fox/sdx72m/edl.mbn",
> + .edl_trigger = true,
> + .config = &modem_foxconn_sdx72_config,
> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> + .dma_data_width = 32,
> + .mru_default = 32768,
> + .sideband_wake = false,
> +};
> +
> static const struct mhi_channel_config mhi_mv3x_channels[] = {
> MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
> MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
> @@ -720,6 +754,15 @@ static const struct pci_device_id mhi_pci_id_table[] = {
> /* DW5932e (sdx62), Non-eSIM */
> { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
> .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
> + /* T99W515 (sdx72) */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
> + /* DW5934e(sdx72), With eSIM */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> + /* DW5934e(sdx72), Non-eSIM */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> /* MV31-W (Cinterion) */
> { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
> .driver_data = (kernel_ulong_t) &mhi_mv31_info },
> --
> 2.25.1
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller
2024-07-01 15:13 ` Jeffrey Hugo
@ 2024-07-01 16:27 ` Manivannan Sadhasivam
2024-07-02 6:36 ` Slark Xiao
0 siblings, 1 reply; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-01 16:27 UTC (permalink / raw)
To: Jeffrey Hugo
Cc: Slark Xiao, loic.poulain, ryazanov.s.a, johannes, netdev, mhi,
linux-arm-msm, linux-kernel
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
> > * 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;
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable
2024-07-01 2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
@ 2024-07-01 21:28 ` Jakub Kicinski
2024-07-03 13:46 ` Manivannan Sadhasivam
1 sibling, 0 replies; 13+ messages in thread
From: Jakub Kicinski @ 2024-07-01 21:28 UTC (permalink / raw)
To: Slark Xiao
Cc: manivannan.sadhasivam, loic.poulain, ryazanov.s.a, johannes,
quic_jhugo, netdev, mhi, linux-arm-msm, linux-kernel
On Mon, 1 Jul 2024 10:12:16 +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 wwan side. Then wwan driver could
> set a corresponding mux_id value according to the MHI product.
Sounds like Mani wants to take these so:
Acked-by: Jakub Kicinski <kuba@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re:Re: [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support
2024-07-01 16:25 ` [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Manivannan Sadhasivam
@ 2024-07-02 6:34 ` Slark Xiao
2024-07-03 13:28 ` Manivannan Sadhasivam
0 siblings, 1 reply; 13+ messages in thread
From: Slark Xiao @ 2024-07-02 6:34 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
At 2024-07-02 00:25:23, "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org> wrote:
>On Mon, Jul 01, 2024 at 10:12:14AM +0800, Slark Xiao wrote:
>> Align with Qcom SDX72, add ready timeout item for Foxconn SDX72.
>> And also, add firehose support since SDX72.
>>
>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>> ---
>> v2: (1). Update the edl file path and name (2). Set SDX72 support
>> trigger edl mode by default
>> v3: Divide into 2 parts for Foxconn sdx72 platform
>> ---
>> drivers/bus/mhi/host/pci_generic.c | 43 ++++++++++++++++++++++++++++++
>> 1 file changed, 43 insertions(+)
>>
>> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
>> index 35ae7cd0711f..1fb1c2f2fe12 100644
>> --- a/drivers/bus/mhi/host/pci_generic.c
>> +++ b/drivers/bus/mhi/host/pci_generic.c
>> @@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
>> MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
>> MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
>> MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
>> + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
>> + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
>> MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
>> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
>> };
>> @@ -419,6 +421,16 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
>> .event_cfg = mhi_foxconn_sdx55_events,
>> };
>>
>> +static const struct mhi_controller_config modem_foxconn_sdx72_config = {
>> + .max_channels = 128,
>> + .timeout_ms = 20000,
>> + .ready_timeout_ms = 50000,
>> + .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
>> + .ch_cfg = mhi_foxconn_sdx55_channels,
>> + .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
>> + .event_cfg = mhi_foxconn_sdx55_events,
>
>Weird. Why this modem is using all SDX55 configs? Reusing is fine, but it is
>strange to see only this SDX72 modem using different config than the others
>added below.
>
>- Mani
>
There is a settings ".ready_timeout_ms = 50000," for SDX72/SDX75 only.
It aligns with Qcom SDX72/SDX75 in case of timeout issue.
>> +};
>> +
>> static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
>> .name = "foxconn-sdx55",
>> .fw = "qcom/sdx55m/sbl1.mbn",
>> @@ -488,6 +500,28 @@ static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
>> .sideband_wake = false,
>> };
>>
>> +static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
>> + .name = "foxconn-t99w515",
>> + .edl = "fox/sdx72m/edl.mbn",
>> + .edl_trigger = true,
>> + .config = &modem_foxconn_sdx72_config,
>> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
>> + .dma_data_width = 32,
>> + .mru_default = 32768,
>> + .sideband_wake = false,
>> +};
>> +
>> +static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
>> + .name = "foxconn-dw5934e",
>> + .edl = "fox/sdx72m/edl.mbn",
>> + .edl_trigger = true,
>> + .config = &modem_foxconn_sdx72_config,
>> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
>> + .dma_data_width = 32,
>> + .mru_default = 32768,
>> + .sideband_wake = false,
>> +};
>> +
>> static const struct mhi_channel_config mhi_mv3x_channels[] = {
>> MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
>> MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
>> @@ -720,6 +754,15 @@ static const struct pci_device_id mhi_pci_id_table[] = {
>> /* DW5932e (sdx62), Non-eSIM */
>> { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
>> .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
>> + /* T99W515 (sdx72) */
>> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
>> + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
>> + /* DW5934e(sdx72), With eSIM */
>> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
>> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
>> + /* DW5934e(sdx72), Non-eSIM */
>> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
>> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
>> /* MV31-W (Cinterion) */
>> { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
>> .driver_data = (kernel_ulong_t) &mhi_mv31_info },
>> --
>> 2.25.1
>>
>
>--
>மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re:Re: [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller
2024-07-01 16:27 ` Manivannan Sadhasivam
@ 2024-07-02 6:36 ` Slark Xiao
0 siblings, 0 replies; 13+ messages in thread
From: Slark Xiao @ 2024-07-02 6:36 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Jeffrey Hugo, loic.poulain, ryazanov.s.a, johannes, netdev, mhi,
linux-arm-msm, linux-kernel
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;
>>
>
>--
>மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Re: [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support
2024-07-02 6:34 ` Slark Xiao
@ 2024-07-03 13:28 ` Manivannan Sadhasivam
0 siblings, 0 replies; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-03 13:28 UTC (permalink / raw)
To: Slark Xiao
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
On Tue, Jul 02, 2024 at 02:34:51PM +0800, Slark Xiao wrote:
>
> At 2024-07-02 00:25:23, "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org> wrote:
> >On Mon, Jul 01, 2024 at 10:12:14AM +0800, Slark Xiao wrote:
> >> Align with Qcom SDX72, add ready timeout item for Foxconn SDX72.
> >> And also, add firehose support since SDX72.
> >>
> >> Signed-off-by: Slark Xiao <slark_xiao@163.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> >> ---
> >> v2: (1). Update the edl file path and name (2). Set SDX72 support
> >> trigger edl mode by default
> >> v3: Divide into 2 parts for Foxconn sdx72 platform
> >> ---
> >> drivers/bus/mhi/host/pci_generic.c | 43 ++++++++++++++++++++++++++++++
> >> 1 file changed, 43 insertions(+)
> >>
> >> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> >> index 35ae7cd0711f..1fb1c2f2fe12 100644
> >> --- a/drivers/bus/mhi/host/pci_generic.c
> >> +++ b/drivers/bus/mhi/host/pci_generic.c
> >> @@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
> >> MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
> >> MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
> >> MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
> >> + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
> >> + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
> >> MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
> >> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> >> };
> >> @@ -419,6 +421,16 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
> >> .event_cfg = mhi_foxconn_sdx55_events,
> >> };
> >>
> >> +static const struct mhi_controller_config modem_foxconn_sdx72_config = {
> >> + .max_channels = 128,
> >> + .timeout_ms = 20000,
> >> + .ready_timeout_ms = 50000,
> >> + .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
> >> + .ch_cfg = mhi_foxconn_sdx55_channels,
> >> + .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
> >> + .event_cfg = mhi_foxconn_sdx55_events,
> >
> >Weird. Why this modem is using all SDX55 configs? Reusing is fine, but it is
> >strange to see only this SDX72 modem using different config than the others
> >added below.
> >
> >- Mani
> >
>
> There is a settings ".ready_timeout_ms = 50000," for SDX72/SDX75 only.
> It aligns with Qcom SDX72/SDX75 in case of timeout issue.
>
> >> +};
> >> +
> >> static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
> >> .name = "foxconn-sdx55",
> >> .fw = "qcom/sdx55m/sbl1.mbn",
> >> @@ -488,6 +500,28 @@ static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
> >> .sideband_wake = false,
> >> };
> >>
> >> +static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
> >> + .name = "foxconn-t99w515",
> >> + .edl = "fox/sdx72m/edl.mbn",
> >> + .edl_trigger = true,
> >> + .config = &modem_foxconn_sdx72_config,
> >> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> >> + .dma_data_width = 32,
> >> + .mru_default = 32768,
> >> + .sideband_wake = false,
> >> +};
> >> +
> >> +static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
> >> + .name = "foxconn-dw5934e",
> >> + .edl = "fox/sdx72m/edl.mbn",
> >> + .edl_trigger = true,
> >> + .config = &modem_foxconn_sdx72_config,
> >> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> >> + .dma_data_width = 32,
> >> + .mru_default = 32768,
> >> + .sideband_wake = false,
> >> +};
> >> +
> >> static const struct mhi_channel_config mhi_mv3x_channels[] = {
> >> MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
> >> MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
> >> @@ -720,6 +754,15 @@ static const struct pci_device_id mhi_pci_id_table[] = {
> >> /* DW5932e (sdx62), Non-eSIM */
> >> { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
> >> .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
> >> + /* T99W515 (sdx72) */
> >> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
> >> + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
> >> + /* DW5934e(sdx72), With eSIM */
> >> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
> >> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> >> + /* DW5934e(sdx72), Non-eSIM */
> >> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
> >> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> >> /* MV31-W (Cinterion) */
> >> { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
> >> .driver_data = (kernel_ulong_t) &mhi_mv31_info },
> >> --
> >> 2.25.1
> >>
> >
> >--
> >மணிவண்ணன் சதாசிவம்
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support
2024-07-01 2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
` (2 preceding siblings ...)
2024-07-01 16:25 ` [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Manivannan Sadhasivam
@ 2024-07-03 13:44 ` Manivannan Sadhasivam
3 siblings, 0 replies; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-03 13:44 UTC (permalink / raw)
To: Slark Xiao
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
On Mon, Jul 01, 2024 at 10:12:14AM +0800, Slark Xiao wrote:
> Align with Qcom SDX72, add ready timeout item for Foxconn SDX72.
> And also, add firehose support since SDX72.
>
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
Applied to mhi-next with fixup to commit subject and description!
- Mani
> ---
> v2: (1). Update the edl file path and name (2). Set SDX72 support
> trigger edl mode by default
> v3: Divide into 2 parts for Foxconn sdx72 platform
> ---
> drivers/bus/mhi/host/pci_generic.c | 43 ++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 35ae7cd0711f..1fb1c2f2fe12 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
> MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
> MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
> MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
> + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
> + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
> MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> };
> @@ -419,6 +421,16 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
> .event_cfg = mhi_foxconn_sdx55_events,
> };
>
> +static const struct mhi_controller_config modem_foxconn_sdx72_config = {
> + .max_channels = 128,
> + .timeout_ms = 20000,
> + .ready_timeout_ms = 50000,
> + .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
> + .ch_cfg = mhi_foxconn_sdx55_channels,
> + .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
> + .event_cfg = mhi_foxconn_sdx55_events,
> +};
> +
> static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
> .name = "foxconn-sdx55",
> .fw = "qcom/sdx55m/sbl1.mbn",
> @@ -488,6 +500,28 @@ static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
> .sideband_wake = false,
> };
>
> +static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
> + .name = "foxconn-t99w515",
> + .edl = "fox/sdx72m/edl.mbn",
> + .edl_trigger = true,
> + .config = &modem_foxconn_sdx72_config,
> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> + .dma_data_width = 32,
> + .mru_default = 32768,
> + .sideband_wake = false,
> +};
> +
> +static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
> + .name = "foxconn-dw5934e",
> + .edl = "fox/sdx72m/edl.mbn",
> + .edl_trigger = true,
> + .config = &modem_foxconn_sdx72_config,
> + .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> + .dma_data_width = 32,
> + .mru_default = 32768,
> + .sideband_wake = false,
> +};
> +
> static const struct mhi_channel_config mhi_mv3x_channels[] = {
> MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
> MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
> @@ -720,6 +754,15 @@ static const struct pci_device_id mhi_pci_id_table[] = {
> /* DW5932e (sdx62), Non-eSIM */
> { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
> .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
> + /* T99W515 (sdx72) */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
> + /* DW5934e(sdx72), With eSIM */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> + /* DW5934e(sdx72), Non-eSIM */
> + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
> + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
> /* MV31-W (Cinterion) */
> { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
> .driver_data = (kernel_ulong_t) &mhi_mv31_info },
> --
> 2.25.1
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
2024-07-01 15:13 ` Jeffrey Hugo
@ 2024-07-03 13:46 ` Manivannan Sadhasivam
1 sibling, 0 replies; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-03 13:46 UTC (permalink / raw)
To: Slark Xiao
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
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
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable
2024-07-01 2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
2024-07-01 21:28 ` Jakub Kicinski
@ 2024-07-03 13:46 ` Manivannan Sadhasivam
1 sibling, 0 replies; 13+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-03 13:46 UTC (permalink / raw)
To: Slark Xiao
Cc: loic.poulain, ryazanov.s.a, johannes, quic_jhugo, netdev, mhi,
linux-arm-msm, linux-kernel
On Mon, Jul 01, 2024 at 10:12:16AM +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 wwan side. Then wwan driver could
> set a corresponding mux_id value according to the MHI product.
>
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
Applied to mhi-next with Jakub's ACK!
- Mani
> ---
> v2: Remove Fix flag
> v3: Use name match solution instead of use mux_id
> ---
> drivers/net/wwan/mhi_wwan_mbim.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
> index 3f72ae943b29..e481ced496d8 100644
> --- a/drivers/net/wwan/mhi_wwan_mbim.c
> +++ b/drivers/net/wwan/mhi_wwan_mbim.c
> @@ -42,6 +42,8 @@
> #define MHI_MBIM_LINK_HASH_SIZE 8
> #define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE)
>
> +#define WDS_BIND_MUX_DATA_PORT_MUX_ID 112
> +
> struct mhi_mbim_link {
> struct mhi_mbim_context *mbim;
> struct net_device *ndev;
> @@ -93,6 +95,15 @@ static struct mhi_mbim_link *mhi_mbim_get_link_rcu(struct mhi_mbim_context *mbim
> return NULL;
> }
>
> +static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl)
> +{
> + if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 ||
> + strcmp(cntrl->name, "foxconn-t99w515") == 0)
> + return WDS_BIND_MUX_DATA_PORT_MUX_ID;
> +
> + return 0;
> +}
> +
> static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session,
> u16 tx_seq)
> {
> @@ -596,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
> {
> struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
> struct mhi_mbim_context *mbim;
> - int err;
> + int err, link_id;
>
> mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL);
> if (!mbim)
> @@ -617,8 +628,11 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
> /* Number of transfer descriptors determines size of the queue */
> mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
>
> + /* Get the corresponding mux_id from mhi */
> + link_id = mhi_mbim_get_link_mux_id(cntrl);
> +
> /* Register wwan link ops with MHI controller representing WWAN instance */
> - return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0);
> + return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, link_id);
> }
>
> static void mhi_mbim_remove(struct mhi_device *mhi_dev)
> --
> 2.25.1
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-07-03 13:47 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 2:12 [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Slark Xiao
2024-07-01 2:12 ` [PATCH v4 2/3] bus: mhi: host: Add name for mhi_controller Slark Xiao
2024-07-01 15:13 ` Jeffrey Hugo
2024-07-01 16:27 ` Manivannan Sadhasivam
2024-07-02 6:36 ` Slark Xiao
2024-07-03 13:46 ` Manivannan Sadhasivam
2024-07-01 2:12 ` [PATCH v4 3/3] net: wwan: mhi: make default data link id configurable Slark Xiao
2024-07-01 21:28 ` Jakub Kicinski
2024-07-03 13:46 ` Manivannan Sadhasivam
2024-07-01 16:25 ` [PATCH v4 1/3] bus: mhi: host: Add Foxconn SDX72 related support Manivannan Sadhasivam
2024-07-02 6:34 ` Slark Xiao
2024-07-03 13:28 ` Manivannan Sadhasivam
2024-07-03 13:44 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).