From ebf8d638354f0fbc128184e81f3d68addb50c9ca Mon Sep 17 00:00:00 2001 From: Lin Bai Date: Tue, 12 Dec 2017 10:55:48 +0800 Subject: [PATCH] qcacmn: Fix athdiag regression caused by boundary check for QCA6290/QCA8074, input offset value will include memtype as well, which not covered by current boundary-check, and will fail it. Limited current boundary-check for legacy chip currently. CRs-Fixed: 2157285 Change-Id: Id1e1fd10b4539288c461c6403fd8110fd5056dd5 --- hif/src/pcie/if_pci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 52deaff084b0..6a3d6263c1fc 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -4474,6 +4474,19 @@ int hif_pci_legacy_map_ce_to_irq(struct hif_softc *scn, int ce_id) int hif_pci_addr_in_boundary(struct hif_softc *scn, uint32_t offset) { struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); + struct hif_target_info *tgt_info; + + tgt_info = hif_get_target_info_handle(GET_HIF_OPAQUE_HDL(scn)); + + if (tgt_info->target_type == TARGET_TYPE_QCA6290 || + tgt_info->target_type == TARGET_TYPE_QCA8074) { + /* + * Need to consider offset's memtype for QCA6290/QCA8074, + * also mem_len and DRAM_BASE_ADDRESS/DRAM_SIZE need to be + * well initialized/defined. + */ + return 0; + } if ((offset >= DRAM_BASE_ADDRESS && offset <= DRAM_BASE_ADDRESS + DRAM_SIZE) || (offset + sizeof(unsigned int) <= sc->mem_len)) {