diff mbox series

[1/8] mhi: pci-generic: Increase number of hardware events

Message ID 1605279602-18749-2-git-send-email-loic.poulain@linaro.org
State Superseded
Headers show
Series mhi: pci_generic: Misc improvements | expand

Commit Message

Loic Poulain Nov. 13, 2020, 2:59 p.m. UTC
If the IPA (IP hardware accelerator) is starved of event ring elements,
the modem is crashing (SDX55). That can be prevented by setting a
larger number of events (i.e 2 x number of channel ring elements).

Tested with FN980m module.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

---
 drivers/bus/mhi/pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

Comments

Bhaumik Bhatt Nov. 13, 2020, 4:56 p.m. UTC | #1
On 2020-11-13 06:59, Loic Poulain wrote:
> If the IPA (IP hardware accelerator) is starved of event ring elements,

> the modem is crashing (SDX55). That can be prevented by setting a

> larger number of events (i.e 2 x number of channel ring elements).

> 

> Tested with FN980m module.

> 

> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Reviewed-by: Bhaumik Bhatt <bbhatt@codeaurora.org>

> ---

>  drivers/bus/mhi/pci_generic.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/bus/mhi/pci_generic.c 

> b/drivers/bus/mhi/pci_generic.c

> index e3df838..13a7e4f 100644

> --- a/drivers/bus/mhi/pci_generic.c

> +++ b/drivers/bus/mhi/pci_generic.c

> @@ -91,7 +91,7 @@ struct mhi_pci_dev_info {

> 

>  #define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \

>  	{					\

> -		.num_elements = 128,		\

> +		.num_elements = 256,		\

>  		.irq_moderation_ms = 5,		\

>  		.irq = (ev_ring) + 1,		\

>  		.priority = 1,			\


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project
Hemant Kumar Nov. 18, 2020, 3:54 a.m. UTC | #2
Hi Loic,

On 11/13/20 6:59 AM, Loic Poulain wrote:
> If the IPA (IP hardware accelerator) is starved of event ring elements,

> the modem is crashing (SDX55). That can be prevented by setting a

it is because of event processing is getting starved ? Event ring 
elements = 2 x xfer ring is good for HW channels. Do you think NAPI 
polling would help when you start verifying higher data rates?

> larger number of events (i.e 2 x number of channel ring elements).

> 

> Tested with FN980m module.

> 

> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>

> ---

>   drivers/bus/mhi/pci_generic.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c

> index e3df838..13a7e4f 100644

> --- a/drivers/bus/mhi/pci_generic.c

> +++ b/drivers/bus/mhi/pci_generic.c

> @@ -91,7 +91,7 @@ struct mhi_pci_dev_info {

>   

>   #define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \

>   	{					\

> -		.num_elements = 128,		\

> +		.num_elements = 256,		\

>   		.irq_moderation_ms = 5,		\

>   		.irq = (ev_ring) + 1,		\

>   		.priority = 1,			\

> 


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Loic Poulain Nov. 18, 2020, 8:26 a.m. UTC | #3
On Wed, 18 Nov 2020 at 04:54, Hemant Kumar <hemantk@codeaurora.org> wrote:
>

> Hi Loic,

>

> On 11/13/20 6:59 AM, Loic Poulain wrote:

> > If the IPA (IP hardware accelerator) is starved of event ring elements,

> > the modem is crashing (SDX55). That can be prevented by setting a

> it is because of event processing is getting starved ?


Yes, and hardware does not like that.

> Event ring elements = 2 x xfer ring is good for HW channels. Do you think NAPI

> polling would help when you start verifying higher data rates?


That's a good question, I'll certainly test that. But we still need to
ensure this will
never ever happen with this higher event count.
Hemant Kumar Nov. 19, 2020, 1:50 a.m. UTC | #4
Hi Loic,

On 11/18/20 12:26 AM, Loic Poulain wrote:
> On Wed, 18 Nov 2020 at 04:54, Hemant Kumar <hemantk@codeaurora.org> wrote:

>>

>> Hi Loic,

>>

>> On 11/13/20 6:59 AM, Loic Poulain wrote:

>>> If the IPA (IP hardware accelerator) is starved of event ring elements,

>>> the modem is crashing (SDX55). That can be prevented by setting a

>> it is because of event processing is getting starved ?

> 

> Yes, and hardware does not like that.

> 

>> Event ring elements = 2 x xfer ring is good for HW channels. Do you think NAPI

>> polling would help when you start verifying higher data rates?

> 

> That's a good question, I'll certainly test that. But we still need to

> ensure this will

> never ever happen with this higher event count.

Once you move to burst mode, if device is running out of credit, it 
would send OOB and move to doorbell mode, and stop posting events until
MHI Host rings DB with a TRE.
> 


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Loic Poulain Nov. 19, 2020, 9:42 a.m. UTC | #5
Hi Hemant,

On Thu, 19 Nov 2020 at 02:50, Hemant Kumar <hemantk@codeaurora.org> wrote:
>

> Hi Loic,

>

> On 11/18/20 12:26 AM, Loic Poulain wrote:

> > On Wed, 18 Nov 2020 at 04:54, Hemant Kumar <hemantk@codeaurora.org> wrote:

> >>

> >> Hi Loic,

> >>

> >> On 11/13/20 6:59 AM, Loic Poulain wrote:

> >>> If the IPA (IP hardware accelerator) is starved of event ring elements,

> >>> the modem is crashing (SDX55). That can be prevented by setting a

> >> it is because of event processing is getting starved ?

> >

> > Yes, and hardware does not like that.

> >

> >> Event ring elements = 2 x xfer ring is good for HW channels. Do you think NAPI

> >> polling would help when you start verifying higher data rates?

> >

> > That's a good question, I'll certainly test that. But we still need to

> > ensure this will

> > never ever happen with this higher event count.

> Once you move to burst mode, if device is running out of credit, it

> would send OOB and move to doorbell mode, and stop posting events until

> MHI Host rings DB with a TRE.


That not something I observe with my device/hardware, and I end with
the modem crashing:

[   47.607340] ipa_mhi_client ipa_mhi_gsi_ev_err_cb:1121 channel
id=100 client=42 state=2
[   47.608337] ipa_mhi_client ipa_mhi_gsi_ev_err_cb:1133 Received
GSI_EVT_EVT_RING_EMPTY_ERR
[   47.609310] ipa_mhi_client ipa_mhi_gsi_ev_err_cb:1138 err_desc=0x5000
[   47.610339] IPA: unrecoverable error has occurred, asserting

It's triggered from here:
https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c?h=APSS.FSM.7.6#n1134

Regards,
Loic
diff mbox series

Patch

diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
index e3df838..13a7e4f 100644
--- a/drivers/bus/mhi/pci_generic.c
+++ b/drivers/bus/mhi/pci_generic.c
@@ -91,7 +91,7 @@  struct mhi_pci_dev_info {
 
 #define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \
 	{					\
-		.num_elements = 128,		\
+		.num_elements = 256,		\
 		.irq_moderation_ms = 5,		\
 		.irq = (ev_ring) + 1,		\
 		.priority = 1,			\