net: lan743x: Restore SGMII CTRL register on resume
authorThangaraj Samynathan <thangaraj.s@microchip.com>
Fri, 16 May 2025 03:57:19 +0000 (09:27 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 May 2025 02:44:17 +0000 (19:44 -0700)
commit293e38ff4e4c2ba53f3fd47d8a4a9f0f0414a7a6
treec06a4abe782ea9d20f9588a65216647e42c85b99
parentaed031da7e8cf6e31816a34afde961fbe0305fea
net: lan743x: Restore SGMII CTRL register on resume

SGMII_CTRL register, which specifies the active interface, was not
properly restored when resuming from suspend. This led to incorrect
interface selection after resume particularly in scenarios involving
the FPGA.

To fix this:
- Move the SGMII_CTRL setup out of the probe function.
- Initialize the register in the hardware initialization helper function,
which is called during both device initialization and resume.

This ensures the interface configuration is consistently restored after
suspend/resume cycles.

Fixes: a46d9d37c4f4f ("net: lan743x: Add support for SGMII interface")
Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Link: https://patch.msgid.link/20250516035719.117960-1-thangaraj.s@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan743x_main.c