* [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active
@ 2022-04-05 20:54 Vinicius Costa Gomes
2022-04-11 11:11 ` naamax.meir
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-05 20:54 UTC (permalink / raw)
To: intel-wired-lan
Some mainboard/CPU combinations have shown problems with
suspend/resume when PCIe PTM is enabled and active.
The best we can do is to stop PTM dialogs from the downstream/device
side before the interface is brought down. PCIe PTM will be
re-enabled when the interface is being brought up.
Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
Stefan,
I believe that this should be a more general solution to the problem you reported in
https://lore.kernel.org/all/924175a188159f4e03bd69908a91e606b574139b.camel at gmx.de/
Would it be possible for you revert commit 1e81dcc1ab7d ("igc: Do not
enable crosstimestamping for i225-V models") and apply this one, and
see if it works for you? I don't have your exact setup.
Cheers,
drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 0d6e3215e98f..653e9f1e35b5 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -992,6 +992,17 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter)
igc_ptp_write_i225(adapter, &ts);
}
+static void igc_ptm_stop(struct igc_adapter *adapter)
+{
+ struct igc_hw *hw = &adapter->hw;
+ u32 ctrl;
+
+ ctrl = rd32(IGC_PTM_CTRL);
+ ctrl &= ~IGC_PTM_CTRL_EN;
+
+ wr32(IGC_PTM_CTRL, ctrl);
+}
+
/**
* igc_ptp_suspend - Disable PTP work items and prepare for suspend
* @adapter: Board private structure
@@ -1009,8 +1020,10 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
adapter->ptp_tx_skb = NULL;
clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
- if (pci_device_is_present(adapter->pdev))
+ if (pci_device_is_present(adapter->pdev)) {
igc_ptp_time_save(adapter);
+ igc_ptm_stop(adapter);
+ }
}
/**
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active
2022-04-05 20:54 [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active Vinicius Costa Gomes
@ 2022-04-11 11:11 ` naamax.meir
2022-04-11 11:23 ` naamax.meir
2022-04-11 11:50 ` Paul Menzel
2 siblings, 0 replies; 5+ messages in thread
From: naamax.meir @ 2022-04-11 11:11 UTC (permalink / raw)
To: intel-wired-lan
On 4/5/2022 23:54, Vinicius Costa Gomes wrote:
> Some mainboard/CPU combinations have shown problems with
> suspend/resume when PCIe PTM is enabled and active.
>
> The best we can do is to stop PTM dialogs from the downstream/device
> side before the interface is brought down. PCIe PTM will be
> re-enabled when the interface is being brought up.
>
> Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
> Stefan,
>
> I believe that this should be a more general solution to the problem you reported in
> https://lore.kernel.org/all/924175a188159f4e03bd69908a91e606b574139b.camel at gmx.de/
>
> Would it be possible for you revert commit 1e81dcc1ab7d ("igc: Do not
> enable crosstimestamping for i225-V models") and apply this one, and
> see if it works for you? I don't have your exact setup.
>
> Cheers,
>
> drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)Tested-by: Naama Meir <naamax.meir@linux.intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active
2022-04-05 20:54 [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active Vinicius Costa Gomes
2022-04-11 11:11 ` naamax.meir
@ 2022-04-11 11:23 ` naamax.meir
2022-04-11 11:50 ` Paul Menzel
2 siblings, 0 replies; 5+ messages in thread
From: naamax.meir @ 2022-04-11 11:23 UTC (permalink / raw)
To: intel-wired-lan
On 4/5/2022 23:54, Vinicius Costa Gomes wrote:
> Some mainboard/CPU combinations have shown problems with
> suspend/resume when PCIe PTM is enabled and active.
>
> The best we can do is to stop PTM dialogs from the downstream/device
> side before the interface is brought down. PCIe PTM will be
> re-enabled when the interface is being brought up.
>
> Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
> Stefan,
>
> I believe that this should be a more general solution to the problem you reported in
> https://lore.kernel.org/all/924175a188159f4e03bd69908a91e606b574139b.camel at gmx.de/
>
> Would it be possible for you revert commit 1e81dcc1ab7d ("igc: Do not
> enable crosstimestamping for i225-V models") and apply this one, and
> see if it works for you? I don't have your exact setup.
>
> Cheers,
>
> drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active
2022-04-05 20:54 [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active Vinicius Costa Gomes
2022-04-11 11:11 ` naamax.meir
2022-04-11 11:23 ` naamax.meir
@ 2022-04-11 11:50 ` Paul Menzel
2022-04-12 3:01 ` Vinicius Costa Gomes
2 siblings, 1 reply; 5+ messages in thread
From: Paul Menzel @ 2022-04-11 11:50 UTC (permalink / raw)
To: intel-wired-lan
Dear Vinicius,
Thank you for your patch.
Am 05.04.22 um 22:54 schrieb Vinicius Costa Gomes:
> Some mainboard/CPU combinations have shown problems with
> suspend/resume when PCIe PTM is enabled and active.
Please give a concrete example of a mainboard/CPU combination with that
problem, and document exactly what the problem is (system hangs, when,
where, just no network device)?
Also, please use 75 characters per line in commit messages.
> The best we can do is to stop PTM dialogs from the downstream/device
> side before the interface is brought down. PCIe PTM will be
> re-enabled when the interface is being brought up.
>
> Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
> Stefan,
>
> I believe that this should be a more general solution to the problem you reported in
> https://lore.kernel.org/all/924175a188159f4e03bd69908a91e606b574139b.camel at gmx.de/
>
> Would it be possible for you revert commit 1e81dcc1ab7d ("igc: Do not
> enable crosstimestamping for i225-V models") and apply this one, and
> see if it works for you? I don't have your exact setup.
>
> Cheers,
>
> drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
> index 0d6e3215e98f..653e9f1e35b5 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ptp.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
> @@ -992,6 +992,17 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter)
> igc_ptp_write_i225(adapter, &ts);
> }
>
> +static void igc_ptm_stop(struct igc_adapter *adapter)
> +{
> + struct igc_hw *hw = &adapter->hw;
> + u32 ctrl;
> +
> + ctrl = rd32(IGC_PTM_CTRL);
> + ctrl &= ~IGC_PTM_CTRL_EN;
> +
> + wr32(IGC_PTM_CTRL, ctrl);
> +}
> +
> /**
> * igc_ptp_suspend - Disable PTP work items and prepare for suspend
> * @adapter: Board private structure
> @@ -1009,8 +1020,10 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
> adapter->ptp_tx_skb = NULL;
> clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
>
> - if (pci_device_is_present(adapter->pdev))
> + if (pci_device_is_present(adapter->pdev)) {
> igc_ptp_time_save(adapter);
> + igc_ptm_stop(adapter);
> + }
> }
>
> /**
Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active
2022-04-11 11:50 ` Paul Menzel
@ 2022-04-12 3:01 ` Vinicius Costa Gomes
0 siblings, 0 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-12 3:01 UTC (permalink / raw)
To: intel-wired-lan
Paul Menzel <pmenzel@molgen.mpg.de> writes:
> Dear Vinicius,
>
>
> Thank you for your patch.
>
> Am 05.04.22 um 22:54 schrieb Vinicius Costa Gomes:
>> Some mainboard/CPU combinations have shown problems with
>> suspend/resume when PCIe PTM is enabled and active.
>
> Please give a concrete example of a mainboard/CPU combination with that
> problem, and document exactly what the problem is (system hangs, when,
> where, just no network device)?
Sure. Will add.
>
> Also, please use 75 characters per line in commit messages.
>
Will fix.
@Tony, I will send a v2.
>
> Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul
Thank you,
--
Vinicius
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-04-12 3:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-05 20:54 [Intel-wired-lan] [PATCH net-queue v1] igc: Fix suspending when PTM is active Vinicius Costa Gomes
2022-04-11 11:11 ` naamax.meir
2022-04-11 11:23 ` naamax.meir
2022-04-11 11:50 ` Paul Menzel
2022-04-12 3:01 ` Vinicius Costa Gomes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox