Commit c191b319f208 ("dpll: allow registering FW-identified pin with a different DPLL") allowed a pin with a firmware node to be registered with a DPLL of another owner. Its only user was ice on E825, which now links its own pins with the zl3073x pins instead. Require the same owner for every pin again and document the rule. Signed-off-by: Ivan Vecera --- Documentation/driver-api/dpll.rst | 8 ++++++-- drivers/dpll/dpll_core.c | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/driver-api/dpll.rst b/Documentation/driver-api/dpll.rst index 7b083a59f0122d..90c88fcf21b385 100644 --- a/Documentation/driver-api/dpll.rst +++ b/Documentation/driver-api/dpll.rst @@ -350,8 +350,12 @@ bound to only one other pin at any given time. ``DPLL_A_PIN_STATE`` state of Reference SYNC connection ============================== ========================================== -Pin links -========= +Pin ownership and links +======================= + +The owner of a dpll device or a pin is identified by the module and the +clock_id passed to dpll_device_get() or dpll_pin_get(). dpll_pin_register() +accepts only a dpll device of the same owner as the pin. A pin represents a pad of the device whose driver registers it. When the board connects a pad of one device to a pad of another one, for example an diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 7fd84b0e90e993..57eb4ff2c320e5 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -983,6 +983,9 @@ __dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin, * @ops: ops for a dpll pin ops * @priv: pointer to private information of owner * + * The @dpll and the @pin must have the same owner, they must be created with + * the same module and clock_id. + * * Context: Acquires a lock (dpll_lock) * Return: * * 0 on success @@ -1015,13 +1018,10 @@ dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin, goto out_unlock; } - /* - * For pins identified via firmware (pin->fwnode), allow registration - * even if the pin's (module, clock_id) differs from the target DPLL. - * For non-fwnode pins, require a strict (module, clock_id) match. + /* A pin of another owner is connected by a link, see + * dpll_pin_link_add(). */ - if (!pin->fwnode && - WARN_ON_ONCE(dpll->module != pin->module || + if (WARN_ON_ONCE(dpll->module != pin->module || dpll->clock_id != pin->clock_id)) { ret = -EINVAL; goto out_unlock; -- 2.56.1