qcacmn: Fix wrong register window access
In register select window if the register offset falls in the last stored register window in driver, register window remap is not done. There is a case if platform driver accesses the hardware registers and remaps the register window, then driver wont be aware of this and have the wrong cached register window. So when driver tries to write or read it selects the wrong register window and accesses wrong register address. So fix this by always doing the register window remap. Change-Id: Ic38cc8cc3d9d82a3534f5ea356027db324c9fe13 CRs-Fixed: 2477771
This commit is contained in:

committed by
nshrivas

parent
4dc5e1f636
commit
830542f0d1
@@ -90,6 +90,16 @@ static inline int hal_force_wake_release(struct hal_soc *soc)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PCIE_REG_WINDOW_LOCAL_NO_CACHE
|
||||
static inline void hal_select_window(struct hal_soc *hal_soc, uint32_t offset)
|
||||
{
|
||||
uint32_t window = (offset >> WINDOW_SHIFT) & WINDOW_VALUE_MASK;
|
||||
|
||||
qdf_iowrite32(hal_soc->dev_base_addr + WINDOW_REG_ADDRESS,
|
||||
WINDOW_ENABLE_BIT | window);
|
||||
hal_soc->register_window = window;
|
||||
}
|
||||
#else
|
||||
static inline void hal_select_window(struct hal_soc *hal_soc, uint32_t offset)
|
||||
{
|
||||
uint32_t window = (offset >> WINDOW_SHIFT) & WINDOW_VALUE_MASK;
|
||||
@@ -99,6 +109,7 @@ static inline void hal_select_window(struct hal_soc *hal_soc, uint32_t offset)
|
||||
hal_soc->register_window = window;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* note1: WINDOW_RANGE_MASK = (1 << WINDOW_SHIFT) -1
|
||||
|
Reference in New Issue
Block a user