MHI event ring priority updates
cover MHI event ring priority updates
Event ring priorities have remained out of use and are set to 1 by default. This series brings about an enum entry expanding use of the priority field by adding high priority tasklet scheduling to the menu.
In some cases, tasklet scheduling delays can be a nuisance. An example would be ath11k adding a610f3c65d3b ("bus: mhi: Wait for M2 state during system resume") in response to it. This issue can be potentially avoided if the controller uses a dedicated event ring for control packets with high priority tasklet scheduling in place.
There are no functional changes added to the controller (pci_generic or ath11k) drivers with this series and the only changes there are use of the enum in place of a harcoded value of "1". In the future, controllers can opt in to have any event ring scheduled in high priority.
Tested on: X86_64 architecture with SDX65 on Ubuntu 18.04 distribution.
Bhaumik Bhatt (3):
bus: mhi: pci_generic: Use enum entry for event ring priority
ath11k: Use enum entry for event ring priority
bus: mhi: core: Enable support for event ring priorities
Hemant Kumar (1):
bus: mhi: core: Add support for processing priority of event ring
drivers/bus/mhi/core/init.c | 3 +- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++-- drivers/bus/mhi/pci_generic.c | 66 +++++++++++++++++------------------ drivers/net/wireless/ath/ath11k/mhi.c | 4 +-- include/linux/mhi.h | 14 ++++++-- 6 files changed, 65 insertions(+), 43 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 1/4 bus: mhi: core: Add support for processing priority of event ring
From: Hemant Kumar <[email protected]>
Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid with system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. This patch only adds support and does not enable usage of these priorities.
--- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++++++++++--- include/linux/mhi.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-)
drivers/bus/mhi/core/internal.h +1 -1
@@ -535,7 +535,7 @@ struct mhi_event {u32 intmod;u32 irq;int chan;/* this event ring is dedicated to a channel (optional) */ -u32 priority; +enum mhi_er_priority priority;enum mhi_er_data_type data_type;struct mhi_ring ring;struct db_cfg db_cfg;
drivers/bus/mhi/core/main.c +16 -3
@@ -425,10 +425,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) } } -irqreturn_t mhi_irq_handler (int irq_number,void *dev) +irqreturn_t mhi_irq_handler (int irq_number,void *priv) { -struct mhi_event *mhi_event = dev; +struct mhi_event *mhi_event = priv;struct mhi_controller *mhi_cntrl = mhi_event->mhi_cntrl; +struct device *dev = &mhi_cntrl->mhi_dev->dev;struct mhi_event_ctxt *er_ctxt = &mhi_cntrl->mhi_ctxt->er_ctxt[mhi_event->er_index];struct mhi_ring *ev_ring = &mhi_event->ring;
@@ -454,8 +455,20 @@ irqreturn_t mhi_irq_handler(int irq_number, void *dev)if (mhi_dev)mhi_notify (mhi_dev,MHI_CB_PENDING_DATA ); - }else { + +return IRQ_HANDLED ; + } + +switch (mhi_event->priority) { +case MHI_ER_PRIORITY_HI : +tasklet_hi_schedule (&mhi_event->task); +break ; +case MHI_ER_PRIORITY_DEFAULT :tasklet_schedule (&mhi_event->task); +break ; +default : +dev_err (dev,"Skip event of unknown priority\n" ); +break ; }return IRQ_HANDLED ;
include/linux/mhi.h +12 -2
@@ -198,6 +198,16 @@ enum mhi_er_data_type { };/** +* enum mhi_er_priority - Event ring processing priority +* @MHI_ER_PRIORITY_HI: processed by hi-priority tasklet +* @MHI_ER_PRIORITY_DEFAULT: processed by regular tasklet +*/ +enum mhi_er_priority { +MHI_ER_PRIORITY_HI , +MHI_ER_PRIORITY_DEFAULT , +}; + +/** * enum mhi_db_brst_mode - Doorbell mode * @MHI_DB_BRST_DISABLE: Burst mode disable * @MHI_DB_BRST_ENABLE: Burst mode enable
@@ -250,7 +260,7 @@ struct mhi_channel_config {* @irq_moderation_ms: Delay irq for additional events to be aggregated * @irq: IRQ associated with this ring * @channel: Dedicated channel number. U32_MAX indicates a non-dedicated ring -* @priority: Priority of this ring. Use 1 for now +* @priority: Processing priority of this ring. * @mode: Doorbell mode * @data_type: Type of data this ring will process * @hardware_event: This ring is associated with hardware channels
@@ -262,7 +272,7 @@ struct mhi_event_config {u32 irq_moderation_ms;u32 irq;u32 channel; -u32 priority; +enum mhi_er_priority priority;enum mhi_db_brst_mode mode;enum mhi_er_data_type data_type;bool hardware_event;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 1/4] bus: mhi: core: Add support for processing priority of event ring
Quoted 25 lines · Bhaumik Bhatt
From: Hemant Kumar <[email protected]>
Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid with system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. This patch only adds support and does not enable usage of these priorities.
Signed-off-by Hemant Kumar <[email protected]>Signed-off-by Bhaumik Bhatt <[email protected]>--- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++++++++++--- include/linux/mhi.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-)drivers/bus/mhi/core/internal.h +0
-0
drivers/bus/mhi/core/internal.h struct mhi_event { · line 538
Quoted 5 lines
drivers/bus/mhi/core/internal.h +1
-1@@ -535,7 +535,7 @@ struct mhi_event {u32 intmod;u32 irq;int chan;/* this event ring is dedicated to a channel (optional) */ -u32 priority; +enum mhi_er_priority priority;
Instead of using enum for priorities, can we just make use of the existing "priority" field? Since the existing controllers set it to "1", can we use "0" as the high priority?
This way we don't need to change the controller drivers.
Quoted 22 lines
drivers/bus/mhi/core/internal.h +0
-0enum mhi_er_data_type data_type;struct mhi_ring ring;struct db_cfg db_cfg;drivers/bus/mhi/core/main.c +3
-2@@ -425,10 +425,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) } } -irqreturn_t mhi_irq_handler (int irq_number,void *dev) +irqreturn_t mhi_irq_handler (int irq_number,void *priv) { -struct mhi_event *mhi_event = dev; +struct mhi_event *mhi_event = priv;struct mhi_controller *mhi_cntrl = mhi_event->mhi_cntrl; +struct device *dev = &mhi_cntrl->mhi_dev->dev;struct mhi_event_ctxt *er_ctxt = &mhi_cntrl->mhi_ctxt->er_ctxt[mhi_event->er_index];struct mhi_ring *ev_ring = &mhi_event->ring;
drivers/bus/mhi/core/main.c irqreturn_t mhi_irq_handler(int irq_number, void *dev) · line 463
Quoted 10 lines
drivers/bus/mhi/core/main.c +6
-1@@ -454,8 +455,20 @@ irqreturn_t mhi_irq_handler(int irq_number, void *dev)if (mhi_dev)mhi_notify (mhi_dev,MHI_CB_PENDING_DATA ); - }else { + +return IRQ_HANDLED ; + } + +switch (mhi_event->priority) { +case MHI_ER_PRIORITY_HI :
This could be,
/* Use high priority tasklet for high priority event ring */ if (!mhi_event->priority) tasklet_hi_schedule(&mhi_event->task); else tasklet_schedule(&mhi_event->task);
Thanks,
Mani
Quoted 54 lines
drivers/bus/mhi/core/main.c +7
-0+tasklet_hi_schedule (&mhi_event->task); +break ; +case MHI_ER_PRIORITY_DEFAULT :tasklet_schedule (&mhi_event->task); +break ; +default : +dev_err (dev,"Skip event of unknown priority\n" ); +break ; }return IRQ_HANDLED ;include/linux/mhi.h +12
-2@@ -198,6 +198,16 @@ enum mhi_er_data_type { };/** +* enum mhi_er_priority - Event ring processing priority +* @MHI_ER_PRIORITY_HI: processed by hi-priority tasklet +* @MHI_ER_PRIORITY_DEFAULT: processed by regular tasklet +*/ +enum mhi_er_priority { +MHI_ER_PRIORITY_HI , +MHI_ER_PRIORITY_DEFAULT , +}; + +/** * enum mhi_db_brst_mode - Doorbell mode * @MHI_DB_BRST_DISABLE: Burst mode disable * @MHI_DB_BRST_ENABLE: Burst mode enable @@ -250,7 +260,7 @@ struct mhi_channel_config {* @irq_moderation_ms: Delay irq for additional events to be aggregated * @irq: IRQ associated with this ring * @channel: Dedicated channel number. U32_MAX indicates a non-dedicated ring -* @priority: Priority of this ring. Use 1 for now +* @priority: Processing priority of this ring. * @mode: Doorbell mode * @data_type: Type of data this ring will process * @hardware_event: This ring is associated with hardware channels @@ -262,7 +272,7 @@ struct mhi_event_config {u32 irq_moderation_ms;u32 irq;u32 channel; -u32 priority; +enum mhi_er_priority priority;enum mhi_db_brst_mode mode;enum mhi_er_data_type data_type;bool hardware_event;Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 1/4] bus: mhi: core: Add support for processing priority of event ring
Hi Mani,
Quoted 36 lines · Manivannan Sadhasivam
Quoted 25 lines · Bhaumik Bhatt
From: Hemant Kumar <[email protected]>
Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid with system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. This patch only adds support and does not enable usage of these priorities.
Signed-off-by Hemant Kumar <[email protected]>Signed-off-by Bhaumik Bhatt <[email protected]>--- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++++++++++--- include/linux/mhi.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-)drivers/bus/mhi/core/internal.h +0
-0drivers/bus/mhi/core/internal.h struct mhi_event { · line 538
Quoted 5 lines
drivers/bus/mhi/core/internal.h +1
-1@@ -535,7 +535,7 @@ struct mhi_event {u32 intmod;u32 irq;int chan;/* this event ring is dedicated to a channel (optional) */ -u32 priority; +enum mhi_er_priority priority;Instead of using enum for priorities, can we just make use of the existing "priority" field? Since the existing controllers set it to "1", can we use "0" as the high priority?
Quoted 2 lines
This way we don't need to change the controller drivers.
I agree but the reasons to do the enum approach was to allow for future expansion of the handling if it becomes necessary and provide clarity for the field.
I can always do it this way for now and we can have the enum for another time but would prefer updating what we have now.
Quoted 37 lines
Quoted 24 lines
drivers/bus/mhi/core/internal.h +0
-0enum mhi_er_data_type data_type;struct mhi_ring ring;struct db_cfg db_cfg;drivers/bus/mhi/core/main.c +3
-2@@ -425,10 +425,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) } } -irqreturn_t mhi_irq_handler (int irq_number,void *dev) +irqreturn_t mhi_irq_handler (int irq_number,void *priv) { -struct mhi_event *mhi_event = dev; +struct mhi_event *mhi_event = priv;struct mhi_controller *mhi_cntrl = mhi_event->mhi_cntrl; +struct device *dev = &mhi_cntrl->mhi_dev->dev;struct mhi_event_ctxt *er_ctxt = &mhi_cntrl->mhi_ctxt->er_ctxt[mhi_event->er_index];drivers/bus/mhi/core/main.c +0
-0struct mhi_ring *ev_ring = &mhi_event->ring;@@ -454,8 +455,20 @@ irqreturn_t mhi_irq_handler(int irq_number, void *dev)drivers/bus/mhi/core/main.c irqreturn_t mhi_irq_handler(int irq_number, void · line 464
Quoted 10 lines
drivers/bus/mhi/core/main.c +6
-1if (mhi_dev)mhi_notify (mhi_dev,MHI_CB_PENDING_DATA ); - }else { + +return IRQ_HANDLED ; + } + +switch (mhi_event->priority) { +case MHI_ER_PRIORITY_HI :This could be,
Quoted 9 lines
/* Use high priority tasklet for high priority event ring */ if (!mhi_event->priority) tasklet_hi_schedule(&mhi_event->task); else tasklet_schedule(&mhi_event->task);Thanks,
Mani
Yes, this works too if we keep the current non-enum approach.
Quoted 48 lines
Quoted 48 lines
drivers/bus/mhi/core/main.c +7
-0+tasklet_hi_schedule (&mhi_event->task); +break ; +case MHI_ER_PRIORITY_DEFAULT :tasklet_schedule (&mhi_event->task); +break ; +default : +dev_err (dev,"Skip event of unknown priority\n" ); +break ; }drivers/bus/mhi/core/main.c +0
-0return IRQ_HANDLED ;include/linux/mhi.h +10
-0@@ -198,6 +198,16 @@ enum mhi_er_data_type { };/** +* enum mhi_er_priority - Event ring processing priority +* @MHI_ER_PRIORITY_HI: processed by hi-priority tasklet +* @MHI_ER_PRIORITY_DEFAULT: processed by regular tasklet +*/ +enum mhi_er_priority { +MHI_ER_PRIORITY_HI , +MHI_ER_PRIORITY_DEFAULT , +}; + +/** * enum mhi_db_brst_mode - Doorbell mode * @MHI_DB_BRST_DISABLE: Burst mode disable * @MHI_DB_BRST_ENABLE: Burst mode enable @@ -250,7 +260,7 @@ struct mhi_channel_config {* @irq_moderation_ms: Delay irq for additional events to be aggregated
* @irq: IRQ associated with this ring
* @channel: Dedicated channel number.U32_MAXindicates a
non-dedicated ring
- * @priority: Priority of this ring. Use 1 for now
+ * @priority: Processing priority of this ring.
* @mode: Doorbell mode
* @data_type: Type of data this ring will process
* @hardware_event: This ring is associated with hardware channelsinclude/linux/mhi.h +0
-1@@ -262,7 +272,7 @@ struct mhi_event_config {u32 irq_moderation_ms;u32 irq;u32 channel; -u32 priority;
Quoted 8 lines
Quoted 8 lines
include/linux/mhi.h +1
-1+enum mhi_er_priority priority;enum mhi_db_brst_mode mode;enum mhi_er_data_type data_type;bool hardware_event; --The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Existing controllers would be fine.
Do you think we have a problem if a new controller blindly inputs a "0" in the priority not knowing the impact of it?
If you give me a go ahead, I can make these changes in v2 and leave the enum stuff out.
Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 1/4] bus: mhi: core: Add support for processing priority of event ring
Quoted 40 lines · Bhaumik Bhatt
Hi Mani,
Quoted 37 lines · Manivannan Sadhasivam
Quoted 26 lines · Bhaumik Bhatt
From: Hemant Kumar <[email protected]>
Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid with system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. This patch only adds support and does not enable usage of these priorities.
Signed-off-by Hemant Kumar <[email protected]>Signed-off-by Bhaumik Bhatt <[email protected]>--- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++++++++++--- include/linux/mhi.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-)drivers/bus/mhi/core/internal.h +0
-0drivers/bus/mhi/core/internal.h struct mhi_event { · line 538
Quoted 5 lines
drivers/bus/mhi/core/internal.h +1
-1@@ -535,7 +535,7 @@ struct mhi_event {u32 intmod;u32 irq;int chan;/* this event ring is dedicated to a channel (optional) */ -u32 priority; +enum mhi_er_priority priority;Instead of using enum for priorities, can we just make use of the existing "priority" field? Since the existing controllers set it to "1", can we use "0" as the high priority?
Quoted 8 lines
Quoted 2 lines
This way we don't need to change the controller drivers.
I agree but the reasons to do the enum approach was to allow for future expansion of the handling if it becomes necessary and provide clarity for the field.
I can always do it this way for now and we can have the enum for another time but would prefer updating what we have now.
Yeah, let's deal with it later once the necessity arises.
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
drivers/bus/mhi/core/internal.h +0
-0enum mhi_er_data_type data_type;struct mhi_ring ring;struct db_cfg db_cfg;drivers/bus/mhi/core/main.c +0
-0@@ -425,10 +425,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) } }
[...]
Quoted 5 lines
Existing controllers would be fine.
Do you think we have a problem if a new controller blindly inputs a "0" in the priority not knowing the impact of it?
We should document it in the kernel doc for the struct field and that should be enough. We can't do much if people doesn't read the doc ;)
Thanks,
Mani
Quoted 8 lines
If you give me a go ahead, I can make these changes in v2 and leave the enum stuff out.
Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 1/4] bus: mhi: core: Add support for processing priority of event ring
Hi Mani,
Quoted 43 lines · Manivannan Sadhasivam
Quoted 42 lines · Bhaumik Bhatt
Hi Mani,
Quoted 39 lines · Manivannan Sadhasivam
Quoted 26 lines · Bhaumik Bhatt
From: Hemant Kumar <[email protected]>
Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid with system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. This patch only adds support and does not enable usage of these priorities.
Signed-off-by Hemant Kumar <[email protected]>Signed-off-by Bhaumik Bhatt <[email protected]>--- drivers/bus/mhi/core/internal.h | 2 +- drivers/bus/mhi/core/main.c | 19 ++++++++++++++++--- include/linux/mhi.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-)drivers/bus/mhi/core/internal.h +0
-0drivers/bus/mhi/core/internal.h struct mhi_event { · line 538
Quoted 5 lines
drivers/bus/mhi/core/internal.h +1
-1@@ -535,7 +535,7 @@ struct mhi_event {u32 intmod;u32 irq;int chan;/* this event ring is dedicated to a channel (optional) */ -u32 priority; +enum mhi_er_priority priority;Instead of using enum for priorities, can we just make use of the existing "priority" field? Since the existing controllers set it to "1", can we use "0" as the high priority?
This way we don't need to change the controller drivers.
Quoted 9 lines
Quoted 6 lines
I agree but the reasons to do the enum approach was to allow for future expansion of the handling if it becomes necessary and provide clarity for the field.
I can always do it this way for now and we can have the enum for another time but would prefer updating what we have now.
Yeah, let's deal with it later once the necessity arises.
Sure. I will make the v2.
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
drivers/bus/mhi/core/internal.h +0
-0enum mhi_er_data_type data_type;struct mhi_ring ring;struct db_cfg db_cfg;drivers/bus/mhi/core/main.c +0
-0@@ -425,10 +425,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) } }[...]
Quoted 5 lines
Existing controllers would be fine.
Do you think we have a problem if a new controller blindly inputs a "0" in the priority not knowing the impact of it?
Quoted 6 lines
We should document it in the kernel doc for the struct field and that should be enough. We can't do much if people doesn't read the doc ;)
Thanks,
Mani
Totally agree :)
Quoted 8 lines
Quoted 8 lines
If you give me a go ahead, I can make these changes in v2 and leave the enum stuff out.
Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 2/4 bus: mhi: pci_generic: Use enum entry for event ring priority
In reply to Bhaumik BhattInstead of using a default event ring priority of 1, use the enum provided and set it to default.
--- drivers/bus/mhi/pci_generic.c | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-)
drivers/bus/mhi/pci_generic.c +33 -33
@@ -74,17 +74,17 @@ struct mhi_pci_dev_info { .doorbell_mode_switch = false, \ } -#define MHI_EVENT_CONFIG_CTRL (ev_ring, el_count) \ - { \ - .num_elements = el_count, \ - .irq_moderation_ms = 0, \ - .irq = (ev_ring) + 1, \ - .priority = 1, \ - .mode = MHI_DB_BRST_DISABLE, \ - .data_type = MHI_ER_CTRL, \ - .hardware_event = false, \ - .client_managed = false, \ - .offload_channel = false, \ +#define MHI_EVENT_CONFIG_CTRL (ev_ring, el_count) \ + { \ + .num_elements = el_count, \ + .irq_moderation_ms = 0, \ + .irq = (ev_ring) + 1, \ + .priority = MHI_ER_PRIORITY_DEFAULT, \ + .mode = MHI_DB_BRST_DISABLE, \ + .data_type = MHI_ER_CTRL, \ + .hardware_event = false, \ + .client_managed = false, \ + .offload_channel = false, \ }#define MHI_CHANNEL_CONFIG_HW_UL (ch_num, ch_name, el_count, ev_ring) \
@@ -177,31 +177,31 @@ struct mhi_pci_dev_info { .doorbell_mode_switch = false, \ } -#define MHI_EVENT_CONFIG_DATA (ev_ring, el_count) \ - { \ - .num_elements = el_count, \ - .irq_moderation_ms = 5, \ - .irq = (ev_ring) + 1, \ - .priority = 1, \ - .mode = MHI_DB_BRST_DISABLE, \ - .data_type = MHI_ER_DATA, \ - .hardware_event = false, \ - .client_managed = false, \ - .offload_channel = false, \ +#define MHI_EVENT_CONFIG_DATA (ev_ring, el_count) \ + { \ + .num_elements = el_count, \ + .irq_moderation_ms = 5, \ + .irq = (ev_ring) + 1, \ + .priority = MHI_ER_PRIORITY_DEFAULT, \ + .mode = MHI_DB_BRST_DISABLE, \ + .data_type = MHI_ER_DATA, \ + .hardware_event = false, \ + .client_managed = false, \ + .offload_channel = false, \ }#define MHI_EVENT_CONFIG_HW_DATA (ev_ring, el_count, ch_num) \ - { \ - .num_elements = el_count, \ - .irq_moderation_ms = 1, \ - .irq = (ev_ring) + 1, \ - .priority = 1, \ - .mode = MHI_DB_BRST_DISABLE, \ - .data_type = MHI_ER_DATA, \ - .hardware_event = true, \ - .client_managed = false, \ - .offload_channel = false, \ - .channel = ch_num, \ + { \ + .num_elements = el_count, \ + .irq_moderation_ms = 1, \ + .irq = (ev_ring) + 1, \ + .priority = MHI_ER_PRIORITY_DEFAULT, \ + .mode = MHI_DB_BRST_DISABLE, \ + .data_type = MHI_ER_DATA, \ + .hardware_event = true, \ + .client_managed = false, \ + .offload_channel = false, \ + .channel = ch_num, \ }static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 2/4] bus: mhi: pci_generic: Use enum entry for event ring priority
Quoted 5 lines · Bhaumik Bhatt
Instead of using a default event ring priority of 1, use the enum provided and set it to default.
Signed-off-by Bhaumik Bhatt <[email protected]>---
Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 3/4 ath11k: Use enum entry for event ring priority
In reply to Bhaumik BhattInstead of using a default event ring priority of 1, use the enum provided and set it to default.
--- drivers/net/wireless/ath/ath11k/mhi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/mhi.c +2 -2
@@ -86,7 +86,7 @@ static struct mhi_event_config ath11k_mhi_events_qca6390[] = { .irq_moderation_ms = 1, .irq = 2, .mode = MHI_DB_BRST_DISABLE, - .priority = 1, + .priority = MHI_ER_PRIORITY_DEFAULT, .hardware_event = false, .client_managed = false, .offload_channel = false,
@@ -179,7 +179,7 @@ static struct mhi_event_config ath11k_mhi_events_qcn9074[] = { .irq_moderation_ms = 1, .irq = 2, .mode = MHI_DB_BRST_DISABLE, - .priority = 1, + .priority = MHI_ER_PRIORITY_DEFAULT, .hardware_event = false, .client_managed = false, .offload_channel = false,
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 4/4 bus: mhi: core: Enable support for event ring priorities
In reply to Bhaumik BhattPriority set in the event ring configuration by the controllers has been unused by the MHI host driver until now. Enable usage of those priorities set with the introduction of the enums for default or high priority tasklet scheduling options.
--- drivers/bus/mhi/core/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/bus/mhi/core/init.c +1 -2
@@ -673,8 +673,7 @@ static int parse_ev_cfg(struct mhi_controller *mhi_cntrl, &mhi_cntrl->mhi_chan[mhi_event->chan]; } -/* Priority is fixed to 1 for now */ - mhi_event->priority =1 ; + mhi_event->priority = event_cfg->priority; mhi_event->db_cfg.brstmode = event_cfg->mode;if (MHI_INVALID_BRSTMODE (mhi_event->db_cfg.brstmode))
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v1 4/4] bus: mhi: core: Enable support for event ring priorities
Quoted 7 lines · Bhaumik Bhatt
Priority set in the event ring configuration by the controllers has been unused by the MHI host driver until now. Enable usage of those priorities set with the introduction of the enums for default or high priority tasklet scheduling options.
Signed-off-by Bhaumik Bhatt <[email protected]>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project