Prechádzať zdrojové kódy

qcacld-3.0: Modify DSC trans assert to check ancestors

Currently, APIs in the dsc_*_trans_assert() family assert a transition
is in flight on the given node itself. Instead, replace this API family
with another, dsc_*_assert_trans_protected(), which assert a
transition is in flight on the given node or any of its ancestors.

Change-Id: I5fb07000f955a49a4e5529806f4e49d9dbc8acb7
CRs-Fixed: 2347789
Dustin Brown 6 rokov pred
rodič
commit
c35ea2d785

+ 4 - 3
components/dsc/inc/wlan_dsc_driver.h

@@ -96,12 +96,13 @@ dsc_driver_trans_start_wait(struct dsc_driver *driver, const char *desc);
 void dsc_driver_trans_stop(struct dsc_driver *driver);
 
 /**
- * dsc_driver_trans_assert() - assert transition in flight on @driver
- * @driver: the driver to assert transition in flight on
+ * dsc_driver_assert_trans_protected() - assert @driver is protected by a
+ *	transition
+ * @driver: the driver to check
  *
  * Return: None
  */
-void dsc_driver_trans_assert(struct dsc_driver *driver);
+void dsc_driver_assert_trans_protected(struct dsc_driver *driver);
 
 /**
  * dsc_driver_op_start() - start an operation on @driver

+ 5 - 3
components/dsc/inc/wlan_dsc_psoc.h

@@ -101,12 +101,14 @@ QDF_STATUS dsc_psoc_trans_start_wait(struct dsc_psoc *psoc, const char *desc);
 void dsc_psoc_trans_stop(struct dsc_psoc *psoc);
 
 /**
- * dsc_psoc_trans_assert() - assert transition in flight on @psoc
- * @psoc: the psoc to assert transition in flight on
+ * dsc_psoc_assert_trans_protected() - assert @psoc is protected by a transition
+ * @psoc: the psoc to check
+ *
+ * The protecting transition may be in flight on @psoc or its parent.
  *
  * Return: None
  */
-void dsc_psoc_trans_assert(struct dsc_psoc *psoc);
+void dsc_psoc_assert_trans_protected(struct dsc_psoc *psoc);
 
 /**
  * dsc_psoc_op_start() - start an operation on @psoc

+ 5 - 3
components/dsc/inc/wlan_dsc_vdev.h

@@ -99,12 +99,14 @@ QDF_STATUS dsc_vdev_trans_start_wait(struct dsc_vdev *vdev, const char *desc);
 void dsc_vdev_trans_stop(struct dsc_vdev *vdev);
 
 /**
- * dsc_vdev_trans_assert() - assert transition in flight on @vdev
- * @vdev: the vdev to assert transition in flight on
+ * dsc_vdev_assert_trans_protected() - assert @vdev is protected by a transition
+ * @vdev: the vdev to check
+ *
+ * The protecting transition may be in flight on @vdev or its ancestors.
  *
  * Return: None
  */
-void dsc_vdev_trans_assert(struct dsc_vdev *vdev);
+void dsc_vdev_assert_trans_protected(struct dsc_vdev *vdev);
 
 /**
  * dsc_vdev_op_start() - start an operation on @vdev

+ 3 - 3
components/dsc/src/wlan_dsc_driver.c

@@ -271,7 +271,7 @@ void dsc_driver_trans_stop(struct dsc_driver *driver)
 	dsc_exit();
 }
 
-static void __dsc_driver_trans_assert(struct dsc_driver *driver)
+static void __dsc_driver_assert_trans_protected(struct dsc_driver *driver)
 {
 	if (!dsc_assert(driver))
 		return;
@@ -281,10 +281,10 @@ static void __dsc_driver_trans_assert(struct dsc_driver *driver)
 	__dsc_unlock(driver);
 }
 
-void dsc_driver_trans_assert(struct dsc_driver *driver)
+void dsc_driver_assert_trans_protected(struct dsc_driver *driver)
 {
 	dsc_enter();
-	__dsc_driver_trans_assert(driver);
+	__dsc_driver_assert_trans_protected(driver);
 	dsc_exit();
 }
 

+ 5 - 4
components/dsc/src/wlan_dsc_psoc.c

@@ -260,20 +260,21 @@ void dsc_psoc_trans_stop(struct dsc_psoc *psoc)
 	dsc_exit();
 }
 
-static void __dsc_psoc_trans_assert(struct dsc_psoc *psoc)
+static void __dsc_psoc_assert_trans_protected(struct dsc_psoc *psoc)
 {
 	if (!dsc_assert(psoc))
 		return;
 
 	__dsc_driver_lock(psoc);
-	dsc_assert(__dsc_trans_active(&psoc->trans));
+	dsc_assert(__dsc_trans_active(&psoc->trans) ||
+		   __dsc_trans_active(&psoc->driver->trans));
 	__dsc_driver_unlock(psoc);
 }
 
-void dsc_psoc_trans_assert(struct dsc_psoc *psoc)
+void dsc_psoc_assert_trans_protected(struct dsc_psoc *psoc)
 {
 	dsc_enter();
-	__dsc_psoc_trans_assert(psoc);
+	__dsc_psoc_assert_trans_protected(psoc);
 	dsc_exit();
 }
 

+ 6 - 4
components/dsc/src/wlan_dsc_vdev.c

@@ -231,20 +231,22 @@ void dsc_vdev_trans_stop(struct dsc_vdev *vdev)
 	dsc_exit();
 }
 
-static void __dsc_vdev_trans_assert(struct dsc_vdev *vdev)
+static void __dsc_vdev_assert_trans_protected(struct dsc_vdev *vdev)
 {
 	if (!dsc_assert(vdev))
 		return;
 
 	__dsc_driver_lock(vdev);
-	dsc_assert(__dsc_trans_active(&vdev->trans));
+	dsc_assert(__dsc_trans_active(&vdev->trans) ||
+		   __dsc_trans_active(&vdev->psoc->trans) ||
+		   __dsc_trans_active(&vdev->psoc->driver->trans));
 	__dsc_driver_unlock(vdev);
 }
 
-void dsc_vdev_trans_assert(struct dsc_vdev *vdev)
+void dsc_vdev_assert_trans_protected(struct dsc_vdev *vdev)
 {
 	dsc_enter();
-	__dsc_vdev_trans_assert(vdev);
+	__dsc_vdev_assert_trans_protected(vdev);
 	dsc_exit();
 }