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: <20240816204808.30359-1-davthompson@nvidia.com>
Date: Fri, 16 Aug 2024 16:48:08 -0400
From: David Thompson <davthompson@...dia.com>
To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <andriy.shevchenko@...ux.intel.com>,
	<u.kleine-koenig@...gutronix.de>
CC: <asmaa@...dia.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, David Thompson <davthompson@...dia.com>
Subject: [PATCH net v1] mlxbf_gige: disable port during stop()

The mlxbf_gige_open() routine initializes and enables the
Gigabit Ethernet port from a hardware point of view. The
mlxbf_gige_stop() routine must disable the port hardware
to fully quiesce it.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: Asmaa Mnebhi <asmaa@...dia.com>
Signed-off-by: David Thompson <davthompson@...dia.com>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 385a56ac7348..12942a50e1bb 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -205,8 +205,14 @@ static int mlxbf_gige_open(struct net_device *netdev)
 static int mlxbf_gige_stop(struct net_device *netdev)
 {
 	struct mlxbf_gige *priv = netdev_priv(netdev);
+	u64 control;
+
+	control = readq(priv->base + MLXBF_GIGE_CONTROL);
+	control &= ~MLXBF_GIGE_CONTROL_PORT_EN;
+	writeq(control, priv->base + MLXBF_GIGE_CONTROL);
 
 	writeq(0, priv->base + MLXBF_GIGE_INT_EN);
+	mb();
 	netif_stop_queue(netdev);
 	napi_disable(&priv->napi);
 	netif_napi_del(&priv->napi);
-- 
2.30.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ