Bläddra i källkod

qcacmn: Disable the PCIE scratch reg write for wake req handshake

Disable the PCIE scratch reg read/write to wake up PCI bus.
This fixes the PCNOC error seen during boot up on writing to
the PCIE scratch register.
Enable DEVICE_FORCE_WAKE_ENABLE feature flag to enable
PCIE sracth reg read/write.

Change-Id: If4efd0afbddf97462bf9d0f06d0085c0a5b37a64
CRs-Fixed: 2636160
Nisha Menon 5 år sedan
förälder
incheckning
df7fb3627f
1 ändrade filer med 34 tillägg och 0 borttagningar
  1. 34 0
      hif/src/pcie/if_pci.c

+ 34 - 0
hif/src/pcie/if_pci.c

@@ -4762,6 +4762,7 @@ bool hif_pci_needs_bmi(struct hif_softc *scn)
 }
 
 #ifdef FORCE_WAKE
+#ifdef DEVICE_FORCE_WAKE_ENABLE
 int hif_force_wake_request(struct hif_opaque_softc *hif_handle)
 {
 	uint32_t timeout = 0, value;
@@ -4818,9 +4819,42 @@ int hif_force_wake_request(struct hif_opaque_softc *hif_handle)
 	}
 
 	HIF_STATS_INC(pci_scn, soc_force_wake_success, 1);
+	return 0;
+}
+
+#else /* DEVICE_FORCE_WAKE_ENABLE */
+/** hif_force_wake_request() - Disable the PCIE scratch register
+ * write/read
+ *
+ * Return: 0
+ */
+int hif_force_wake_request(struct hif_opaque_softc *hif_handle)
+{
+	uint32_t timeout = 0;
+	struct hif_softc *scn = (struct hif_softc *)hif_handle;
+	struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn);
+
+	if (pld_force_wake_request(scn->qdf_dev->dev)) {
+		hif_err("force wake request send failed");
+		return -EINVAL;
+	}
+
+	HIF_STATS_INC(pci_scn, mhi_force_wake_request_vote, 1);
+	while (!pld_is_device_awake(scn->qdf_dev->dev) &&
+	       timeout <= FORCE_WAKE_DELAY_TIMEOUT_MS) {
+		qdf_mdelay(FORCE_WAKE_DELAY_MS);
+		timeout += FORCE_WAKE_DELAY_MS;
+	}
 
+	if (pld_is_device_awake(scn->qdf_dev->dev) <= 0) {
+		hif_err("Unable to wake up mhi");
+		HIF_STATS_INC(pci_scn, mhi_force_wake_failure, 1);
+		return -EINVAL;
+	}
+	HIF_STATS_INC(pci_scn, mhi_force_wake_success, 1);
 	return 0;
 }
+#endif /* DEVICE_FORCE_WAKE_ENABLE */
 
 int hif_force_wake_release(struct hif_opaque_softc *hif_handle)
 {