Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9114943pxu; Mon, 28 Dec 2020 07:02:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHM8ojwi0M/03c+JzXl1TPS2gezTrYLObdfHYfI5RT1/ZaMbGC8bJ+hY5Lr8m/xRaimgsB X-Received: by 2002:a50:f61b:: with SMTP id c27mr42305620edn.61.1609167734976; Mon, 28 Dec 2020 07:02:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167734; cv=none; d=google.com; s=arc-20160816; b=GytrsX7SMvRODAzQq1lpuYfNU1czteIN01vtO0M8T/6y8u8mrpG1Ng8Cbny5SZ5sHn KxNFYf8LtB3ZU+NG09PS0z/D/HespCUzyF4eJHLIPfRK9OzG3HeRnQkPAK26s+mhLXvt sg3iCnQQoR/3VHnjDNQ1c0CY1afdclbvwu7uIzMiwq3FUb07CEU48p0BqKT2mbDkyyfy +xQmMN4dG9T7cG4HdwLpD07kQjIiLfkFtovHIi+/hP21hYRh/hjW4mhVV5nPwPLwKq0y 0dml3ZA94Um7o0AN009K+YinTm2RCdh6HbDCcvdmTLy6ZqTPwW0BPj7DMniPfKBWjStI wPiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lpp+D52z5BWHRlmeQDcKi2DDI1o+zLfdNSL32aaw2BE=; b=1LDJhUEMYk+gAF8ujuI1KLCPj5Jgx0G3IOiHSLAng3nzkVRD6ZpjCUxpTaA/6C6r3G zVzOPXI52q/EQtpRQOw/j4RNDbWw9mOk9y69VPJbfzZA4DOGy+eF/jeLwhyhf358yvQg KZUdwdsd8wXT5fTkzrBHtjFAowhCT7swsfqWQkLT1fczuDC5P0f/sC/iwGKkP33Gq2QF 0cyLoLdiYj2WS6knNouXXJO9VEeX3KkWb7MaD079rCzTKn+JiFnG/svDmM72F0IBPn0p mgwAWk/36niMlQh/uc8B3ttcApds6Xptq5PXZBTjwXEXhp6u73bKVTExcHNm2GXTaBfq 4lLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mJfe1fcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 35si21486257edm.126.2020.12.28.07.01.51; Mon, 28 Dec 2020 07:02:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mJfe1fcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391765AbgL1PAK (ORCPT + 99 others); Mon, 28 Dec 2020 10:00:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:49076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440357AbgL1OON (ORCPT ); Mon, 28 Dec 2020 09:14:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D892A20715; Mon, 28 Dec 2020 14:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164813; bh=wcmKxwR9PM5XOJr+mOpXsc4uN0LazjCQbhJ2DSn2Wag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJfe1fcuNmPyHl5B+m9Rp7HV1Zdd6KMf5o9zCK4RvVKrbIfH8sQeUm/2Q5Gb7YKoU ERemMgpryIsOijC8z4k61/TSbk+V9eSr+sFjp/p8JDoK+sZ9dC6USfLnh1riQl6EpC 8+n+V+/DCYYSDGT6Bp/Kl9wHG1mmOT2wIJmiK/Tw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Sasha Levin Subject: [PATCH 5.10 306/717] net/mlx5: Properly convey driver version to firmware Date: Mon, 28 Dec 2020 13:45:04 +0100 Message-Id: <20201228125035.688467910@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky [ Upstream commit 907af0f0cab4ee5d5604f182ecec2c5b5119d294 ] 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 Signed-off-by: Sasha Levin --- 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 8ff207aa14792..e455a2f31f070 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) & 0xff), (u8)((LINUX_VERSION_CODE >> 8) & 0xff), + (u16)(LINUX_VERSION_CODE & 0xffff)); /*Send the command*/ MLX5_SET(set_driver_version_in, in, opcode, -- 2.27.0