Skip to content

Commit

Permalink
bus: mhi: pci_generic: Parametrable element count for events
Browse files Browse the repository at this point in the history
Not all hardwares need to use the same number of event ring elements.
This change makes this parametrable.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1614971808-22156-1-git-send-email-loic.poulain@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  • Loading branch information
Loic Poulain authored and Manivannan Sadhasivam committed Mar 10, 2021
1 parent a38fd87 commit 9ea48ef
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/bus/mhi/pci_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ struct mhi_pci_dev_info {
.doorbell_mode_switch = false, \
}

#define MHI_EVENT_CONFIG_CTRL(ev_ring) \
#define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \
{ \
.num_elements = 64, \
.num_elements = el_count, \
.irq_moderation_ms = 0, \
.irq = (ev_ring) + 1, \
.priority = 1, \
Expand Down Expand Up @@ -114,9 +114,9 @@ struct mhi_pci_dev_info {
.doorbell_mode_switch = true, \
}

#define MHI_EVENT_CONFIG_DATA(ev_ring) \
#define MHI_EVENT_CONFIG_DATA(ev_ring, el_count) \
{ \
.num_elements = 128, \
.num_elements = el_count, \
.irq_moderation_ms = 5, \
.irq = (ev_ring) + 1, \
.priority = 1, \
Expand All @@ -127,9 +127,9 @@ struct mhi_pci_dev_info {
.offload_channel = false, \
}

#define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \
#define MHI_EVENT_CONFIG_HW_DATA(ev_ring, el_count, ch_num) \
{ \
.num_elements = 2048, \
.num_elements = el_count, \
.irq_moderation_ms = 1, \
.irq = (ev_ring) + 1, \
.priority = 1, \
Expand All @@ -156,12 +156,12 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {

static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
/* first ring is control+data ring */
MHI_EVENT_CONFIG_CTRL(0),
MHI_EVENT_CONFIG_CTRL(0, 64),
/* DIAG dedicated event ring */
MHI_EVENT_CONFIG_DATA(1),
MHI_EVENT_CONFIG_DATA(1, 128),
/* Hardware channels request dedicated hardware event rings */
MHI_EVENT_CONFIG_HW_DATA(2, 100),
MHI_EVENT_CONFIG_HW_DATA(3, 101)
MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
MHI_EVENT_CONFIG_HW_DATA(3, 2048, 101)
};

static struct mhi_controller_config modem_qcom_v1_mhiv_config = {
Expand Down

0 comments on commit 9ea48ef

Please sign in to comment.