lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250401-jk-igc-ptm-fixes-v4-v4-0-c0efb82bbf85@intel.com>
Date: Tue, 01 Apr 2025 16:35:28 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Anthony Nguyen <anthony.l.nguyen@...el.com>
Cc: david.zage@...el.com, vinicius.gomes@...el.com, 
 rodrigo.cadore@...coustics.com, intel-wired-lan@...ts.osuosl.org, 
 netdev@...r.kernel.org, Jacob Keller <jacob.e.keller@...el.com>, 
 Christopher S M Hall <christopher.s.hall@...el.com>, 
 Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>, 
 Mor Bar-Gabay <morx.bar.gabay@...el.com>, 
 Avigail Dahan <avigailx.dahan@...el.com>, 
 Corinna Vinschen <vinschen@...hat.com>
Subject: [PATCH iwl-net v4 0/6] igc: Fix PTM timeout

There have been sporadic reports of PTM timeouts using i225/i226 devices

These timeouts have been root caused to:

1) Manipulating the PTM status register while PTM is enabled and triggered
2) The hardware retrying too quickly when an inappropriate response is
   received from the upstream device

The issue can be reproduced with the following:

$ sudo phc2sys -R 1000 -O 0 -i tsn0 -m

Note: 1000 Hz (-R 1000) is unrealistically large, but provides a way to
quickly reproduce the issue.

PHC2SYS exits with:

"ioctl PTP_OFFSET_PRECISE: Connection timed out" when the PTM transaction
  fails

The first patch in this series also resolves an issue reported by Corinna
Vinschen relating to kdump:

  This patch also fixes a hang in igc_probe() when loading the igc
  driver in the kdump kernel on systems supporting PTM.

  The igc driver running in the base kernel enables PTM trigger in
  igc_probe().  Therefore the driver is always in PTM trigger mode,
  except in brief periods when manually triggering a PTM cycle.

  When a crash occurs, the NIC is reset while PTM trigger is enabled.
  Due to a hardware problem, the NIC is subsequently in a bad busmaster
  state and doesn't handle register reads/writes.  When running
  igc_probe() in the kdump kernel, the first register access to a NIC
  register hangs driver probing and ultimately breaks kdump.

  With this patch, igc has PTM trigger disabled most of the time,
  and the trigger is only enabled for very brief (10 - 100 us) periods
  when manually triggering a PTM cycle.  Chances that a crash occurs
  during a PTM trigger are not zero, but extremly reduced.

Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
---
Changes in v4:
- Jacob taking over sending v4 due to lack of time on Chris's part.
- Updated commit messages based on review feedback from v3
- Updated commit titles to slightly more imperative wording
- Link to v3: https://lore.kernel.org/r/20241106184722.17230-1-christopher.s.hall@intel.com
Changes in v3:
- Added mutex_destroy() to clean up PTM lock.
- Added missing checks for PTP enabled flag called from igc_main.c.
- Cleanup PTP module if probe fails.
- Wrap all access to PTM registers with PTM lock/unlock.
- Link to v2: https://lore.kernel.org/netdev/20241023023040.111429-1-christopher.s.hall@intel.com/
Changes in v2:
- Removed patch modifying PTM retry loop count.
- Moved PTM mutex initialization from igc_reset() to igc_ptp_init(), called
  once during igc_probe().
- Link to v1: https://lore.kernel.org/netdev/20240807003032.10300-1-christopher.s.hall@intel.com/

---
Christopher S M Hall (6):
      igc: fix PTM cycle trigger logic
      igc: increase wait time before retrying PTM
      igc: move ktime snapshot into PTM retry loop
      igc: handle the IGC_PTP_ENABLED flag correctly
      igc: cleanup PTP module if probe fails
      igc: add lock preventing multiple simultaneous PTM transactions

 drivers/net/ethernet/intel/igc/igc.h         |   1 +
 drivers/net/ethernet/intel/igc/igc_defines.h |   6 +-
 drivers/net/ethernet/intel/igc/igc_main.c    |   1 +
 drivers/net/ethernet/intel/igc/igc_ptp.c     | 113 ++++++++++++++++++---------
 4 files changed, 81 insertions(+), 40 deletions(-)
---
base-commit: f278b6d5bb465c7fd66f3d103812947e55b376ed
change-id: 20250401-jk-igc-ptm-fixes-v4-989baefeab14

Best regards,
-- 
Jacob Keller <jacob.e.keller@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ