Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9172560pxu; Mon, 28 Dec 2020 08:22:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeKk+VVsokGMa/VAMCiJGuE71E4Afcbc4EcCL1Ci1DJHvzlK9KcZn9N5E4A6yfU4HH49r3 X-Received: by 2002:a17:906:890:: with SMTP id n16mr42532487eje.463.1609172554206; Mon, 28 Dec 2020 08:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172554; cv=none; d=google.com; s=arc-20160816; b=Dw6kNZyUrwiYMQfbP9q63g0ab8s0548Dci3QMKTwZK3kKaTQM4zrAsrsPLJOw072hD nuiti2/r2xDl2wd2WNlgAAfxS4Sjj6UaMsOu9aA6za75Am63qJxdRRFOkaP4VKrvcnQL zY46PGCZMS4KSNugWbaUAhfp7lVS++yyxNtQ8OUWTgZ3NPjS5PMfkK9dcFUEnUHD3Oxx CiyCJSvzxXbQVWtf7lik+mGLcUCyIvrkTjQhrVn4WhYSnb7E1h7wFyAj/ZJltNYNVXZd K3JrSg5yZ6oKfuJefaDDwbCgi904D1A8i/Lghx2kPLdeEReZiFT1Eb+ptQRIQ9O3dqJm ClTg== 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=M8wpf1/B+0NwjKQw+xQA/Bdjgb5j69FrM9iMfw3Dfrc=; b=Sq239grUcubG306AY0PwTS4KfFRXJQDQwaJx40G31hgUntfZF0mbiG5hqtNbRkP9QI MmHHcUuiAmvMAo+1i8prW/5XKpuNHkI7pWCpXo535BdkjTfVXrasJQoGRus3y8HyRHWs 3IB/t/z3SDKubn46EepdOK8Nhm/2vhe3ErzyPkSqy3JtY3PybY2fwG2E9WWr2CWTl/Vi DYdeh+Iexdzs5CGP2gNxN/QhLJUXBrZYKlExRPa6x86e96YN/nISMDzLRl39Bmz0Rp1P kNf2N3c2DjrpUuL26MflzV9I6S80sh73cCqN8hW4iZMJfxrfTuhYR+1iaEyGBWddlM/y Gjcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jaUcr9e5; 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 bu26si19423171edb.284.2020.12.28.08.22.11; Mon, 28 Dec 2020 08:22:34 -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=jaUcr9e5; 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 S1732408AbgL1NOJ (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:42214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732382AbgL1NOE (ORCPT ); Mon, 28 Dec 2020 08:14:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED5DA208BA; Mon, 28 Dec 2020 13:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161203; bh=sxK1OPT0/O2hOVRIPuksVqKHu0D+wcbjUwnwMnkF/40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jaUcr9e5lrpryOM+keGGbofA9mxVTiR1SApIqxJ472UbUyjkn39FiX6dwupAPSJp6 4IXLhcieJM4XkpF5jZPAormg+0rXE1Y3HGA9HNpB6/PGAf4+ehyPAJ1GLwrSRpzEkU CUXceK4BiSKxIhUheXsv4R42vfo/SnqFr+uNKF5g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Sasha Levin Subject: [PATCH 4.14 135/242] net/mlx5: Properly convey driver version to firmware Date: Mon, 28 Dec 2020 13:49:00 +0100 Message-Id: <20201228124911.353183171@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 1ac0e173da12c..049d9d19c66d9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -51,6 +51,7 @@ #ifdef CONFIG_RFS_ACCEL #include #endif +#include #include #include "mlx5_core.h" #include "fs_core.h" @@ -204,7 +205,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