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: <5d76f3116ee795071ec044eabb815d6c2bdc7dbd.1649922731.git.leonro@nvidia.com>
Date:   Thu, 14 Apr 2022 10:52:42 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     Leon Romanovsky <leonro@...dia.com>,
        Abhijit Ayarekar <aayarekar@...vell.com>,
        netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
        Satananda Burla <sburla@...vell.com>,
        Veerasenareddy Burru <vburru@...vell.com>
Subject: [PATCH net-next] octeon_ep: Remove custom driver version

From: Leon Romanovsky <leonro@...dia.com>

In review comment [1] was pointed that new code is not supposed
to set driver version and should rely on kernel version instead.

As an outcome of that comment all the dance around setting such
driver version to FW should be removed too, because in upstream
kernel whole driver will have same version so read/write from/to
FW will give same result.

[1] https://lore.kernel.org/all/YladGTmon1x3dfxI@unreal

Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization")
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
 .../ethernet/marvell/octeon_ep/octep_ctrl_mbox.c    | 13 +------------
 drivers/net/ethernet/marvell/octeon_ep/octep_main.c |  2 --
 drivers/net/ethernet/marvell/octeon_ep/octep_main.h |  9 ---------
 3 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
index 8c196dadfad0..39322e4dd100 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
@@ -26,9 +26,7 @@
 
 #define OCTEP_CTRL_MBOX_INFO_MAGIC_NUM_OFFSET(m)	(m)
 #define OCTEP_CTRL_MBOX_INFO_BARMEM_SZ_OFFSET(m)	((m) + 8)
-#define OCTEP_CTRL_MBOX_INFO_HOST_VERSION_OFFSET(m)	((m) + 16)
 #define OCTEP_CTRL_MBOX_INFO_HOST_STATUS_OFFSET(m)	((m) + 24)
-#define OCTEP_CTRL_MBOX_INFO_FW_VERSION_OFFSET(m)	((m) + 136)
 #define OCTEP_CTRL_MBOX_INFO_FW_STATUS_OFFSET(m)	((m) + 144)
 
 #define OCTEP_CTRL_MBOX_H2FQ_INFO_OFFSET(m)		((m) + OCTEP_CTRL_MBOX_INFO_SZ)
@@ -65,7 +63,7 @@ static u32 octep_ctrl_mbox_circq_depth(u32 pi, u32 ci, u32 mask)
 
 int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
 {
-	u64 version, magic_num, status;
+	u64 magic_num, status;
 
 	if (!mbox)
 		return -EINVAL;
@@ -81,13 +79,6 @@ int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
 		return -EINVAL;
 	}
 
-	version = readq(OCTEP_CTRL_MBOX_INFO_FW_VERSION_OFFSET(mbox->barmem));
-	if (version != OCTEP_DRV_VERSION) {
-		pr_info("octep_ctrl_mbox : Firmware version mismatch %llx != %x\n",
-			version, OCTEP_DRV_VERSION);
-		return -EINVAL;
-	}
-
 	status = readq(OCTEP_CTRL_MBOX_INFO_FW_STATUS_OFFSET(mbox->barmem));
 	if (status != OCTEP_CTRL_MBOX_STATUS_READY) {
 		pr_info("octep_ctrl_mbox : Firmware is not ready.\n");
@@ -96,7 +87,6 @@ int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
 
 	mbox->barmem_sz = readl(OCTEP_CTRL_MBOX_INFO_BARMEM_SZ_OFFSET(mbox->barmem));
 
-	writeq(mbox->version, OCTEP_CTRL_MBOX_INFO_HOST_VERSION_OFFSET(mbox->barmem));
 	writeq(OCTEP_CTRL_MBOX_STATUS_INIT, OCTEP_CTRL_MBOX_INFO_HOST_STATUS_OFFSET(mbox->barmem));
 
 	mbox->h2fq.elem_cnt = readl(OCTEP_CTRL_MBOX_H2FQ_ELEM_CNT_OFFSET(mbox->barmem));
@@ -248,7 +238,6 @@ int octep_ctrl_mbox_uninit(struct octep_ctrl_mbox *mbox)
 
 	writeq(OCTEP_CTRL_MBOX_STATUS_INVALID,
 	       OCTEP_CTRL_MBOX_INFO_HOST_STATUS_OFFSET(mbox->barmem));
-	writeq(0, OCTEP_CTRL_MBOX_INFO_HOST_VERSION_OFFSET(mbox->barmem));
 
 	pr_info("Octep ctrl mbox : Uninit successful.\n");
 
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 5d39c857ea41..3dd0af740f4f 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -30,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, octep_pci_id_tbl);
 MODULE_AUTHOR("Veerasenareddy Burru <vburru@...vell.com>");
 MODULE_DESCRIPTION(OCTEP_DRV_STRING);
 MODULE_LICENSE("GPL");
-MODULE_VERSION(OCTEP_DRV_VERSION_STR);
 
 /**
  * octep_alloc_ioq_vectors() - Allocate Tx/Rx Queue interrupt info.
@@ -950,7 +949,6 @@ int octep_device_setup(struct octep_device *oct)
 
 	/* Initialize control mbox */
 	ctrl_mbox = &oct->ctrl_mbox;
-	ctrl_mbox->version = OCTEP_DRV_VERSION;
 	ctrl_mbox->barmem = CFG_GET_CTRL_MBOX_MEM_ADDR(oct->conf);
 	ret = octep_ctrl_mbox_init(ctrl_mbox);
 	if (ret) {
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.h b/drivers/net/ethernet/marvell/octeon_ep/octep_main.h
index 520f2c3664f9..025626a61383 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.h
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.h
@@ -12,15 +12,6 @@
 #include "octep_rx.h"
 #include "octep_ctrl_mbox.h"
 
-#define OCTEP_DRV_VERSION_MAJOR		1
-#define OCTEP_DRV_VERSION_MINOR		0
-#define OCTEP_DRV_VERSION_VARIANT	0
-
-#define OCTEP_DRV_VERSION	((OCTEP_DRV_VERSION_MAJOR << 16) + \
-				  (OCTEP_DRV_VERSION_MINOR << 8) + \
-				  OCTEP_DRV_VERSION_VARIANT)
-
-#define OCTEP_DRV_VERSION_STR	"1.0.0"
 #define OCTEP_DRV_NAME		"octeon_ep"
 #define OCTEP_DRV_STRING	"Marvell Octeon EndPoint NIC Driver"
 
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ