qcacmn: sanity checks in hal_attach
In case of memory allocation failures, return appropriate failure to the caller in hal attach. Change-Id: Ifc319bbc274d8a13836968d460eb8067857363b8 CRs-Fixed: 3357203
Tento commit je obsažen v:

odevzdal
Madan Koyyalamudi

rodič
70c9b142e8
revize
166a30648f
@@ -2973,9 +2973,9 @@ static void hal_reo_shared_qaddr_write_be(hal_soc_handle_t hal_soc_hdl,
|
||||
*
|
||||
* @hal_soc: HAL Soc handle
|
||||
*
|
||||
* Return: None
|
||||
* Return: QDF_STATUS_SUCCESS on success else a QDF error.
|
||||
*/
|
||||
static void 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 hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
|
||||
|
||||
@@ -2986,11 +2986,23 @@ static void hal_reo_shared_qaddr_setup_be(hal_soc_handle_t hal_soc_hdl)
|
||||
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)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
hal->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) {
|
||||
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);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
hal_verbose_debug("MLO table start paddr:%pK,"
|
||||
"Non-MLO table start paddr:%pK,"
|
||||
@@ -3000,6 +3012,8 @@ static void hal_reo_shared_qaddr_setup_be(hal_soc_handle_t hal_soc_hdl)
|
||||
(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);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1257,7 +1257,7 @@ 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 */
|
||||
void (*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);
|
||||
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);
|
||||
|
@@ -781,15 +781,17 @@ void hal_reo_init_cmd_ring(hal_soc_handle_t hal_soc_hdl,
|
||||
* Allocate MLO and Non MLO table for storing REO queue
|
||||
* reference pointers
|
||||
*
|
||||
* Return: void
|
||||
* Return: QDF_STATUS_SUCCESS on success else a QDF error.
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl)
|
||||
{
|
||||
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 QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -810,9 +812,10 @@ hal_reo_shared_qaddr_detach(hal_soc_handle_t hal_soc_hdl)
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
hal_reo_shared_qaddr_setup(hal_soc_handle_t hal_soc_hdl)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@@ -1161,13 +1161,22 @@ void *hal_attach(struct hif_opaque_softc *hif_handle, qdf_device_t qdf_dev)
|
||||
qdf_minidump_log(hal, sizeof(*hal), "hal_soc");
|
||||
|
||||
qdf_atomic_init(&hal->active_work_cnt);
|
||||
hal_delayed_reg_write_init(hal);
|
||||
if (hal_delayed_reg_write_init(hal) != QDF_STATUS_SUCCESS) {
|
||||
hal_err("unable to initialize delayed reg write");
|
||||
goto fail3;
|
||||
}
|
||||
|
||||
hal_reo_shared_qaddr_setup((hal_soc_handle_t)hal);
|
||||
if (hal_reo_shared_qaddr_setup((hal_soc_handle_t)hal)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
hal_err("unable to setup reo shared qaddr");
|
||||
goto fail4;
|
||||
}
|
||||
|
||||
hif_rtpm_register(HIF_RTPM_ID_HAL_REO_CMD, NULL);
|
||||
|
||||
return (void *)hal;
|
||||
fail4:
|
||||
hal_delayed_reg_write_deinit(hal);
|
||||
fail3:
|
||||
qdf_mem_free_consistent(qdf_dev, qdf_dev->dev,
|
||||
sizeof(*hal->shadow_wrptr_mem_vaddr) *
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele