Browse Source

qcacmn: support PLD lock for window register accessing

Currently window register accessing with PLD lock is not enabled for
HIF path of KIWI, enable it so there is no race condition with HAL
register accessing path.

Change-Id: Iceeba36ca6febdeca0e7f7bc0dcb7d4adc17bc51
CRs-Fixed: 3110425
Jinwei Chen 3 năm trước cách đây
mục cha
commit
77530eea0b
2 tập tin đã thay đổi với 12 bổ sung13 xóa
  1. 6 7
      hal/wifi3.0/hal_api.h
  2. 6 6
      hif/src/hif_io32.h

+ 6 - 7
hal/wifi3.0/hal_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -129,30 +129,29 @@ static inline void hal_reg_write_result_check(struct hal_soc *hal_soc,
 	}
 }
 
-#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) && \
-    !defined(QCA_WIFI_KIWI)
+#ifdef WINDOW_REG_PLD_LOCK_ENABLE
 static inline void hal_lock_reg_access(struct hal_soc *soc,
 				       unsigned long *flags)
 {
-	qdf_spin_lock_irqsave(&soc->register_access_lock);
+	pld_lock_reg_window(soc->qdf_dev->dev, flags);
 }
 
 static inline void hal_unlock_reg_access(struct hal_soc *soc,
 					 unsigned long *flags)
 {
-	qdf_spin_unlock_irqrestore(&soc->register_access_lock);
+	pld_unlock_reg_window(soc->qdf_dev->dev, flags);
 }
 #else
 static inline void hal_lock_reg_access(struct hal_soc *soc,
 				       unsigned long *flags)
 {
-	pld_lock_reg_window(soc->qdf_dev->dev, flags);
+	qdf_spin_lock_irqsave(&soc->register_access_lock);
 }
 
 static inline void hal_unlock_reg_access(struct hal_soc *soc,
 					 unsigned long *flags)
 {
-	pld_unlock_reg_window(soc->qdf_dev->dev, flags);
+	qdf_spin_unlock_irqrestore(&soc->register_access_lock);
 }
 #endif
 

+ 6 - 6
hif/src/hif_io32.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -207,7 +207,7 @@ void hif_select_window_confirm(struct hif_pci_softc *sc, uint32_t offset)
 }
 #endif /* PCIE_REG_WINDOW_LOCAL_NO_CACHE */
 
-#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490)
+#ifdef WINDOW_REG_PLD_LOCK_ENABLE
 /**
  * hif_lock_reg_access() - Lock window register access spinlock
  * @sc: HIF handle
@@ -220,7 +220,7 @@ void hif_select_window_confirm(struct hif_pci_softc *sc, uint32_t offset)
 static inline void hif_lock_reg_access(struct hif_pci_softc *sc,
 				       unsigned long *flags)
 {
-	qdf_spin_lock_irqsave(&sc->register_access_lock);
+	pld_lock_reg_window(sc->dev, flags);
 }
 
 /**
@@ -235,19 +235,19 @@ static inline void hif_lock_reg_access(struct hif_pci_softc *sc,
 static inline void hif_unlock_reg_access(struct hif_pci_softc *sc,
 					 unsigned long *flags)
 {
-	qdf_spin_unlock_irqrestore(&sc->register_access_lock);
+	pld_unlock_reg_window(sc->dev, flags);
 }
 #else
 static inline void hif_lock_reg_access(struct hif_pci_softc *sc,
 				       unsigned long *flags)
 {
-	pld_lock_reg_window(sc->dev, flags);
+	qdf_spin_lock_irqsave(&sc->register_access_lock);
 }
 
 static inline void hif_unlock_reg_access(struct hif_pci_softc *sc,
 					 unsigned long *flags)
 {
-	pld_unlock_reg_window(sc->dev, flags);
+	qdf_spin_unlock_irqrestore(&sc->register_access_lock);
 }
 #endif