diff options
| author | Govind Singh <govinds@qti.qualcomm.com> | 2016-07-19 11:02:26 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-07-20 14:39:01 +0530 |
| commit | 9dec1cda6c452f994cd22e502cd74b2910fae36e (patch) | |
| tree | 0fd1e131da9a6cd64469c9b6ceaf9b0c7208dc1e | |
| parent | a7f50f1f93b1980ca2f8424950d08871c7579133 (diff) | |
qcacld-2.0: Initlialize hif irq index using atomic operation
hif irq record index is atomic variable. Initlialize hif irq
index using atomic operation.
Change-Id: I75694eb8ab54bfb7622061405f5192832ba8be99
CRs-Fixed: 1039967
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 0e8edec7b286..086ee60325ba 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -154,10 +154,10 @@ typedef struct { } hif_irq_history; #define HIF_IRQ_HISTORY_MAX 1024 -adf_os_atomic_t g_hif_irq_history_idx = 0; +adf_os_atomic_t g_hif_irq_history_idx; hif_irq_history hif_irq_history_buffer[HIF_IRQ_HISTORY_MAX]; -void hif_irq_record(hif_irq_type type, struct hif_pci_softc *sc) +static void hif_irq_record(hif_irq_type type, struct hif_pci_softc *sc) { struct HIF_CE_state *hif_state = (struct HIF_CE_state *)sc->hif_device; A_target_id_t targid = hif_state->targid; @@ -192,8 +192,21 @@ out: hif_irq_history_buffer[record_index].time = adf_get_boottime(); } + +/** + * hif_irq_record_index_init() - initialize the hif irq index + * + * initialize the hif irq record index. + * Return: none + */ +static void hif_irq_record_index_init(void) +{ + adf_os_atomic_init(&g_hif_irq_history_idx); +} + #else -void hif_irq_record(hif_irq_type type, struct hif_pci_softc *sc) {}; +static void hif_irq_record(hif_irq_type type, struct hif_pci_softc *sc) {}; +static void hif_irq_record_index_init(void) {}; #endif #ifndef REMOVE_PKT_LOG @@ -1732,6 +1745,7 @@ again: #endif adf_os_atomic_init(&sc->ce_suspend); adf_os_atomic_init(&sc->pci_link_suspended); + hif_irq_record_index_init(); init_waitqueue_head(&ol_sc->sc_osdev->event_queue); ret = hif_init_adf_ctx(ol_sc); |
