octeon_ep: Remove custom driver version
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 14 Apr 2022 07:52:42 +0000 (10:52 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Apr 2022 21:04:14 +0000 (14:04 -0700)
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@nvidia.com>
Link: https://lore.kernel.org/r/5d76f3116ee795071ec044eabb815d6c2bdc7dbd.1649922731.git.leonro@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
drivers/net/ethernet/marvell/octeon_ep/octep_main.c
drivers/net/ethernet/marvell/octeon_ep/octep_main.h

index 8c196dadfad069690209dd5ab3b5d5d1deaed1ea..39322e4dd1003ed9e7f6d421c77051376b46cd8e 100644 (file)
@@ -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");
 
index f2af5ebffcf1ea6b22d13ce036e24adc8999a5fb..e020c81f3455e03b84cbf66fe0599b0b6e70339b 100644 (file)
@@ -30,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, octep_pci_id_tbl);
 MODULE_AUTHOR("Veerasenareddy Burru <vburru@marvell.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) {
index 520f2c3664f96170da64426630facdad146a1a92..025626a613837cb7ef5c8787bbba77dc14c83101 100644 (file)
 #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"