[PATCH net-next v3 7/9] ice: implement dpll interface to control cgu

Jiri Pirko jiri at resnulli.us
Wed Aug 9 23:43:00 PDT 2023


Wed, Aug 09, 2023 at 11:40:25PM CEST, vadim.fedorenko at linux.dev wrote:
>From: Arkadiusz Kubalewski <arkadiusz.kubalewski at intel.com>

[...]


>+/**
>+ * ice_dpll_deinit - Disable the driver/HW support for dpll subsystem
>+ * the dpll device.
>+ * @pf: board private structure
>+ *
>+ * Handles the cleanup work required after dpll initialization, freeing
>+ * resources and unregistering the dpll, pin and all resources used for
>+ * handling them.
>+ *
>+ * Context: Destroys pf->dplls.lock mutex.
>+ */
>+void ice_dpll_deinit(struct ice_pf *pf)
>+{
>+	bool cgu = ice_is_feature_supported(pf, ICE_F_CGU);
>+
>+	if (!test_bit(ICE_FLAG_DPLL, pf->flags))
>+		return;
>+	if (cgu)
>+		ice_dpll_deinit_worker(pf);
>+	clear_bit(ICE_FLAG_DPLL, pf->flags);

Clearing the flag after deinit worker somehow implicates that it needs
to be set until here. That is not true.

Please rather use test_and_clear_bit() instead of test_bit() which would
takes care of the clear alongside with the check.

With or without that.

Signed-off-by: Jiri Pirko <jiri at nvidia.com>

[...]



More information about the linux-arm-kernel mailing list