From 56139cc52bda17e257785226334fa2f25b5bcd95 Mon Sep 17 00:00:00 2001 From: Til Kaiser Date: Sat, 8 Feb 2025 12:01:32 +0100 Subject: [PATCH] mstflint: update to 4.31.0 This commit updates the mstflint package to the latest 4.31.0 release. It also includes patches to fix some build errors that have been merged into their development branch [1] but are not inside the current release version. [1] https://github.com/Mellanox/mstflint/pull/1131 Signed-off-by: Til Kaiser --- utils/mstflint/Makefile | 6 +-- ...nclude-missing-function-declarations.patch | 49 +++++++++++++++++++ .../0002-fwctrl-fix-reg-status-typo.patch | 40 +++++++++++++++ ...include-missing-function-declaration.patch | 31 ++++++++++++ 4 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 utils/mstflint/patches/0001-fwctrl-include-missing-function-declarations.patch create mode 100644 utils/mstflint/patches/0002-fwctrl-fix-reg-status-typo.patch create mode 100644 utils/mstflint/patches/0003-dev_mgt-include-missing-function-declaration.patch diff --git a/utils/mstflint/Makefile b/utils/mstflint/Makefile index 741a764b40..928152fbe5 100644 --- a/utils/mstflint/Makefile +++ b/utils/mstflint/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mstflint -PKG_VERSION:=4.30.0 +PKG_VERSION:=4.31.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-1.tar.gz PKG_SOURCE_URL:=https://github.com/Mellanox/$(PKG_NAME)/releases/download/v$(PKG_VERSION)-1 -PKG_SOURCE_DATE:=2024-11-06 -PKG_HASH:=f2fd1a795cb56466f335d2fbd55d6a9bab20132d1edde6f61750cff0bde6da7b +PKG_SOURCE_DATE:=2025-02-06 +PKG_HASH:=c0152414e7580a18925c7707ebe2cb659d3a1ed7b80015a35bea4d723b64f8e7 PKG_MAINTAINER:=Til Kaiser PKG_LICENSE:=GPL-2.0-only diff --git a/utils/mstflint/patches/0001-fwctrl-include-missing-function-declarations.patch b/utils/mstflint/patches/0001-fwctrl-include-missing-function-declarations.patch new file mode 100644 index 0000000000..4d5e1eb39c --- /dev/null +++ b/utils/mstflint/patches/0001-fwctrl-include-missing-function-declarations.patch @@ -0,0 +1,49 @@ +From 215d3c274125321ea6254b59dc28996370705d5e Mon Sep 17 00:00:00 2001 +From: Til Kaiser +Date: Fri, 7 Feb 2025 14:26:52 +0100 +Subject: [PATCH 1/3] fwctrl: include missing function declarations + +The fwctrl fails to build with the following error: + +fwctrl.c: In function 'fwctl_control_access_register': +fwctrl.c:190:27: error: implicit declaration of function 'return_by_reg_status' [-Wimplicit-function-declaration] + 190 | *reg_status = return_by_reg_status(cmd_status); + | ^~~~~~~~~~~~~~~~~~~~ +In file included from fwctrl.c:45: +fwctrl.c:195:56: error: implicit declaration of function 'm_err2str' [-Wimplicit-function-declaration] + 195 | reg_id, cmd_status, *reg_status, m_err2str(status)); + | + +This commit adds the return_by_reg_status prototype to the +mtcr_ul_com.h file and includes mtcr_ul_com.h and mtcr.h +(where the m_err2str prototype is defined) inside fwctrl.c. + +Signed-off-by: Til Kaiser +--- + mtcr_ul/fwctrl.c | 2 ++ + mtcr_ul/mtcr_ul_com.h | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/mtcr_ul/fwctrl.c ++++ b/mtcr_ul/fwctrl.c +@@ -40,7 +40,9 @@ + #include + #include + #include ++#include "mtcr.h" + #include "mtcr_mf.h" ++#include "mtcr_ul_com.h" + #include "fwctrl.h" + #include "fwctrl_ioctl.h" + +--- a/mtcr_ul/mtcr_ul_com.h ++++ b/mtcr_ul/mtcr_ul_com.h +@@ -165,6 +165,8 @@ int mclear_pci_semaphore_ul(const char* + + int mvpd_read4_ul(mfile* mf, unsigned int offset, u_int8_t value[4]); + ++int return_by_reg_status(int reg_status); ++ + int space_to_cap_offset(int space); + + int get_dma_pages(mfile* mf, struct mtcr_page_info* page_info, int page_amount); diff --git a/utils/mstflint/patches/0002-fwctrl-fix-reg-status-typo.patch b/utils/mstflint/patches/0002-fwctrl-fix-reg-status-typo.patch new file mode 100644 index 0000000000..826562d7f9 --- /dev/null +++ b/utils/mstflint/patches/0002-fwctrl-fix-reg-status-typo.patch @@ -0,0 +1,40 @@ +From 873c1822521b0524571ba54f4ce5d565fbf59c1f Mon Sep 17 00:00:00 2001 +From: Til Kaiser +Date: Fri, 7 Feb 2025 14:42:25 +0100 +Subject: [PATCH 2/3] fwctrl: fix reg status typo + +There is the following build error: + +fwctrl.c: In function 'fwctl_control_access_register': +fwctrl.c:197:66: error: incompatible type for argument 1 of 'm_err2str' + 197 | reg_id, cmd_status, *reg_status, m_err2str(status)); + | ^~~~~~ + | | + | void * +../include/mtcr_ul/fwctrl_ioctl.h:47:81: note: in definition of macro 'FWCTL_DEBUG_PRINT' + 47 | printf("%s: %s %d: " format, FWCTL_ENV_VAR_DEBUG, __func__, __LINE__, ##arg); \ + | ^~~ +In file included from fwctrl.c:43: +../include/mtcr_ul/mtcr.h:173:30: note: expected 'MError' but argument is of type 'void *' + 173 | const char* m_err2str(MError status); + | ~~~~~~~^~~~~~ + +Looking at the format string, this seems to be just a typo, +so fix that to the correct variable name. + +Signed-off-by: Til Kaiser +--- + mtcr_ul/fwctrl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mtcr_ul/fwctrl.c ++++ b/mtcr_ul/fwctrl.c +@@ -194,7 +194,7 @@ int fwctl_control_access_register(int + } + + FWCTL_DEBUG_PRINT(mf, "register id = 0x%x, command status = 0x%x, reg status code: 0x%x, reg status: %s\n", +- reg_id, cmd_status, *reg_status, m_err2str(status)); ++ reg_id, cmd_status, *reg_status, m_err2str(*reg_status)); + out: + free(out); + free(in); diff --git a/utils/mstflint/patches/0003-dev_mgt-include-missing-function-declaration.patch b/utils/mstflint/patches/0003-dev_mgt-include-missing-function-declaration.patch new file mode 100644 index 0000000000..73aa962aea --- /dev/null +++ b/utils/mstflint/patches/0003-dev_mgt-include-missing-function-declaration.patch @@ -0,0 +1,31 @@ +From dea0155b131b55cdc1bb3bc867ad53c1782fa724 Mon Sep 17 00:00:00 2001 +From: Til Kaiser +Date: Fri, 7 Feb 2025 14:52:35 +0100 +Subject: [PATCH 3/3] dev_mgt: include missing function declaration + +The dev_mgt fails to build with the following error: + +tools_dev_types.c: In function 'dm_get_device_id_inner': +tools_dev_types.c:695:13: error: implicit declaration of function 'read_device_id'; did you mean 'dm_get_device_id'? [-Wimplicit-function-declaration] + 695 | if (read_device_id(mf, &dword) != 4) { + | ^~~~~~~~~~~~~~ + | dm_get_device_id + +This commit includes mtcr_ul_com.h (where read_device_id +is defined) into tools_dev_types.c to fix the error. + +Signed-off-by: Til Kaiser +--- + dev_mgt/tools_dev_types.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/dev_mgt/tools_dev_types.c ++++ b/dev_mgt/tools_dev_types.c +@@ -48,6 +48,7 @@ + #include + #include "tools_dev_types.h" + #include "mflash/mflash_types.h" ++#include "mtcr_ul/mtcr_ul_com.h" + + enum dm_dev_type { + DM_UNKNOWN = -1, -- 2.30.2