RE: [PATCH iwl-net v7 1/3] dpll: export __dpll_pin_change_ntf() for use under dpll_lock

From: Kubalewski, Arkadiusz

Date: Mon Apr 27 2026 - 10:27:36 EST


>From: Petr Oros <poros@xxxxxxxxxx>
>Sent: Friday, April 17, 2026 4:59 PM
>
>From: Ivan Vecera <ivecera@xxxxxxxxxx>
>
>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@xxxxxxxxx>
>Signed-off-by: Ivan Vecera <ivecera@xxxxxxxxxx>

LGTM,
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@xxxxxxxxx>

>Signed-off-by: Petr Oros <poros@xxxxxxxxxx>
>---
> drivers/dpll/dpll_netlink.c | 10 ++++++++++
> drivers/dpll/dpll_netlink.h | 2 --
> include/linux/dpll.h | 1 +
> 3 files changed, 11 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
>index af7ce62ec55ca8..0ff1658c2dc1ba 100644
>--- a/drivers/dpll/dpll_netlink.c
>+++ b/drivers/dpll/dpll_netlink.c
>@@ -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
>diff --git a/drivers/dpll/dpll_netlink.h b/drivers/dpll/dpll_netlink.h
>index dd28b56d27c56d..a9cfd55f57fc42 100644
>--- a/drivers/dpll/dpll_netlink.h
>+++ b/drivers/dpll/dpll_netlink.h
>@@ -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);
>diff --git a/include/linux/dpll.h b/include/linux/dpll.h
>index b7277a8b484d26..f8037f1ab20b60 100644
>--- a/include/linux/dpll.h
>+++ b/include/linux/dpll.h
>@@ -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);
>--
>2.52.0