Skip to content

Commit 4507641

Browse files
gnitkaanguy11
authored andcommitted
ice: fix destination CGU for dual complex E825
On dual complex E825, only complex 0 has functional CGU (Clock Generation Unit), powering all the PHYs. SBQ (Side Band Queue) destination device 'cgu' in current implementation points to CGU on current complex and, in order to access primary CGU from the secondary complex, the driver should use 'cgu_peer' as a destination device in read/write CGU registers operations. Define new 'cgu_peer' (15) as RDA (Remote Device Access) client over SB-IOSF interface and use it as device target when accessing CGU from secondary complex. This problem has been identified when working on recovery clock enablement [1]. In existing implementation for E825 devices, only PF0, which is clock owner, is involved in CGU configuration, thus the problem was not exposed to the user. [1] https://lore.kernel.org/intel-wired-lan/20250905150947.871566-1-grzegorz.nitka@intel.com/ Fixes: e2193f9 ("ice: enable timesync operation on 2xNAC E825 devices") Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com> Reviewed-by: Arkadiusz Kubalewski <Arkadiusz.kubalewski@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent e984046 commit 4507641

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6505,6 +6505,28 @@ u32 ice_get_link_speed(u16 index)
65056505
return ice_aq_to_link_speed[index];
65066506
}
65076507

6508+
/**
6509+
* ice_get_dest_cgu - get destination CGU dev for given HW
6510+
* @hw: pointer to the HW struct
6511+
*
6512+
* Get CGU client id for CGU register read/write operations.
6513+
*
6514+
* Return: CGU device id to use in SBQ transactions.
6515+
*/
6516+
static enum ice_sbq_dev_id ice_get_dest_cgu(struct ice_hw *hw)
6517+
{
6518+
/* On dual complex E825 only complex 0 has functional CGU powering all
6519+
* the PHYs.
6520+
* SBQ destination device cgu points to CGU on a current complex and to
6521+
* access primary CGU from the secondary complex, the driver should use
6522+
* cgu_peer as a destination device.
6523+
*/
6524+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 && ice_is_dual(hw) &&
6525+
!ice_is_primary(hw))
6526+
return ice_sbq_dev_cgu_peer;
6527+
return ice_sbq_dev_cgu;
6528+
}
6529+
65086530
/**
65096531
* ice_read_cgu_reg - Read a CGU register
65106532
* @hw: Pointer to the HW struct
@@ -6519,8 +6541,8 @@ u32 ice_get_link_speed(u16 index)
65196541
int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val)
65206542
{
65216543
struct ice_sbq_msg_input cgu_msg = {
6544+
.dest_dev = ice_get_dest_cgu(hw),
65226545
.opcode = ice_sbq_msg_rd,
6523-
.dest_dev = ice_sbq_dev_cgu,
65246546
.msg_addr_low = addr
65256547
};
65266548
int err;
@@ -6551,8 +6573,8 @@ int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val)
65516573
int ice_write_cgu_reg(struct ice_hw *hw, u32 addr, u32 val)
65526574
{
65536575
struct ice_sbq_msg_input cgu_msg = {
6576+
.dest_dev = ice_get_dest_cgu(hw),
65546577
.opcode = ice_sbq_msg_wr,
6555-
.dest_dev = ice_sbq_dev_cgu,
65566578
.msg_addr_low = addr,
65576579
.data = val
65586580
};

drivers/net/ethernet/intel/ice/ice_sbq_cmd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ enum ice_sbq_dev_id {
5050
ice_sbq_dev_phy_0 = 0x02,
5151
ice_sbq_dev_cgu = 0x06,
5252
ice_sbq_dev_phy_0_peer = 0x0D,
53+
ice_sbq_dev_cgu_peer = 0x0F,
5354
};
5455

5556
enum ice_sbq_msg_opcode {

0 commit comments

Comments
 (0)