From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA7EBC4363A for ; Mon, 26 Oct 2020 11:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8796C2464E for ; Mon, 26 Oct 2020 11:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603711221; bh=UBkXRzDgi1l73AkPFzD2IDEqELXSl/ae0MIMXmf/MP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u4cdGQDqcU06aIM0d1NnYrw6F/rn0dwTvS06wMbFLepfmjGKhXDUSQYtcsyokv43D nI2MInfSaqhizlyfwOPS7TzhGwl+yItsY/0N7TCPBTn44u56hfgKYSEL2MTQppmLWA OXGkAR8LDBpNWTAwP00I1fVaxvHprQ0Zimj+au/A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1773321AbgJZLTM (ORCPT ); Mon, 26 Oct 2020 07:19:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:47938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1771082AbgJZLTI (ORCPT ); Mon, 26 Oct 2020 07:19:08 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C3A122281; Mon, 26 Oct 2020 11:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603711147; bh=UBkXRzDgi1l73AkPFzD2IDEqELXSl/ae0MIMXmf/MP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJyr2o9MFGZkBQ1CNXQXoebQer9oipZK0+mnMy7h0Mmji1O9SIoJwPRlED7rCc1cm wOSkd8goawyqIShw6i54dqfrqMJmmbVYrxW0rzgBX2ZgRThLlfbvVxYJgVc68cFPbX dw8KEDM3PKall6e+lgfmlfFMfepOPHemhkLoO3TI= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , Jakub Kicinski , Jason Wang , linux-rdma@vger.kernel.org, "Michael S. Tsirkin" , netdev@vger.kernel.org, Parav Pandit , Roi Dayan , Saeed Mahameed , virtualization@lists.linux-foundation.org, alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, "David S . Miller" , ranjani.sridharan@linux.intel.com, pierre-louis.bossart@linux.intel.com, fred.oh@linux.intel.com, shiraz.saleem@intel.com, dan.j.williams@intel.com, kiran.patil@intel.com, linux-kernel@vger.kernel.org Subject: [PATCH mlx5-next 02/11] net/mlx5: Properly convey driver version to firmware Date: Mon, 26 Oct 2020 13:18:40 +0200 Message-Id: <20201026111849.1035786-3-leon@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201026111849.1035786-1-leon@kernel.org> References: <20201026111849.1035786-1-leon@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky mlx5 firmware expects driver version in specific format X.X.X, so make it always correct and based on real kernel version aligned with the driver. Fixes: 012e50e109fd ("net/mlx5: Set driver version into firmware") Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 8ff207aa1479..71e210f22f69 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -50,6 +50,7 @@ #ifdef CONFIG_RFS_ACCEL #include #endif +#include #include #include "mlx5_core.h" #include "lib/eq.h" @@ -233,7 +234,10 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev) strncat(string, ",", remaining_size); remaining_size = max_t(int, 0, driver_ver_sz - strlen(string)); - strncat(string, DRIVER_VERSION, remaining_size); + + snprintf(string + strlen(string), remaining_size, "%u.%u.%u", + (u8)(LINUX_VERSION_CODE >> 16), (u8)(LINUX_VERSION_CODE >> 8), + (u16)(LINUX_VERSION_CODE & 0xff)); /*Send the command*/ MLX5_SET(set_driver_version_in, in, opcode, -- 2.26.2