Skip to content

Conversation

@kubalewski
Copy link
Owner

No description provided.

@kubalewski kubalewski force-pushed the dpll_nonRFC_v2_merged_on_dave_m_28_07_2023 branch from 441c3dd to 7425813 Compare July 29, 2023 00:19
Vadim Fedorenko and others added 9 commits July 31, 2023 10:20
Add documentation explaining common netlink interface to configure DPLL
devices and monitoring events. Common way to implement DPLL device in
a driver is also covered.

v1->v2:
- add description of DETACHED mode

Co-developed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Add a protocol spec for DPLL.
Add code generated from the spec.

v1->v2:
- rename FREERUN to DETACHED
- remove module-name from expected input attributes on device-get command

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
DPLL framework is used to represent and configure DPLL devices
in systems. Each device that has DPLL and can configure inputs
and outputs can use this framework.

Implement core framework functions for further interactions
with device drivers implementing dpll subsystem, as well as for
interactions of DPLL netlink framework part with the subsystem
itself.

v1->v2:
- fix checkpatch errors

Co-developed-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Milena Olech <milena.olech@intel.com>
Co-developed-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Co-developed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
DPLL framework is used to represent and configure DPLL devices
in systems. Each device that has DPLL and can configure inputs
and outputs can use this framework.

Implement dpll netlink framework functions for enablement of dpll
subsytem netlink family.

v1->v2:
- verify if dpll is not in DETACHED mode before invoking pin-state set

Co-developed-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Milena Olech <milena.olech@intel.com>
Co-developed-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Co-developed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
In case netdevice represents a SyncE port, the user needs to understand
the connection between netdevice and associated DPLL pin. There might me
multiple netdevices pointing to the same pin, in case of VF/SF
implementation.

Add a IFLA Netlink attribute to nest the DPLL pin handle, similar to
how it is implemented for devlink port. Add a struct dpll_pin pointer
to netdev and protect access to it by RTNL. Expose netdev_dpll_pin_set()
and netdev_dpll_pin_clear() helpers to the drivers so they can set/clear
the DPLL pin relationship to netdev.

Note that during the lifetime of struct dpll_pin the pin handle does not
change. Therefore it is save to access it lockless. It is drivers
responsibility to call netdev_dpll_pin_clear() before dpll_pin_put().

v1->v2:
- fix checkpatch errors

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Add firmware admin command to access clock generation unit
configuration, it is required to enable Extended PTP and SyncE features
in the driver.
Add definitions of possible hardware variations of input and output pins
related to clock generation unit and functions to access the data.

v1->v2:
- fix kdoc warnings on dpll aq command functions
- remove convert_s48_to_s64(), use sign_extend64() instead
- move pins static definition to ice_ptp_hw.c, as only place where used
- remove unused struct definitions: ice_cgu_state, ice_cgu_state_desc
- fix flow in ice_get_cgu_state():
  - prevent possible NULL dereference
  - return 0 instead of status
- rename dpll mode FREERUN to DETACHED

Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Control over clock generation unit is required for further development
of Synchronous Ethernet feature. Interface provides ability to obtain
current state of a dpll, its sources and outputs which are pins, and
allows their configuration.

v1->v2:
- fix init mutex
- use mutex_lock instead of trylock
- fix ice_dpll_cb_lock docs
- remove leftover mutex_unlock() on dpll init
- fix ice_dpll_cb_lock docs
- fix 'Context:' description of functions
- fix typo properities->properties
- fix RCT variable order in ice_dpll_pin_freq_set()
- fix ice_dpll_pin_state_update(), make function static, declare variables
  outside of switch case
- fix check if dpll_state was LOCKED OR LOCKED_HO_ACQ for init dpll
  state update
- fix unlock mutex on error in kworker
- fix init ret variable
- fix init ret variable on error in ice_dpll_init_info()
- fix typo userpsace->userspace
- rename dpll mode FREERUN to DETACHED

Co-developed-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Milena Olech <milena.olech@intel.com>
Co-developed-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Michal Michalik <michal.michalik@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Implement basic DPLL operations in ptp_ocp driver as the
simplest example of using new subsystem.

v9->v10:
- implement monitoring thread and netlink notification

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Implement SyncE support using newly introduced DPLL support.
Make sure that each PFs/VFs/SFs probed with appropriate capability
will spawn a dpll auxiliary device and register appropriate dpll device
and pin instances.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
@kubalewski kubalewski force-pushed the dpll_nonRFC_v2_merged_on_dave_m_28_07_2023 branch from 7425813 to 028642b Compare July 31, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants