Skip to contentSkip to conversation

ice: fix dpll output pin configuration

PATCH In review Arkadiusz Kubalewski 2 participants 3 messages Sep 10, 2024 – Sep 12, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice: fix dpll output pin configuration

Currently the user may request DPLL_PIN_STATE_SELECTABLE for an output pin, and this would actually set the DISCONNECTED state instead. It doesn't make any sense. SELECTABLE is valid only in case of input pins (on AUTOMATIC type dpll), where dpll itself would select best valid input. For the output pin only CONNECTED/DISCONNECTED are expected.

Fixes d7999f5ea64b ("ice: implement dpll interface to control cgu")
---
 drivers/net/ethernet/intel/ice/ice_dpll.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/ice/ice_dpll.c +2 -0
index e92be6f130a3..3d20c3b232aa 100644
@@ -651,6 +651,8 @@ ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv,
 	struct ice_dpll_pin *p = pin_priv;
 	struct ice_dpll *d = dpll_priv;
 
+	if (state == DPLL_PIN_STATE_SELECTABLE)
+		return -EINVAL;
 	if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
 		return 0;
 
Signature · 1 line
2.38.1
Reviewed-by on v1 1/1
#1 lore raw

Dear Arkadiusz,

Thank you for your patch. It’d be great if you made the summary more explicit. For example:

ice: Disallow DPLL_PIN_STATE_SELECTABLE for dpll output pins

Am 11.09.24 um 01:28 schrieb Arkadiusz Kubalewski:

Quoted 3 lines

Currently the user may request DPLL_PIN_STATE_SELECTABLE for an output pin, and this would actually set the DISCONNECTED state instead. It doesn't make any sense. SELECTABLE is valid only in case of input pins

It’d be great if you added a blank line between paragraphs.

Quoted 15 lines

(on AUTOMATIC type dpll), where dpll itself would select best valid input. For the output pin only CONNECTED/DISCONNECTED are expected.

Fixes d7999f5ea64b ("ice: implement dpll interface to control cgu")
---
  drivers/net/ethernet/intel/ice/ice_dpll.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/ice/ice_dpll.c +0 -0
index e92be6f130a3..3d20c3b232aa 100644

drivers/net/ethernet/intel/ice/ice_dpll.c ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv, · line 658

Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_dpll.c +2 -0
@@ -651,6 +651,8 @@ ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv,
  	struct ice_dpll_pin *p = pin_priv;
  	struct ice_dpll *d = dpll_priv;
 
+	if (state == DPLL_PIN_STATE_SELECTABLE)
+		return -EINVAL;
  	if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
  		return 0;
 

With the above addressed:

Kind regards,

Paul

#2 lore raw
Quoted 46 lines

From: Paul Menzel <[email protected]>
Sent: Wednesday, September 11, 2024 8:22 AM

Dear Arkadiusz,

Thank you for your patch. It’d be great if you made the summary more explicit. For example:

ice: Disallow DPLL_PIN_STATE_SELECTABLE for dpll output pins

Am 11.09.24 um 01:28 schrieb Arkadiusz Kubalewski:

Quoted 3 lines

Currently the user may request DPLL_PIN_STATE_SELECTABLE for an output pin, and this would actually set the DISCONNECTED state instead. It doesn't make any sense. SELECTABLE is valid only in case of input pins

It’d be great if you added a blank line between paragraphs.

Review

Quoted 11 lines

(on AUTOMATIC type dpll), where dpll itself would select best valid input. For the output pin only CONNECTED/DISCONNECTED are expected.

Fixes d7999f5ea64b ("ice: implement dpll interface to control cgu")
---
  drivers/net/ethernet/intel/ice/ice_dpll.c | 2 ++
  1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ethernet/intel/ice/ice_dpll.c

drivers/net/ethernet/intel/ice/ice_dpll.c ice_dpll_output_state_set(const struct dpll_pin *pin,

Quoted 4 lines

index e92be6f130a3..3d20c3b232aa 100644

drivers/net/ethernet/intel/ice/ice_dpll.c +0 -0
@@ -651,6 +651,8 @@ ice_dpll_output_state_set(const struct dpll_pin *pin,

void *pin_priv,

drivers/net/ethernet/intel/ice/ice_dpll.c ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv, · line 658

Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_dpll.c +2 -0
  	struct ice_dpll_pin *p = pin_priv;
  	struct ice_dpll *d = dpll_priv;
 
+	if (state == DPLL_PIN_STATE_SELECTABLE)
+		return -EINVAL;
  	if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
  		return 0;
 

With the above addressed:

Quoted 2 lines

Greetings Paul,

Sure, fixed both as suggested in v2.

Thank you for your review!
Arkadiusz

Quoted 4 lines

Kind regards,

Paul