From patchwork Mon Oct 26 11:18:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11856813 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.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 E8C88C2D0A3 for ; Mon, 26 Oct 2020 11:21:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9A1124641 for ; Mon, 26 Oct 2020 11:21:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="TH4AHmHT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="jJyr2o9M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9A1124641 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5274316E9; Mon, 26 Oct 2020 12:20:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5274316E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1603711260; bh=UBkXRzDgi1l73AkPFzD2IDEqELXSl/ae0MIMXmf/MP8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TH4AHmHT1cowLJ9gW+FsQ9efP0XkT8Z6CLWuZdupneCPx7TpK9rksDuwMpVF7gRib VVHb3hhdL9rzS74D/edk2QK+Rwh1NiQ5MfV6emqSayY0yT8ecqdERvmUCK6+2rMSM7 N8nW2daTjGzEIX/pM3yHU1tugsFnWNlpM71UoKOA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 38BB6F8028B; Mon, 26 Oct 2020 12:19:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F455F804B3; Mon, 26 Oct 2020 12:19:15 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A40F9F8026D for ; Mon, 26 Oct 2020 12:19:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A40F9F8026D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="jJyr2o9M" 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 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 Cc: pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, kiran.patil@intel.com, "Michael S. Tsirkin" , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, Jason Wang , ranjani.sridharan@linux.intel.com, virtualization@lists.linux-foundation.org, fred.oh@linux.intel.com, tiwai@suse.de, broonie@kernel.org, Parav Pandit , Roi Dayan , shiraz.saleem@intel.com, Jakub Kicinski , dan.j.williams@intel.com, Leon Romanovsky , Saeed Mahameed , linux-kernel@vger.kernel.org, "David S . Miller" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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(-) -- 2.26.2 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,