From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31D15155389; Tue, 9 Jul 2024 11:14:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720523652; cv=none; b=H+3ibkESbqvadjeFYXkKJHCDJRbILI/Gvs/Q00qmYzH+KjbPIwbfBm74ZBiE9wRg7+Tl+SCQmwC6jBF+u0FKmCRYJnXR/oeDa6a9lPCS5FcNtdiHxQhr19lMB7Zsk2soNWpUGhA1EA+Dl3BreDULugtYvsjxcQWZlatk3S/V2Zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720523652; c=relaxed/simple; bh=3FYRQtGoX2MqqjZkfbavvJkg6NnpU68YRAdl9CTVqRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DsU0/Tq36OOmnC0SaLYD3s+tyK1MxqbANcEE0dueUkcrZvdexPgJRuo6Rdt7Dtt+cxf6gfjoZ2YA5YLpPsK7M9eoy0QwLg/nfjs/roxNQN+yIZQC38keLNxGHFM6VKItV6dBxX7V8SnPiImdNQEaOVtfs4cRaz36sEcdSWyMyHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I2MS54TS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="I2MS54TS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8467C3277B; Tue, 9 Jul 2024 11:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720523652; bh=3FYRQtGoX2MqqjZkfbavvJkg6NnpU68YRAdl9CTVqRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I2MS54TSy7Wns+4Fnmfl9UG05TI/52TmD0ZU5ZkdS/djMM3Ak8mzUORUO7h/dGTxg nzZ4LDMtBDX7eNKKuZGkxQGJjaE8Z8elMEdJIbuz+/vK/S648Of7FnD0fqOobE8hD+ +8lmvc2xZ7wwf7agMKoZUc5ueKesDX9NOfG6W4G0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Corinna Vinschen , Hariprasad Kelam , Vinicius Costa Gomes , Naama Meir , Tony Nguyen , Sasha Levin Subject: [PATCH 6.6 047/139] igc: fix a log entry using uninitialized netdev Date: Tue, 9 Jul 2024 13:09:07 +0200 Message-ID: <20240709110659.985919347@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240709110658.146853929@linuxfoundation.org> References: <20240709110658.146853929@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Corinna Vinschen [ Upstream commit 86167183a17e03ec77198897975e9fdfbd53cb0b ] During successful probe, igc logs this: [ 5.133667] igc 0000:01:00.0 (unnamed net_device) (uninitialized): PHC added ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The reason is that igc_ptp_init() is called very early, even before register_netdev() has been called. So the netdev_info() call works on a partially uninitialized netdev. Fix this by calling igc_ptp_init() after register_netdev(), right after the media autosense check, just as in igb. Add a comment, just as in igb. Now the log message is fine: [ 5.200987] igc 0000:01:00.0 eth0: PHC added Signed-off-by: Corinna Vinschen Reviewed-by: Hariprasad Kelam Acked-by: Vinicius Costa Gomes Tested-by: Naama Meir Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igc/igc_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index e83700ad7e622..5715fc6779117 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6908,8 +6908,6 @@ static int igc_probe(struct pci_dev *pdev, device_set_wakeup_enable(&adapter->pdev->dev, adapter->flags & IGC_FLAG_WOL_SUPPORTED); - igc_ptp_init(adapter); - igc_tsn_clear_schedule(adapter); /* reset the hardware with the new settings */ @@ -6931,6 +6929,9 @@ static int igc_probe(struct pci_dev *pdev, /* Check if Media Autosense is enabled */ adapter->ei = *ei; + /* do hw tstamp init after resetting */ + igc_ptp_init(adapter); + /* print pcie link status and MAC address */ pcie_print_link_status(pdev); netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr); -- 2.43.0