Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11542908ybi; Thu, 25 Jul 2019 18:51:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPin+ZTdYVPXRCcjuaJAc2gGe8KSxvzo3oJsCp7t0SdytdaTqXUV07h+zUUU1aP8YQOLQf X-Received: by 2002:a62:fb15:: with SMTP id x21mr11647801pfm.233.1564105891786; Thu, 25 Jul 2019 18:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564105891; cv=none; d=google.com; s=arc-20160816; b=p9w/UJZ238UHcTXs3R/x2QmxTOnxyjGfxW+rHQewV92viOeLpqDw/4fRrmYA0quoko XIV9vXyOjy0zNF0PLm1F+OANTS9eoJCBW5vxziChojhXb1YhLBMC0VIeLwQ5tj6tIdBg 334dh/uMAPgDXdAXz9a46kZ8PxJ/b4SD+BUUwJbeE4XX7PKLAQzvYkUn/pE/rBLAE5Uq o4pLC2987VHLnbliZz9ZcCECOYsaZMtghOcd5PuW7Bq5YNUULA1TPe7/wWUbEyWXeCf+ w5Puen2yAisF5gx9dCuWdE2d/mnlnVvynm0c6E28MCoh3Pl1NFCcCGY5DiImFn+55zMA L3TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Kcuwc+B7UgqzhEohXemu5v0dhOjItWtICHwsbRYWd3M=; b=A3Y6lq76aykQCEzWPLYMAbfrZlB6bHhmj4S1jXkRGpdJHfdKsyatfRXDt4gBkOKu+7 DYEADvnFIXuHYeIy2rRfwOKYf6R+ZnwEoLS8wk5Yat1ohNU0WPvt2xIauObJxkRRyiEo Ys8eIQQTyntC5wLx8DjsQnkzCQ5XSHPx2Szllfd+GM1HuBIfM9Rr/wHwQdJG/m4CXnId t9Yk1hK6dMwcz+6EbKdy79bV936yHXQduD7mMV9uPCtvjV7kpGVBFMVml9lm5pWTgW9j ptaXL8DGoDoAeYrByYllWW9Cmi8zzuYI1LFH9uAAgpdu3Rvdxt3tUNhj8Yawbd3Hx1b5 P/6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m71si16609733pjb.26.2019.07.25.18.51.16; Thu, 25 Jul 2019 18:51:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbfGZBun (ORCPT + 99 others); Thu, 25 Jul 2019 21:50:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2729 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725854AbfGZBum (ORCPT ); Thu, 25 Jul 2019 21:50:42 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D45B9F512131EE80859A; Fri, 26 Jul 2019 09:50:40 +0800 (CST) Received: from [127.0.0.1] (10.74.149.191) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Jul 2019 09:50:33 +0800 Subject: Re: [PATCH net-next 06/11] net: hns3: modify firmware version display format To: Saeed Mahameed , "davem@davemloft.net" CC: "lipeng321@huawei.com" , "yisen.zhuang@huawei.com" , "salil.mehta@huawei.com" , "linuxarm@huawei.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "moyufeng@huawei.com" References: <1563938327-9865-1-git-send-email-tanhuazhong@huawei.com> <1563938327-9865-7-git-send-email-tanhuazhong@huawei.com> <4c4ce27c9a9372340c0e2b0f654b3fb9cd85b3e4.camel@mellanox.com> <95783289-9b3b-f085-876b-49815b07d595@huawei.com> From: tanhuazhong Message-ID: <6c51adfc-b587-428a-2617-0532095d3d0a@huawei.com> Date: Fri, 26 Jul 2019 09:50:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.149.191] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/26 5:32, Saeed Mahameed wrote: > On Thu, 2019-07-25 at 10:34 +0800, tanhuazhong wrote: >> >> On 2019/7/25 2:34, Saeed Mahameed wrote: >>> On Wed, 2019-07-24 at 11:18 +0800, Huazhong Tan wrote: >>>> From: Yufeng Mo >>>> >>>> This patch modifies firmware version display format in >>>> hclge(vf)_cmd_init() and hns3_get_drvinfo(). Also, adds >>>> some optimizations for firmware version display format. >>>> >>>> Signed-off-by: Yufeng Mo >>>> Signed-off-by: Peng Li >>>> Signed-off-by: Huazhong Tan >>>> --- >>>> drivers/net/ethernet/hisilicon/hns3/hnae3.h | 9 >>>> +++++++++ >>>> drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 15 >>>> +++++++++++++-- >>>> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 10 >>>> +++++++++- >>>> drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 11 >>>> +++++++++-- >>>> 4 files changed, 40 insertions(+), 5 deletions(-) >>>> >>>> > > [...] > >>>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c >>>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c >>>> @@ -419,7 +419,15 @@ int hclge_cmd_init(struct hclge_dev *hdev) >>>> } >>>> hdev->fw_version = version; >>>> >>>> - dev_info(&hdev->pdev->dev, "The firmware version is %08x\n", >>>> version); >>>> + pr_info_once("The firmware version is %lu.%lu.%lu.%lu\n", >>>> + hnae3_get_field(version, >>>> HNAE3_FW_VERSION_BYTE3_MASK, >>>> + HNAE3_FW_VERSION_BYTE3_SHIFT), >>>> + hnae3_get_field(version, >>>> HNAE3_FW_VERSION_BYTE2_MASK, >>>> + HNAE3_FW_VERSION_BYTE2_SHIFT), >>>> + hnae3_get_field(version, >>>> HNAE3_FW_VERSION_BYTE1_MASK, >>>> + HNAE3_FW_VERSION_BYTE1_SHIFT), >>>> + hnae3_get_field(version, >>>> HNAE3_FW_VERSION_BYTE0_MASK, >>>> + HNAE3_FW_VERSION_BYTE0_SHIFT)); >>>> >>> >>> Device name/string will not be printed now, what happens if i have >>> multiple devices ? at least print the device name as it was before >>> >> Since on each board we only have one firmware, the firmware >> version is same per device, and will not change when running. >> So pr_info_once() looks good for this case. >> > > boards change too often to have such static assumption. Ok, I will use dev_info instead of pr_info here. > >> BTW, maybe we should change below print in the end of >> hclge_init_ae_dev(), use dev_info() instead of pr_info(), >> then we can know that which device has already initialized. >> I will send other patch to do that, is it acceptable for you? >> >> "pr_info("%s driver initialization finished.\n", HCLGE_DRIVER_NAME);" >> > > I would avoid using pr_info when i can ! if you have the option to > print with dev information as it was before that is preferable. > > Thanks, > Saeed. > Thanks, Huazhong.