diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c index 394c5a854c5c..ee7c1ad72883 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c @@ -3231,7 +3231,7 @@ int ipa3_get_usb_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) return -EINVAL; } IPA_ACTIVE_CLIENTS_INC_SIMPLE(); - for (i = 0; i < MAX_CH_STATS_SUPPORTED; i++) { + for (i = 0; i < MAX_USB_CHANNELS; i++) { stats->ring[i].ringFull = ioread32( ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + i * IPA3_UC_DEBUG_STATS_OFF + diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c index 3462442f53ce..1e64df86b403 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c @@ -2802,7 +2802,7 @@ int ipa3_get_mhip_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) return -EINVAL; } IPA_ACTIVE_CLIENTS_INC_SIMPLE(); - for (i = 0; i < MAX_CH_STATS_SUPPORTED; i++) { + for (i = 0; i < MAX_MHIP_CHANNELS; i++) { stats->ring[i].ringFull = ioread32( ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + i * IPA3_UC_DEBUG_STATS_OFF + diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h index d20d412fe8bb..8a31fb8e6b6a 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h @@ -30,6 +30,12 @@ #define DIR_CONSUMER 0 #define DIR_PRODUCER 1 +#define MAX_AQC_CHANNELS 2 +#define MAX_11AD_CHANNELS 5 +#define MAX_WDI2_CHANNELS 2 +#define MAX_WDI3_CHANNELS 2 +#define MAX_MHIP_CHANNELS 4 +#define MAX_USB_CHANNELS 2 /** * @brief Enum value determined based on the feature it diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c index fe083401ec91..7cef724ba88f 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c @@ -427,17 +427,15 @@ static void ipa3_uc_wdi_event_handler(struct IpaHwSharedMemCommonMapping_t */ int ipa3_get_wdi_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) { - int i, num_chs; + int i; if (!ipa3_ctx->wdi2_ctx.dbg_stats.uc_dbg_stats_mmio) { IPAERR("bad NULL parms for wdi_gsi_stats\n"); return -EINVAL; } - num_chs = ipa3_ctx->wdi2_ctx.dbg_stats.uc_dbg_stats_size - / sizeof(struct IpaHwRingStats_t); IPA_ACTIVE_CLIENTS_INC_SIMPLE(); - for (i = 0; i < num_chs; i++) { + for (i = 0; i < MAX_WDI2_CHANNELS; i++) { stats->ring[i].ringFull = ioread32( ipa3_ctx->wdi2_ctx.dbg_stats.uc_dbg_stats_mmio + i * IPA3_UC_DEBUG_STATS_OFF + diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c index 77e9281ad639..f5aa6698df80 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c @@ -930,17 +930,15 @@ exit: */ int ipa3_get_wdi3_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) { - int i, num_chs; + int i; if (!ipa3_ctx->wdi3_ctx.dbg_stats.uc_dbg_stats_mmio) { IPAERR("bad NULL parms for wdi3_gsi_stats\n"); return -EINVAL; } - num_chs = ipa3_ctx->wdi3_ctx.dbg_stats.uc_dbg_stats_size - / sizeof(struct IpaHwRingStats_t); IPA_ACTIVE_CLIENTS_INC_SIMPLE(); - for (i = 0; i < num_chs; i++) { + for (i = 0; i < MAX_WDI3_CHANNELS; i++) { stats->ring[i].ringFull = ioread32( ipa3_ctx->wdi3_ctx.dbg_stats.uc_dbg_stats_mmio + i * IPA3_UC_DEBUG_STATS_OFF +