qcacmn: alloc reo qref table in dp_soc_attach
change allocation location for reo qref table. per probe allocation results in mem alloc failure when frame is fragmented Change-Id: I5922bddebcd0577ba38734ae7d4194d726d825aa CRs-Fixed: 3326520
This commit is contained in:

committed by
Madan Koyyalamudi

parent
b4b8c2933f
commit
11742e7129
@@ -688,12 +688,25 @@ QDF_STATUS dp_peer_setup_ppeds_be(struct dp_soc *soc, struct dp_peer *peer,
|
||||
}
|
||||
#endif /* WLAN_SUPPORT_PPEDS */
|
||||
|
||||
void dp_reo_shared_qaddr_detach(struct dp_soc *soc)
|
||||
{
|
||||
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
||||
REO_QUEUE_REF_ML_TABLE_SIZE,
|
||||
soc->reo_qref.mlo_reo_qref_table_vaddr,
|
||||
soc->reo_qref.mlo_reo_qref_table_paddr, 0);
|
||||
qdf_mem_free_consistent(soc->osdev, soc->osdev->dev,
|
||||
REO_QUEUE_REF_NON_ML_TABLE_SIZE,
|
||||
soc->reo_qref.non_mlo_reo_qref_table_vaddr,
|
||||
soc->reo_qref.non_mlo_reo_qref_table_paddr, 0);
|
||||
}
|
||||
|
||||
static QDF_STATUS dp_soc_detach_be(struct dp_soc *soc)
|
||||
{
|
||||
struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc);
|
||||
int i = 0;
|
||||
|
||||
dp_soc_ppeds_detach_be(soc);
|
||||
dp_reo_shared_qaddr_detach(soc);
|
||||
|
||||
for (i = 0; i < MAX_TXDESC_POOLS; i++)
|
||||
dp_hw_cookie_conversion_detach(be_soc,
|
||||
|
@@ -628,6 +628,8 @@ dp_hw_cookie_conversion_attach(struct dp_soc_be *be_soc,
|
||||
enum dp_desc_type desc_type,
|
||||
uint8_t desc_pool_id);
|
||||
|
||||
void dp_reo_shared_qaddr_detach(struct dp_soc *soc);
|
||||
|
||||
QDF_STATUS
|
||||
dp_hw_cookie_conversion_detach(struct dp_soc_be *be_soc,
|
||||
struct dp_hw_cookie_conversion_t *cc_ctx);
|
||||
|
@@ -7072,6 +7072,7 @@ dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc)
|
||||
if (wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx))
|
||||
reo_params.alt_dst_ind_0 = REO_REMAP_RELEASE;
|
||||
|
||||
reo_params.reo_qref = &soc->reo_qref;
|
||||
hal_reo_setup(soc->hal_soc, &reo_params, 1);
|
||||
|
||||
hal_reo_set_err_dst_remap(soc->hal_soc);
|
||||
@@ -13841,6 +13842,7 @@ static void dp_set_umac_regs(struct dp_soc *soc)
|
||||
reo_params.rx_hash_enabled = false;
|
||||
}
|
||||
|
||||
reo_params.reo_qref = &soc->reo_qref;
|
||||
hal_reo_setup(soc->hal_soc, &reo_params, 0);
|
||||
|
||||
soc->arch_ops.dp_cc_reg_cfg_init(soc, true);
|
||||
@@ -15657,6 +15659,13 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
|
||||
}
|
||||
}
|
||||
|
||||
if (hal_reo_shared_qaddr_setup((hal_soc_handle_t)soc->hal_soc,
|
||||
&soc->reo_qref)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
dp_err("unable to setup reo shared qaddr");
|
||||
goto fail9;
|
||||
}
|
||||
|
||||
if (dp_sysfs_initialize_stats(soc) != QDF_STATUS_SUCCESS) {
|
||||
dp_err("failed to initialize dp stats sysfs file");
|
||||
dp_sysfs_deinitialize_stats(soc);
|
||||
@@ -15672,6 +15681,9 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
|
||||
qdf_skb_total_mem_stats_read());
|
||||
|
||||
return soc;
|
||||
fail9:
|
||||
if (!dp_monitor_modularized_enable())
|
||||
dp_mon_soc_detach_wrapper(soc);
|
||||
fail8:
|
||||
dp_soc_tx_desc_sw_pools_free(soc);
|
||||
fail7:
|
||||
|
@@ -3001,6 +3001,8 @@ struct dp_soc {
|
||||
/* number of IPv6 flows inserted */
|
||||
qdf_atomic_t ipv6_fse_cnt;
|
||||
#endif
|
||||
/* Reo queue ref table items */
|
||||
struct reo_queue_ref_table reo_qref;
|
||||
};
|
||||
|
||||
#ifdef IPA_OFFLOAD
|
||||
|
@@ -2974,32 +2974,35 @@ static void hal_reo_shared_qaddr_write_be(hal_soc_handle_t hal_soc_hdl,
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success else a QDF error.
|
||||
*/
|
||||
static QDF_STATUS hal_reo_shared_qaddr_setup_be(hal_soc_handle_t hal_soc_hdl)
|
||||
static QDF_STATUS
|
||||
hal_reo_shared_qaddr_setup_be(hal_soc_handle_t hal_soc_hdl,
|
||||
struct reo_queue_ref_table *reo_qref)
|
||||
{
|
||||
struct hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
|
||||
|
||||
hal->reo_qref.reo_qref_table_en = 1;
|
||||
reo_qref->reo_qref_table_en = 1;
|
||||
|
||||
hal->reo_qref.mlo_reo_qref_table_vaddr =
|
||||
reo_qref->mlo_reo_qref_table_vaddr =
|
||||
(uint64_t *)qdf_mem_alloc_consistent(
|
||||
hal->qdf_dev, hal->qdf_dev->dev,
|
||||
REO_QUEUE_REF_ML_TABLE_SIZE,
|
||||
&hal->reo_qref.mlo_reo_qref_table_paddr);
|
||||
if (!hal->reo_qref.mlo_reo_qref_table_vaddr)
|
||||
&reo_qref->mlo_reo_qref_table_paddr);
|
||||
if (!reo_qref->mlo_reo_qref_table_vaddr)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
hal->reo_qref.non_mlo_reo_qref_table_vaddr =
|
||||
reo_qref->non_mlo_reo_qref_table_vaddr =
|
||||
(uint64_t *)qdf_mem_alloc_consistent(
|
||||
hal->qdf_dev, hal->qdf_dev->dev,
|
||||
REO_QUEUE_REF_NON_ML_TABLE_SIZE,
|
||||
&hal->reo_qref.non_mlo_reo_qref_table_paddr);
|
||||
if (!hal->reo_qref.non_mlo_reo_qref_table_vaddr) {
|
||||
&reo_qref->non_mlo_reo_qref_table_paddr);
|
||||
if (!reo_qref->non_mlo_reo_qref_table_vaddr) {
|
||||
qdf_mem_free_consistent(
|
||||
hal->qdf_dev, hal->qdf_dev->dev,
|
||||
REO_QUEUE_REF_ML_TABLE_SIZE,
|
||||
hal->reo_qref.mlo_reo_qref_table_vaddr,
|
||||
hal->reo_qref.mlo_reo_qref_table_paddr,
|
||||
reo_qref->mlo_reo_qref_table_vaddr,
|
||||
reo_qref->mlo_reo_qref_table_paddr,
|
||||
0);
|
||||
reo_qref->mlo_reo_qref_table_vaddr = NULL;
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
@@ -3007,10 +3010,10 @@ static QDF_STATUS hal_reo_shared_qaddr_setup_be(hal_soc_handle_t hal_soc_hdl)
|
||||
"Non-MLO table start paddr:%pK,"
|
||||
"MLO table start vaddr: %pK,"
|
||||
"Non MLO table start vaddr: %pK",
|
||||
(void *)hal->reo_qref.mlo_reo_qref_table_paddr,
|
||||
(void *)hal->reo_qref.non_mlo_reo_qref_table_paddr,
|
||||
hal->reo_qref.mlo_reo_qref_table_vaddr,
|
||||
hal->reo_qref.non_mlo_reo_qref_table_vaddr);
|
||||
(void *)reo_qref->mlo_reo_qref_table_paddr,
|
||||
(void *)reo_qref->non_mlo_reo_qref_table_paddr,
|
||||
reo_qref->mlo_reo_qref_table_vaddr,
|
||||
reo_qref->non_mlo_reo_qref_table_vaddr);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3073,15 +3076,6 @@ static void hal_reo_shared_qaddr_detach_be(hal_soc_handle_t hal_soc_hdl)
|
||||
HAL_REG_WRITE(hal,
|
||||
HWIO_REO_R0_QDESC_LUT_BASE1_ADDR_ADDR(REO_REG_REG_BASE),
|
||||
0);
|
||||
|
||||
qdf_mem_free_consistent(hal->qdf_dev, hal->qdf_dev->dev,
|
||||
REO_QUEUE_REF_ML_TABLE_SIZE,
|
||||
hal->reo_qref.mlo_reo_qref_table_vaddr,
|
||||
hal->reo_qref.mlo_reo_qref_table_paddr, 0);
|
||||
qdf_mem_free_consistent(hal->qdf_dev, hal->qdf_dev->dev,
|
||||
REO_QUEUE_REF_NON_ML_TABLE_SIZE,
|
||||
hal->reo_qref.non_mlo_reo_qref_table_vaddr,
|
||||
hal->reo_qref.non_mlo_reo_qref_table_paddr, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -845,8 +845,8 @@ struct hal_reo_params {
|
||||
uint8_t frag_dst_ring;
|
||||
/* Destination for alternate */
|
||||
uint8_t alt_dst_ind_0;
|
||||
/** padding */
|
||||
uint8_t padding[2];
|
||||
/* reo_qref struct for mlo and non mlo table */
|
||||
struct reo_queue_ref_table *reo_qref;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -897,6 +897,22 @@ struct hal_rx_pkt_capture_flags {
|
||||
uint64_t tsft;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct reo_queue_ref_table - Reo qref LUT addr
|
||||
* @mlo_reo_qref_table_vaddr: MLO table vaddr
|
||||
* @non_mlo_reo_qref_table_vaddr: Non MLO table vaddr
|
||||
* @mlo_reo_qref_table_paddr: MLO table paddr
|
||||
* @non_mlo_reo_qref_table_paddr: Non MLO table paddr
|
||||
* @reo_qref_table_en: Enable flag
|
||||
*/
|
||||
struct reo_queue_ref_table {
|
||||
uint64_t *mlo_reo_qref_table_vaddr;
|
||||
uint64_t *non_mlo_reo_qref_table_vaddr;
|
||||
qdf_dma_addr_t mlo_reo_qref_table_paddr;
|
||||
qdf_dma_addr_t non_mlo_reo_qref_table_paddr;
|
||||
uint8_t reo_qref_table_en;
|
||||
};
|
||||
|
||||
struct hal_hw_txrx_ops {
|
||||
/* init and setup */
|
||||
void (*hal_srng_dst_hw_init)(struct hal_soc *hal,
|
||||
@@ -1260,7 +1276,9 @@ struct hal_hw_txrx_ops {
|
||||
uint32_t (*hal_txmon_status_get_num_users)(void *tx_tlv_hdr,
|
||||
uint8_t *num_users);
|
||||
#endif /* QCA_MONITOR_2_0_SUPPORT */
|
||||
QDF_STATUS (*hal_reo_shared_qaddr_setup)(hal_soc_handle_t hal_soc_hdl);
|
||||
QDF_STATUS (*hal_reo_shared_qaddr_setup)(hal_soc_handle_t hal_soc_hdl,
|
||||
struct reo_queue_ref_table
|
||||
*reo_qref);
|
||||
void (*hal_reo_shared_qaddr_init)(hal_soc_handle_t hal_soc_hdl,
|
||||
int qref_reset);
|
||||
void (*hal_reo_shared_qaddr_detach)(hal_soc_handle_t hal_soc_hdl);
|
||||
@@ -1359,22 +1377,6 @@ struct hal_reg_write_fail_history {
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct reo_queue_ref_table - Reo qref LUT addr
|
||||
* @mlo_reo_qref_table_vaddr: MLO table vaddr
|
||||
* @non_mlo_reo_qref_table_vaddr: Non MLO table vaddr
|
||||
* @mlo_reo_qref_table_paddr: MLO table paddr
|
||||
* @non_mlo_reo_qref_table_paddr: Non MLO table paddr
|
||||
* @reo_qref_table_en: Enable flag
|
||||
*/
|
||||
struct reo_queue_ref_table {
|
||||
uint64_t *mlo_reo_qref_table_vaddr;
|
||||
uint64_t *non_mlo_reo_qref_table_vaddr;
|
||||
qdf_dma_addr_t mlo_reo_qref_table_paddr;
|
||||
qdf_dma_addr_t non_mlo_reo_qref_table_paddr;
|
||||
uint8_t reo_qref_table_en;
|
||||
};
|
||||
|
||||
/**
|
||||
* union hal_shadow_reg_cfg - Shadow register config
|
||||
* @addr: Place holder where shadow address is saved
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -784,12 +784,14 @@ void hal_reo_init_cmd_ring(hal_soc_handle_t hal_soc_hdl,
|
||||
* Return: QDF_STATUS_SUCCESS on success else a QDF error.
|
||||
*/
|
||||
static inline QDF_STATUS
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl)
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl,
|
||||
struct reo_queue_ref_table *reo_qref)
|
||||
{
|
||||
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
|
||||
|
||||
if (hal_soc->ops->hal_reo_shared_qaddr_setup)
|
||||
return hal_soc->ops->hal_reo_shared_qaddr_setup(hal_soc_hdl);
|
||||
return hal_soc->ops->hal_reo_shared_qaddr_setup(hal_soc_hdl,
|
||||
reo_qref);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -813,7 +815,8 @@ hal_reo_shared_qaddr_detach(hal_soc_handle_t hal_soc_hdl)
|
||||
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl)
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl,
|
||||
struct reo_queue_ref_table *reo_qref)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -1170,17 +1170,9 @@ void *hal_attach(struct hif_opaque_softc *hif_handle, qdf_device_t qdf_dev)
|
||||
goto fail4;
|
||||
}
|
||||
|
||||
if (hal_reo_shared_qaddr_setup((hal_soc_handle_t)hal)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
hal_err("unable to setup reo shared qaddr");
|
||||
goto fail5;
|
||||
}
|
||||
|
||||
hif_rtpm_register(HIF_RTPM_ID_HAL_REO_CMD, NULL);
|
||||
|
||||
return (void *)hal;
|
||||
fail5:
|
||||
hal_delayed_reg_write_deinit(hal);
|
||||
fail4:
|
||||
qdf_ssr_driver_dump_unregister_region("hal_soc");
|
||||
qdf_minidump_remove(hal, sizeof(*hal), "hal_soc");
|
||||
|
@@ -1271,6 +1271,7 @@ static void hal_reo_setup_5332(struct hal_soc *soc, void *reoparams,
|
||||
* GLOBAL_LINK_DESC_COUNT_CTRL
|
||||
*/
|
||||
|
||||
soc->reo_qref = *reo_params->reo_qref;
|
||||
hal_reo_shared_qaddr_init((hal_soc_handle_t)soc, qref_reset);
|
||||
}
|
||||
|
||||
|
@@ -1461,6 +1461,7 @@ static void hal_reo_setup_9224(struct hal_soc *soc, void *reoparams,
|
||||
* GLOBAL_LINK_DESC_COUNT_CTRL
|
||||
*/
|
||||
|
||||
soc->reo_qref = *reo_params->reo_qref;
|
||||
hal_reo_shared_qaddr_init((hal_soc_handle_t)soc, qref_reset);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user