mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
qcacld-3.0: Mark rx/fisa history prealloc as non-critical
Mark rx and fisa history related allocations as non critical for prealloc. This will ensure that prealloc init can continue when memory alloc fails for the above as these are only for debug purposes. Change-Id: I94fc5c35a3a7a5dae3a4c97cf4ceca4eee7372ca CRs-Fixed: 2936359
This commit is contained in:
parent
09238d6d51
commit
32ed81c857
1 changed files with 23 additions and 12 deletions
|
|
@ -272,37 +272,44 @@ struct dp_consistent_prealloc_unaligned {
|
|||
* @ctxt_type: DP context type
|
||||
* @size: size of pre-alloc memory
|
||||
* @in_use: check if element is being used
|
||||
* @is_critical: critical prealloc failure would cause prealloc_init to fail
|
||||
* @addr: address of memory allocated
|
||||
*/
|
||||
struct dp_prealloc_context {
|
||||
enum dp_ctxt_type ctxt_type;
|
||||
uint32_t size;
|
||||
bool in_use;
|
||||
bool is_critical;
|
||||
void *addr;
|
||||
};
|
||||
|
||||
static struct dp_prealloc_context g_dp_context_allocs[] = {
|
||||
{DP_PDEV_TYPE, (sizeof(struct dp_pdev)), false, NULL},
|
||||
{DP_PDEV_TYPE, (sizeof(struct dp_pdev)), false, true, NULL},
|
||||
#ifdef WLAN_FEATURE_DP_RX_RING_HISTORY
|
||||
/* 4 Rx ring history */
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, false,
|
||||
NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, false,
|
||||
NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, false,
|
||||
NULL},
|
||||
{DP_RX_RING_HIST_TYPE, sizeof(struct dp_rx_history), false, false,
|
||||
NULL},
|
||||
/* 1 Rx error ring history */
|
||||
{DP_RX_ERR_RING_HIST_TYPE, sizeof(struct dp_rx_err_history),
|
||||
false, NULL},
|
||||
false, false, NULL},
|
||||
#ifndef RX_DEFRAG_DO_NOT_REINJECT
|
||||
/* 1 Rx reinject ring history */
|
||||
{DP_RX_REINJECT_RING_HIST_TYPE, sizeof(struct dp_rx_reinject_history),
|
||||
false, NULL},
|
||||
false, false, NULL},
|
||||
#endif /* RX_DEFRAG_DO_NOT_REINJECT */
|
||||
/* 1 Rx refill ring history */
|
||||
{DP_RX_REFILL_RING_HIST_TYPE, sizeof(struct dp_rx_refill_history),
|
||||
false, NULL},
|
||||
false, false, NULL},
|
||||
#endif /* WLAN_FEATURE_DP_RX_RING_HISTORY */
|
||||
#ifdef WLAN_SUPPORT_RX_FISA
|
||||
{DP_FISA_RX_FT_TYPE, sizeof(struct dp_fisa_rx_sw_ft) * FISA_RX_FT_SIZE, false, NULL},
|
||||
{DP_FISA_RX_FT_TYPE, sizeof(struct dp_fisa_rx_sw_ft) * FISA_RX_FT_SIZE,
|
||||
false, true, NULL},
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -500,7 +507,7 @@ void dp_prealloc_deinit(void)
|
|||
|
||||
for (i = 0; i < QDF_ARRAY_SIZE(g_dp_context_allocs); i++) {
|
||||
cp = &g_dp_context_allocs[i];
|
||||
if (qdf_unlikely(up->in_use))
|
||||
if (qdf_unlikely(cp->in_use))
|
||||
dp_warn("i %d: context in use while free", i);
|
||||
|
||||
if (cp->addr) {
|
||||
|
|
@ -530,7 +537,7 @@ QDF_STATUS dp_prealloc_init(void)
|
|||
cp = &g_dp_context_allocs[i];
|
||||
cp->addr = qdf_mem_malloc(cp->size);
|
||||
|
||||
if (qdf_unlikely(!cp->addr)) {
|
||||
if (qdf_unlikely(!cp->addr) && cp->is_critical) {
|
||||
dp_warn("i %d: unable to preallocate %d bytes memory!",
|
||||
i, cp->size);
|
||||
break;
|
||||
|
|
@ -631,7 +638,8 @@ void *dp_prealloc_get_context_memory(uint32_t ctxt_type)
|
|||
for (i = 0; i < QDF_ARRAY_SIZE(g_dp_context_allocs); i++) {
|
||||
cp = &g_dp_context_allocs[i];
|
||||
|
||||
if ((ctxt_type == cp->ctxt_type) && !cp->in_use) {
|
||||
if ((ctxt_type == cp->ctxt_type) && !cp->in_use &&
|
||||
cp->addr) {
|
||||
cp->in_use = true;
|
||||
return cp->addr;
|
||||
}
|
||||
|
|
@ -645,6 +653,9 @@ QDF_STATUS dp_prealloc_put_context_memory(uint32_t ctxt_type, void *vaddr)
|
|||
int i;
|
||||
struct dp_prealloc_context *cp;
|
||||
|
||||
if (!vaddr)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
for (i = 0; i < QDF_ARRAY_SIZE(g_dp_context_allocs); i++) {
|
||||
cp = &g_dp_context_allocs[i];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue