Skip to content

Commit 7dc5b18

Browse files
kubalewskidavem330
authored andcommitted
dpll: fix register pin with unregistered parent pin
In case of multiple kernel module instances using the same dpll device: if only one registers dpll device, then only that one can register directly connected pins with a dpll device. When unregistered parent is responsible for determining if the muxed pin can be registered with it or not, the drivers need to be loaded in serialized order to work correctly - first the driver instance which registers the direct pins needs to be loaded, then the other instances could register muxed type pins. Allow registration of a pin with a parent even if the parent was not yet registered, thus allow ability for unserialized driver instance load order. Do not WARN_ON notification for unregistered pin, which can be invoked for described case, instead just return error. Fixes: 9431063 ("dpll: core: Add DPLL framework base functions") Fixes: 9d71b54 ("dpll: netlink: Add DPLL framework base functions") Reviewed-by: Jan Glaza <jan.glaza@intel.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent db2ec3c commit 7dc5b18

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/dpll/dpll_core.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ static u32 dpll_pin_xa_id;
2929
WARN_ON_ONCE(!xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
3030
#define ASSERT_DPLL_NOT_REGISTERED(d) \
3131
WARN_ON_ONCE(xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
32-
#define ASSERT_PIN_REGISTERED(p) \
33-
WARN_ON_ONCE(!xa_get_mark(&dpll_pin_xa, (p)->id, DPLL_REGISTERED))
3432

3533
struct dpll_device_registration {
3634
struct list_head list;
@@ -616,8 +614,6 @@ dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,
616614
WARN_ON(!ops->state_on_dpll_get) ||
617615
WARN_ON(!ops->direction_get))
618616
return -EINVAL;
619-
if (ASSERT_DPLL_REGISTERED(dpll))
620-
return -EINVAL;
621617

622618
mutex_lock(&dpll_lock);
623619
if (WARN_ON(!(dpll->module == pin->module &&
@@ -695,8 +691,6 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin,
695691
WARN_ON(!ops->state_on_pin_get) ||
696692
WARN_ON(!ops->direction_get))
697693
return -EINVAL;
698-
if (ASSERT_PIN_REGISTERED(parent))
699-
return -EINVAL;
700694

701695
mutex_lock(&dpll_lock);
702696
ret = dpll_xa_ref_pin_add(&pin->parent_refs, parent, ops, priv);

0 commit comments

Comments
 (0)