]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dpll: export __dpll_pin_change_ntf() for use under dpll_lock
authorIvan Vecera <ivecera@redhat.com>
Tue, 28 Apr 2026 05:22:21 +0000 (22:22 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 30 Apr 2026 09:37:39 +0000 (11:37 +0200)
Export __dpll_pin_change_ntf() so that drivers can send pin change
notifications from within pin callbacks, which are already called
under dpll_lock. Using dpll_pin_change_ntf() in that context would
deadlock.

Add lockdep_assert_held() to catch misuse without the lock held.

Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Petr Oros <poros@redhat.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260427-jk-iwl-net-petr-oros-fixes-v1-9-cdcb48303fd8@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/dpll/dpll_netlink.c
drivers/dpll/dpll_netlink.h
include/linux/dpll.h

index af7ce62ec55ca8bb916896454530059456c7226a..0ff1658c2dc1baca3b6b26213a5b4fe08266fe23 100644 (file)
@@ -900,11 +900,21 @@ int dpll_pin_delete_ntf(struct dpll_pin *pin)
        return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin);
 }
 
+/**
+ * __dpll_pin_change_ntf - notify that the pin has been changed
+ * @pin: registered pin pointer
+ *
+ * Context: caller must hold dpll_lock. Suitable for use inside pin
+ *          callbacks which are already invoked under dpll_lock.
+ * Return: 0 if succeeds, error code otherwise.
+ */
 int __dpll_pin_change_ntf(struct dpll_pin *pin)
 {
+       lockdep_assert_held(&dpll_lock);
        dpll_pin_notify(pin, DPLL_PIN_CHANGED);
        return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin);
 }
+EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf);
 
 /**
  * dpll_pin_change_ntf - notify that the pin has been changed
index dd28b56d27c56dd37f63bf13fff6bcb0475656c6..a9cfd55f57fc4281bacaac53d5ca959906121209 100644 (file)
@@ -11,5 +11,3 @@ int dpll_device_delete_ntf(struct dpll_device *dpll);
 int dpll_pin_create_ntf(struct dpll_pin *pin);
 
 int dpll_pin_delete_ntf(struct dpll_pin *pin);
-
-int __dpll_pin_change_ntf(struct dpll_pin *pin);
index b7277a8b484d264019ed67cf8ef8bc1aa9f638a7..f8037f1ab20b60c1ba1f5edd8391df19f47ef933 100644 (file)
@@ -286,6 +286,7 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin,
 
 int dpll_device_change_ntf(struct dpll_device *dpll);
 
+int __dpll_pin_change_ntf(struct dpll_pin *pin);
 int dpll_pin_change_ntf(struct dpll_pin *pin);
 
 int register_dpll_notifier(struct notifier_block *nb);