Skip to content

Commit 698182f

Browse files
christopher-s-hallgregkh
authored andcommitted
igc: handle the IGC_PTP_ENABLED flag correctly
[ Upstream commit 26a3910 ] All functions in igc_ptp.c called from igc_main.c should check the IGC_PTP_ENABLED flag. Adding check for this flag to stop and reset functions. Fixes: 5f29580 ("igc: Add basic skeleton for PTP") Signed-off-by: Christopher S M Hall <[email protected]> Reviewed-by: Corinna Vinschen <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Acked-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8058c89 commit 698182f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/intel/igc/igc_ptp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,12 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
12441244
**/
12451245
void igc_ptp_stop(struct igc_adapter *adapter)
12461246
{
1247+
if (!(adapter->ptp_flags & IGC_PTP_ENABLED))
1248+
return;
1249+
12471250
igc_ptp_suspend(adapter);
12481251

1252+
adapter->ptp_flags &= ~IGC_PTP_ENABLED;
12491253
if (adapter->ptp_clock) {
12501254
ptp_clock_unregister(adapter->ptp_clock);
12511255
netdev_info(adapter->netdev, "PHC removed\n");
@@ -1266,6 +1270,9 @@ void igc_ptp_reset(struct igc_adapter *adapter)
12661270
unsigned long flags;
12671271
u32 timadj;
12681272

1273+
if (!(adapter->ptp_flags & IGC_PTP_ENABLED))
1274+
return;
1275+
12691276
/* reset the tstamp_config */
12701277
igc_ptp_set_timestamp_mode(adapter, &adapter->tstamp_config);
12711278

0 commit comments

Comments
 (0)