linux:nvidia: macsec sysfs nodes only if enabled

Issue: Accessing the macsec sysfs nodes is leading to crash when macsec
is disabled in DT

Fix: Do not create sysfs nodes if macsec is not enabled in DT. Also
update the instance_id reading as part of ether_probe which will be
executed even when macsec is disabled

Bug 4431523
Bug 4449611

Change-Id: I354ac142b9d49852a0d5c7557a7368e1c36b0f63
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3043570
(cherry picked from commit 43136118f6a5e3cbdb09b7366f6a44ca5e52f21c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3075216
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3081231
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Bhadram Varka <vbhadram@nvidia.com>
This commit is contained in:
Sanath Kumar Gampa
2024-01-02 06:49:36 +00:00
committed by mobile promotions
parent 85cf3fb4b3
commit 725b8aacf1
3 changed files with 55 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved */
/* Copyright (c) 2019-2024, NVIDIA CORPORATION. All rights reserved */
#ifdef MACSEC_SUPPORT
#include "ether_linux.h"