qcacmn: Check target ready before accessing registers on qca6750
Before accessing any register on chip 6750, check if target is ready or not. Do not allow register access if target is not ready. Change-Id: I41a604d04e861c97bdd676998222ccecbf12fd5a CRs-Fixed: 2688920
Этот коммит содержится в:

коммит произвёл
snandini

родитель
9d14f9d71a
Коммит
b00f74430d
@@ -269,6 +269,12 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset,
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
qdf_iomem_t new_addr;
|
qdf_iomem_t new_addr;
|
||||||
|
|
||||||
|
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||||
|
hal_soc->hif_handle))) {
|
||||||
|
hal_err_rl("%s: target access is not allowed", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Region < BAR + 4K can be directly accessed */
|
/* Region < BAR + 4K can be directly accessed */
|
||||||
if (offset < MAPPED_REF_OFF) {
|
if (offset < MAPPED_REF_OFF) {
|
||||||
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
||||||
@@ -323,6 +329,12 @@ static inline void hal_write32_mb_confirm(struct hal_soc *hal_soc,
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
qdf_iomem_t new_addr;
|
qdf_iomem_t new_addr;
|
||||||
|
|
||||||
|
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||||
|
hal_soc->hif_handle))) {
|
||||||
|
hal_err_rl("%s: target access is not allowed", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Region < BAR + 4K can be directly accessed */
|
/* Region < BAR + 4K can be directly accessed */
|
||||||
if (offset < MAPPED_REF_OFF) {
|
if (offset < MAPPED_REF_OFF) {
|
||||||
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
||||||
@@ -477,6 +489,12 @@ uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
qdf_iomem_t new_addr;
|
qdf_iomem_t new_addr;
|
||||||
|
|
||||||
|
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||||
|
hal_soc->hif_handle))) {
|
||||||
|
hal_err_rl("%s: target access is not allowed", __func__);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Region < BAR + 4K can be directly accessed */
|
/* Region < BAR + 4K can be directly accessed */
|
||||||
if (offset < MAPPED_REF_OFF)
|
if (offset < MAPPED_REF_OFF)
|
||||||
return qdf_ioread32(hal_soc->dev_base_addr + offset);
|
return qdf_ioread32(hal_soc->dev_base_addr + offset);
|
||||||
|
@@ -1516,6 +1516,21 @@ void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
|
|||||||
}
|
}
|
||||||
#endif /* FORCE_WAKE */
|
#endif /* FORCE_WAKE */
|
||||||
|
|
||||||
|
#ifdef HIF_IPCI
|
||||||
|
/**
|
||||||
|
* hif_shutdown_notifier_cb - Call back for shutdown notifier
|
||||||
|
* @ctx: hif handle
|
||||||
|
*
|
||||||
|
* Return: None
|
||||||
|
*/
|
||||||
|
void hif_shutdown_notifier_cb(void *ctx);
|
||||||
|
#else
|
||||||
|
static inline
|
||||||
|
void hif_shutdown_notifier_cb(void *ctx)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* HIF_IPCI */
|
||||||
|
|
||||||
#ifdef HIF_CE_LOG_INFO
|
#ifdef HIF_CE_LOG_INFO
|
||||||
/**
|
/**
|
||||||
* hif_log_ce_info() - API to log ce info
|
* hif_log_ce_info() - API to log ce info
|
||||||
|
@@ -98,8 +98,27 @@ uint32_t hif_read32_mb_reg_window(void *sc,
|
|||||||
#include "hif_io32_ipci.h"
|
#include "hif_io32_ipci.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HIF_REG_WINDOW_SUPPORT) && (defined(HIF_PCI) || \
|
#ifdef HIF_IPCI
|
||||||
defined(HIF_IPCI))
|
/**
|
||||||
|
* hif_target_access_allowed(): Check if target access is allowed
|
||||||
|
*
|
||||||
|
* @scn: HIF handler
|
||||||
|
*
|
||||||
|
* Return: True if access is allowed else False
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
bool hif_target_access_allowed(struct hif_softc *scn)
|
||||||
|
{
|
||||||
|
return !(scn->recovery);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TARGET_ACCESS_ALLOWED(scn) \
|
||||||
|
hif_target_access_allowed(scn)
|
||||||
|
#else
|
||||||
|
#define TARGET_ACCESS_ALLOWED(scn) (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HIF_REG_WINDOW_SUPPORT) && defined(HIF_PCI)
|
||||||
|
|
||||||
#include "qdf_lock.h"
|
#include "qdf_lock.h"
|
||||||
#include "qdf_util.h"
|
#include "qdf_util.h"
|
||||||
|
@@ -94,6 +94,15 @@ void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
|
|||||||
}
|
}
|
||||||
#endif /* FORCE_WAKE */
|
#endif /* FORCE_WAKE */
|
||||||
|
|
||||||
|
#ifdef HIF_IPCI
|
||||||
|
void hif_shutdown_notifier_cb(void *hif_ctx)
|
||||||
|
{
|
||||||
|
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
||||||
|
|
||||||
|
scn->recovery = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hif_vote_link_down(): unvote for link up
|
* hif_vote_link_down(): unvote for link up
|
||||||
*
|
*
|
||||||
|
Ссылка в новой задаче
Block a user