Skip to content

Commit 620055c

Browse files
iveceraPaolo Abeni
authored andcommitted
dpll: export __dpll_pin_change_ntf() for use under dpll_lock
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>
1 parent 6f9d839 commit 620055c

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/dpll/dpll_netlink.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,11 +900,21 @@ int dpll_pin_delete_ntf(struct dpll_pin *pin)
900900
return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin);
901901
}
902902

903+
/**
904+
* __dpll_pin_change_ntf - notify that the pin has been changed
905+
* @pin: registered pin pointer
906+
*
907+
* Context: caller must hold dpll_lock. Suitable for use inside pin
908+
* callbacks which are already invoked under dpll_lock.
909+
* Return: 0 if succeeds, error code otherwise.
910+
*/
903911
int __dpll_pin_change_ntf(struct dpll_pin *pin)
904912
{
913+
lockdep_assert_held(&dpll_lock);
905914
dpll_pin_notify(pin, DPLL_PIN_CHANGED);
906915
return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin);
907916
}
917+
EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf);
908918

909919
/**
910920
* dpll_pin_change_ntf - notify that the pin has been changed

drivers/dpll/dpll_netlink.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ int dpll_device_delete_ntf(struct dpll_device *dpll);
1111
int dpll_pin_create_ntf(struct dpll_pin *pin);
1212

1313
int dpll_pin_delete_ntf(struct dpll_pin *pin);
14-
15-
int __dpll_pin_change_ntf(struct dpll_pin *pin);

include/linux/dpll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin,
286286

287287
int dpll_device_change_ntf(struct dpll_device *dpll);
288288

289+
int __dpll_pin_change_ntf(struct dpll_pin *pin);
289290
int dpll_pin_change_ntf(struct dpll_pin *pin);
290291

291292
int register_dpll_notifier(struct notifier_block *nb);

0 commit comments

Comments
 (0)