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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D05C46467 for ; Sun, 27 Nov 2022 08:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbiK0IRP (ORCPT ); Sun, 27 Nov 2022 03:17:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbiK0IQz (ORCPT ); Sun, 27 Nov 2022 03:16:55 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EF601114A; Sun, 27 Nov 2022 00:16:47 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso11246645pjt.0; Sun, 27 Nov 2022 00:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=uaOXK+3zj1VRT6U3g5h3Ky+R8tcH0ZCUYvy33QfB7vM=; b=ifVBNcP32bWIkNZkPVHGPmhBD7EYsQ8f4oy3RqHII0Z8/SwDG7tbP1hOmyJ+RX9RWI +N1FmQkYpl9q5DzO6JWt26CrMNcA3QOT//FHn0TOSL3knf4EikL7CxKVhwKVfjlgUtZd bsFIK5/jXRJxZiCHv7tBPt97OljhUlcunJpoBbiTCWh2K4hyRsXe6CiTBPh56QmLhfZa gtq/OFeQVdLsfUArQRaYV/NLO1dUjVVPF5eJgZF4McINAxYOpoDRZD+TfkHPlBnn6UkN fHI0f3jrLJ4rVz3Y6pyWc7bgIIK5+ilcWDWno5TduNkmqv0mhNEvphXo3O7C7k63cMvA AsrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uaOXK+3zj1VRT6U3g5h3Ky+R8tcH0ZCUYvy33QfB7vM=; b=i8FFmqizAnR7yFSzeZQFARKhxdrPMzRolKTKXx2Irc5EqZ58Pc14XzeObWJKxlluX8 5Jh2lmknDz/mUqaInccSuh+GnQpLUr0YFCndtgugKTtPSdLieJzyg0y+If0IEGKDO7d4 7snLW6AVgtigp3teKO4cuXtNRZ1OM/vQuptN0PRiEvByS7aiVQF0vEFRaUOW552tbHEd IutRcz+NrXlYmtv7Pqd+mkY6gebTZaWacLE+GXzdQiQJ1ekBYtij0KsPQ2tbt/SF5BL2 yp3DlCt7z/eLHed1je3BlSDfDiPzDuWNPU3EhpkdW9x6QD3SPoNTI7kEX9x8anj3lxZI dvUA== X-Gm-Message-State: ANoB5plNaq0u6nyWiDO707nd5DoOrQJF3xejbzsFyc8lTym8Q1XYqDbe YrBI+FoyKkv9Fl48AFMct98= X-Google-Smtp-Source: AA0mqf5VHz3WzW4yABHf3SMGky4I1aN6x5psCE6vYqJXlVtP74c71tuH5yn2LW5vSPh7UnwtWVA+Cg== X-Received: by 2002:a17:902:a989:b0:188:d6c7:e7b7 with SMTP id bh9-20020a170902a98900b00188d6c7e7b7mr26560851plb.16.1669537006426; Sun, 27 Nov 2022 00:16:46 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id a3-20020aa794a3000000b00572c12a1e91sm5799915pfl.48.2022.11.27.00.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 00:16:46 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: Jiri Pirko , netdev@vger.kernel.org, Jakub Kicinski Cc: "David S . Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, Boris Brezillon , Arnaud Ebalard , Srujana Challa , Kurt Kanzenbach , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Michael Chan , Ioana Ciornei , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Taras Chornyi , Saeed Mahameed , Leon Romanovsky , Ido Schimmel , Petr Machata , Simon Horman , Shannon Nelson , drivers@pensando.io, Ariel Elior , Manish Chopra , Jonathan Lemon , Vadim Fedorenko , Richard Cochran , Vadim Pasternak , Shalom Toledo , linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, Vincent Mailhol , Ido Schimmel Subject: [PATCH net-next v2 2/5] mlxsw: core: fix mlxsw_devlink_info_get() to correctly report driver name Date: Sun, 27 Nov 2022 17:16:01 +0900 Message-Id: <20221127081604.5242-3-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> References: <20221122154934.13937-1-mailhol.vincent@wanadoo.fr> <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Currently, mlxsw_devlink_info_get() reports the device_kind. The device_kind is not necessarily the same as the device_name. For example, the mlxsw_i2c implementation sets up the device_kind as ic2_client::name in [1] which indicates the type of the device (e.g. chip name). Fix it so that it correctly reports the driver name. [1] https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/i2c.c#L714 Fixes: a9c8336f6544 ("mlxsw: core: Add support for devlink info command") CC: Shalom Toledo CC: Ido Schimmel CC: Vadim Pasternak Signed-off-by: Vincent Mailhol --- drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index a83f6bc30072..d8b1bb03cdb0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -1453,6 +1453,7 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, struct netlink_ext_ack *extack) { struct mlxsw_core *mlxsw_core = devlink_priv(devlink); + struct device *dev = mlxsw_core->bus_info->dev; char fw_info_psid[MLXSW_REG_MGIR_FW_INFO_PSID_SIZE]; u32 hw_rev, fw_major, fw_minor, fw_sub_minor; char mgir_pl[MLXSW_REG_MGIR_LEN]; @@ -1460,7 +1461,7 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, int err; err = devlink_info_driver_name_put(req, - mlxsw_core->bus_info->device_kind); + dev_driver_string(dev->parent)); if (err) return err; -- 2.37.4 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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6DAF0C4332F for ; Mon, 28 Nov 2022 16:32:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 05A2C60C13; Mon, 28 Nov 2022 16:32:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 05A2C60C13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1669653134; bh=ID7BkEE7eU804EtlrdTJmi4Ba/kVlYaUs/hgD8aTmZA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=HCWdWvZ52j/qtvlq23mLHCckbtZMfhZGnJEHvz8D7JbqFm8vjjThlq4AZXpV4eU/F E6lvpHfflSKJY+8X0wdz3ja17SHgK0t6vKIqGR8yDJmRte9KN3Y+46C3ZgL9ooF73d irRmJPHKiJa5Inyw79/Q2iWqxmrubmGoE1xjxDTWDSfuJGUnMCZBEjseAKR1XgQroF VvFQrmH4Eeu+uuUd96gTyC+Aa1PKJbCoGFJOu7wyPM//g/64Tq97+DYNiAbn+Xir++ GmNo2AaZ6JZ0bmEUGOMdRb40NcYdzIf0lt5X3MaxU8ZfV+iFdEEwXosmJ0obHpyCak KmVU5zCe13ZkA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zJGjbt3ODv9g; Mon, 28 Nov 2022 16:32:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 35AB260BFC; Mon, 28 Nov 2022 16:32:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 35AB260BFC Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 58F3A1BF470 for ; Sun, 27 Nov 2022 08:16:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 40864415EF for ; Sun, 27 Nov 2022 08:16:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 40864415EF X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UpwUw6cF-THw for ; Sun, 27 Nov 2022 08:16:47 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2608C415E5 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2608C415E5 for ; Sun, 27 Nov 2022 08:16:47 +0000 (UTC) Received: by mail-pl1-x632.google.com with SMTP id j12so7498287plj.5 for ; Sun, 27 Nov 2022 00:16:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uaOXK+3zj1VRT6U3g5h3Ky+R8tcH0ZCUYvy33QfB7vM=; b=o5eWIUrxVpBiZm0vW+bpOJ7jPRZJmqRGV7gkV5WAj9C9L9rb1/pxJ3zn3KTYVo8M7R w6oMGbTBPRu8RiZEWSJhVox5S6/RPXJJvbLr1NMU28T7Am5qv30sji3xW7CwEOHyB22n ICkfnd3qTnwaEy5j405g39eMDPLfHgDeU4GjuKJwOq9HsoozoQXAkE4FwXPyTvNOXCZI S9sWHicKASZXAORu2JhBLly5bjLl3yV+NrySh2v6/HrqsNs4a2iGAX0nKFNOdsakL4Zg zY/Xv5gPxaNXhybW+kRUfqnn9NZPl0dD18dDCODwY+tZRQndXdZNLbfS9RjNmIevm40h YNoQ== X-Gm-Message-State: ANoB5pmzYclK9VlhdT1BMDlq/+6+bfAjLRWZoZAwI3mpe6niMGoUxScm ylA5D/WPwNiR3LRiyzukcTM= X-Google-Smtp-Source: AA0mqf5VHz3WzW4yABHf3SMGky4I1aN6x5psCE6vYqJXlVtP74c71tuH5yn2LW5vSPh7UnwtWVA+Cg== X-Received: by 2002:a17:902:a989:b0:188:d6c7:e7b7 with SMTP id bh9-20020a170902a98900b00188d6c7e7b7mr26560851plb.16.1669537006426; Sun, 27 Nov 2022 00:16:46 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id a3-20020aa794a3000000b00572c12a1e91sm5799915pfl.48.2022.11.27.00.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 00:16:46 -0800 (PST) From: Vincent Mailhol To: Jiri Pirko , netdev@vger.kernel.org, Jakub Kicinski Date: Sun, 27 Nov 2022 17:16:01 +0900 Message-Id: <20221127081604.5242-3-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> References: <20221122154934.13937-1-mailhol.vincent@wanadoo.fr> <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Nov 2022 16:31:50 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=uaOXK+3zj1VRT6U3g5h3Ky+R8tcH0ZCUYvy33QfB7vM=; b=ifVBNcP32bWIkNZkPVHGPmhBD7EYsQ8f4oy3RqHII0Z8/SwDG7tbP1hOmyJ+RX9RWI +N1FmQkYpl9q5DzO6JWt26CrMNcA3QOT//FHn0TOSL3knf4EikL7CxKVhwKVfjlgUtZd bsFIK5/jXRJxZiCHv7tBPt97OljhUlcunJpoBbiTCWh2K4hyRsXe6CiTBPh56QmLhfZa gtq/OFeQVdLsfUArQRaYV/NLO1dUjVVPF5eJgZF4McINAxYOpoDRZD+TfkHPlBnn6UkN fHI0f3jrLJ4rVz3Y6pyWc7bgIIK5+ilcWDWno5TduNkmqv0mhNEvphXo3O7C7k63cMvA AsrA== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ifVBNcP3 Subject: [Intel-wired-lan] [PATCH net-next v2 2/5] mlxsw: core: fix mlxsw_devlink_info_get() to correctly report driver name X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Simon Horman , Kurt Kanzenbach , Eric Dumazet , Jerin Jacob , Subbaraya Sundeep , Ioana Ciornei , drivers@pensando.io, Linu Cherian , Florian Fainelli , Leon Romanovsky , linux-rdma@vger.kernel.org, Shalom Toledo , Srujana Challa , Shannon Nelson , intel-wired-lan@lists.osuosl.org, Vadim Fedorenko , Paolo Abeni , Yisen Zhuang , Sunil Goutham , Ariel Elior , Ido Schimmel , Richard Cochran , Arnaud Ebalard , Ido Schimmel , Michael Chan , Vincent Mailhol , Petr Machata , Salil Mehta , Dimitris Michailidis , Manish Chopra , Boris Brezillon , oss-drivers@corigine.com, Vadim Pasternak , linux-kernel@vger.kernel.org, "David S . Miller" , Taras Chornyi , hariprasad , linux-crypto@vger.kernel.org, Jonathan Lemon , Vladimir Oltean , Saeed Mahameed , Geetha sowjanya Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Currently, mlxsw_devlink_info_get() reports the device_kind. The device_kind is not necessarily the same as the device_name. For example, the mlxsw_i2c implementation sets up the device_kind as ic2_client::name in [1] which indicates the type of the device (e.g. chip name). Fix it so that it correctly reports the driver name. [1] https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/i2c.c#L714 Fixes: a9c8336f6544 ("mlxsw: core: Add support for devlink info command") CC: Shalom Toledo CC: Ido Schimmel CC: Vadim Pasternak Signed-off-by: Vincent Mailhol --- drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index a83f6bc30072..d8b1bb03cdb0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -1453,6 +1453,7 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, struct netlink_ext_ack *extack) { struct mlxsw_core *mlxsw_core = devlink_priv(devlink); + struct device *dev = mlxsw_core->bus_info->dev; char fw_info_psid[MLXSW_REG_MGIR_FW_INFO_PSID_SIZE]; u32 hw_rev, fw_major, fw_minor, fw_sub_minor; char mgir_pl[MLXSW_REG_MGIR_LEN]; @@ -1460,7 +1461,7 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, int err; err = devlink_info_driver_name_put(req, - mlxsw_core->bus_info->device_kind); + dev_driver_string(dev->parent)); if (err) return err; -- 2.37.4 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan