Commit 31248b5a authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jakub Kicinski

octeon_ep: Remove custom driver version

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: 862cd659 ("octeon_ep: Add driver framework and device initialization")
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/5d76f3116ee795071ec044eabb815d6c2bdc7dbd.1649922731.git.leonro@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a992005c
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
#define OCTEP_CTRL_MBOX_INFO_MAGIC_NUM_OFFSET(m) (m) #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_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_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_INFO_FW_STATUS_OFFSET(m) ((m) + 144)
#define OCTEP_CTRL_MBOX_H2FQ_INFO_OFFSET(m) ((m) + OCTEP_CTRL_MBOX_INFO_SZ) #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) ...@@ -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) int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
{ {
u64 version, magic_num, status; u64 magic_num, status;
if (!mbox) if (!mbox)
return -EINVAL; return -EINVAL;
...@@ -81,13 +79,6 @@ int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox) ...@@ -81,13 +79,6 @@ int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
return -EINVAL; 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)); status = readq(OCTEP_CTRL_MBOX_INFO_FW_STATUS_OFFSET(mbox->barmem));
if (status != OCTEP_CTRL_MBOX_STATUS_READY) { if (status != OCTEP_CTRL_MBOX_STATUS_READY) {
pr_info("octep_ctrl_mbox : Firmware is not ready.\n"); pr_info("octep_ctrl_mbox : Firmware is not ready.\n");
...@@ -96,7 +87,6 @@ int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox) ...@@ -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)); 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)); 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)); 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) ...@@ -248,7 +238,6 @@ int octep_ctrl_mbox_uninit(struct octep_ctrl_mbox *mbox)
writeq(OCTEP_CTRL_MBOX_STATUS_INVALID, writeq(OCTEP_CTRL_MBOX_STATUS_INVALID,
OCTEP_CTRL_MBOX_INFO_HOST_STATUS_OFFSET(mbox->barmem)); 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"); pr_info("Octep ctrl mbox : Uninit successful.\n");
......
...@@ -30,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, octep_pci_id_tbl); ...@@ -30,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, octep_pci_id_tbl);
MODULE_AUTHOR("Veerasenareddy Burru <vburru@marvell.com>"); MODULE_AUTHOR("Veerasenareddy Burru <vburru@marvell.com>");
MODULE_DESCRIPTION(OCTEP_DRV_STRING); MODULE_DESCRIPTION(OCTEP_DRV_STRING);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(OCTEP_DRV_VERSION_STR);
/** /**
* octep_alloc_ioq_vectors() - Allocate Tx/Rx Queue interrupt info. * octep_alloc_ioq_vectors() - Allocate Tx/Rx Queue interrupt info.
...@@ -950,7 +949,6 @@ int octep_device_setup(struct octep_device *oct) ...@@ -950,7 +949,6 @@ int octep_device_setup(struct octep_device *oct)
/* Initialize control mbox */ /* Initialize control mbox */
ctrl_mbox = &oct->ctrl_mbox; ctrl_mbox = &oct->ctrl_mbox;
ctrl_mbox->version = OCTEP_DRV_VERSION;
ctrl_mbox->barmem = CFG_GET_CTRL_MBOX_MEM_ADDR(oct->conf); ctrl_mbox->barmem = CFG_GET_CTRL_MBOX_MEM_ADDR(oct->conf);
ret = octep_ctrl_mbox_init(ctrl_mbox); ret = octep_ctrl_mbox_init(ctrl_mbox);
if (ret) { if (ret) {
......
...@@ -12,15 +12,6 @@ ...@@ -12,15 +12,6 @@
#include "octep_rx.h" #include "octep_rx.h"
#include "octep_ctrl_mbox.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_NAME "octeon_ep"
#define OCTEP_DRV_STRING "Marvell Octeon EndPoint NIC Driver" #define OCTEP_DRV_STRING "Marvell Octeon EndPoint NIC Driver"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment