From patchwork Tue Feb 22 17:16:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755716 X-Patchwork-Delegate: kuba@kernel.org 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 C10DDC433F5 for ; Tue, 22 Feb 2022 17:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbiBVRSE (ORCPT ); Tue, 22 Feb 2022 12:18:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbiBVRSD (ORCPT ); Tue, 22 Feb 2022 12:18:03 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6590210BBE3 for ; Tue, 22 Feb 2022 09:17:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cttvYnd3qUbw6NG8jQg0SKGAqGzTarop29nyHdIkJy0Vi/2bQcz/2s2Q+a75aeF3JyZqTpv3DsM1h1gEd6YUaEf1ISy4T2RYAJrxwe85WaSoxd00O708dKKGjTtQ5I9PgLgXkkzbWi9eJvbkplTP/lrNzIsrZ/y3Lh62yvO3HVf7lmVvWGeNVlATHDPsjJu0nA9pR7/mkzkVg0kPqlOUxn0Gxh397ojmeqyGspjUtbuNkRoa5RU9HfDXgsLzmQQkfWOzSHkmXkhxzybcVaz1nUTOAIOKJJYNTPkEgfLToaYlWmoSTNf6Fw7aWSkgr+onxgPpsNc8iQw14i3Zr231XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XLsntDp9QcCk7GyS/c9rNICdOZ/NiQLSWVM3fQqRHbs=; b=V9Z+ttehtfqEcuikGPinsS74a5KMSKOoUdZqtxX0Ie2RBVfY/5xaeWTOPxMmFaLWskXOrcEDXd7mrsnXfNHuHXWWmI/UxO65a+Mb+puZvKWnmGzGnM4VIpiWXfiwQTFFZamG7S5654ZxTUBsi8Gf1veR6dOB0WdCsz4aQo2WJ53F5vf3dYu67roUMmAr5/RqHyucLqLEN5fy9LchAmtNGTwskGt/ms75v+K6NUKpT2L/1cS+HRzdr4tUFzP9dki35+4b8dyK1eJe8Ggd/e+epc2syPNOKcnOqUU8rc+CC4t2S7c/K0O50pB177WOzdi3wXMFVIHT5HjjSa3IbvcPig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XLsntDp9QcCk7GyS/c9rNICdOZ/NiQLSWVM3fQqRHbs=; b=Csq1B0tnlKl5hAjdK6w8eXlQoifBKcWS15WgGf/SMIFscTDzN+Oh84U7xwcJvbHD4wyq6ya+HIT2f1rVWI9CBenRPHwzQ80ODgFzpgbQl/GmDG2xkRlvoFYJdwAee6lxPRUlg6Cq9kgE59gcGXy0+rjVflAIOTw6XysiObtNdV21KETUWMdFgoQQxhnjS3mLm6GKNwlQ2EjJjlQ/vmjg4H0F9jK09xGByK63ivXxmULuW5N5CHmrB4zuyoGPD/FU4lobx3GuRIJLAwjWmli4l3Q5fWNqf35Xc12HRLCgVNkaHZA5ea8ddm57cpZHe47V2KQ71fxKlN4OLUHe6EdaKw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Tue, 22 Feb 2022 17:17:36 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:17:36 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 01/12] mlxsw: core: Prevent trap group setting if driver does not support EMAD Date: Tue, 22 Feb 2022 19:16:52 +0200 Message-Id: <20220222171703.499645-2-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR08CA0145.eurprd08.prod.outlook.com (2603:10a6:800:d5::23) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5a7790e-56f9-4c23-b73e-08d9f6273889 X-MS-TrafficTypeDiagnostic: DM4PR12MB5214:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: voaCgE+CXJUH7byuRQUYxoU/ktrMj551soHK2iq6rYD13IAhdT3V2ngZcevJ2M8cLoxsx/ykCYahj7uuZCzq4k7Wqvu8+bouA3aQY1OMQRx22fhCp6aDy9UvvIsM5zV+qTKKOfAHukszdYw9lPXoNvjCMqmgU7Px1NDWiMIuUuSxY3x6xrNz0fSsvIAcZGtdsDExmVx5tSCe3X78jKpH8G9ucijC2SAPDS7Kq+o+RSHzcQfy/01aDV3k0Zejfk0B0TS60DIPANgPM7hZuVJP2TqQDqmSpekjrgUGh78WUWzRxVhkBoBHcU5m/rF3VO+mmIQVRB7Cf2k/M9jm3yyeNIQllUgXkoNKs4EW2ZT3L+ynx/UfT9R64KzGqVCQ22SDu8eAxG7HB7GOw4ju2DcDjvu0zH6kVZfkl5CZPnCgqvM32YoFLvu+ugJysbemgJffFFqonebxFPY48CwcXMwSVocyOHJzJFt2tt8LlVmtCuJlekv5LyBJX7RQHL2zwk6eJSQZCxtgny/KmsOO2NO/yQcevZ5sYQapuriK4fcW8kUI9ma54VXy/soGnZIyLgEk4ATMxV8Rw5anPrGbW0sfpRlFQpj38I5AMnFmboTDLpj1wUt+cJpInUVFXtIeHYrpIZadEg1DiTl2UNOxIbmzbA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6916009)(316002)(66556008)(107886003)(2906002)(2616005)(5660300002)(1076003)(8676002)(66476007)(6506007)(36756003)(6512007)(6486002)(508600001)(38100700002)(8936002)(66946007)(86362001)(26005)(4326008)(186003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ss4c94A7RJgYRcsboOheplJCN3V/dk9jNAPzwavX5zbWInD0s1Zwy/HHcgevmZQ5xf4AnGv0BnCgRPlrywU90eLG6THJBgOQ3Sz6Kds/XVn3djHkwzpgI4MJYVCI9mEKsQqzPVf5vvkCxljFZ2t5MzEMiDIBJMXcf5c8Z676XfNQJ6VbNuiIpiwtMaDK/H/+NTEnYV3qFXNBKFXYXWwhzmoncG/DCL73zxQzTz7sk5eWTh/JOdHsBUwIcyqF7MvEE1SQf7lcMtIp8MZADE2R1V4yZ8LM9Iqc95xveco4AWo0GwiD34tHB2stiR+8EViSOhtHU0SxebE5QLwzG+/DzQ/vZPjUtSL5wIJTcME69wVdLIT2QRfnFrg3bDxCs9lv50LjujJGTCed9E+p8/O37eDgNWXBJXdmV3Iz+fzCABv6868Ujw4Q1LiM+34u3spSGCba0R8qsIPGMbdkB/eXkjg2+8ehZZGAK8ZNQA4SydhqPUo5zVPiA+epDOJK2gsFvPQP8eixelTf0sh2EsB3z3lmWZgm4uR66o9vDUJs79T4OtqsxrtWAasZtqAW3XQNVS+7S+cPJy/nu5PYhsOvjNMIwlhswA8NhXeljR5l+dExYPnT5l4xbgkKrOvkJeQmkX1HS70FihX8LxiFOJS1ewXnKlay25p20Tu4bkQVYolcnptLbU/Cma/U4nNXoynCg0/9GZWqMY9deF70SKCrZI7g+TUGmk9v3ipLA7yxm51hqgNj3Mrt98R/WSnu+DOtsXzPmf5m2eSvDJzhQk0w1KZXgpFpg6u1ckm6rY9pJtcEb5vA9gnyQKGnNMIptaaF0npcJotX5LKZnZKtTKlVmZCoCY5AKhWMqMaxYzK2FhU7OmjCkoSLVUsJ9w93GzawdJcRWtrvBu4HwpFJ64z5AVOpgJrSfSMYEIC8KrkcjLKtcFn3AYi1F1Dt0K0muli75OWRgZx8Q7Mr25Taq529iEZzuae5rFe+t9YEPPSPKLrYnwUzXiBbmL0/jw6Fj80izNhAY+E0VMQ5hOClVvHf31wA6F7wggTmgIAuirdFfoT40YX4ccvtxGWx+kP2eSFrP7FmykMqjlRCKyYdwEWILo4aBZimbUsUkQ+1SSPxl0dLx9K/uhJhKEutlNBN2FJkNLbCLwJPQCuSfNfjmfM5jcKZqDzRaFR3vQAcMDhkawk0Q2pUihraPqDwmUWv7dJK7RN8XZyVrvyvr9lMAQJH8srrebvFm398LAxUIC6SyEsc+URztZ+VAly1KLOh51qjQ/eJBqoH2EzYCPkzQEtNiKC9MDLxpImHSyiUEMw/yknSflov5HUkoNnL6s80e0b0VYgn+DFduofvqpfhAVG1W8HqIDenugqe6fjIOYfUK8wzW9DehJpXQ7FgC/VlzzyavdnBOTT2tr26mmER1m5wlAZBuQIloygfz/ZXdDV9bs1jxs0xWoG5kQ00lzaEdNVG93+ZCEx9bmL6S+owuF4e5uC4BVcpQiqNmOSPN08NpSUe+TZVUtddpcb3FE7TDjvVNjAtKSmhjfUeBbR9EKV9hSpfbJqf2cpfwvzNkLr3a/rJCDcpu8HnETsKH2hHTTuu1mWiuD2p47HkTzPPD/1wT/EChhvGdAcuesQhHCqOeVI= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5a7790e-56f9-4c23-b73e-08d9f6273889 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:17:36.3887 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PRIV0vqu0LqDnLy3JO3UaAvca1AaGccz3Td7NoZj3MTXwXYpwIKpMSyUc4jzvXh3FEKbiPjIWmxBHI+rhUlTTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Avoid trap group setting if driver is not capable of EMAD support. For example, "mlxsw_minimal" driver works over I2C bus, overs which EMADs cannot be sent. Validation is performed by testing feature 'MLXSW_BUS_F_TXRX'. Fixes: 74e0494d35ac ("mlxsw: core: Move basic_trap_groups_set() call out of EMAD init code") Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index f45df5fbdcc0..1c6c1ea107a1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -223,6 +223,9 @@ static int mlxsw_core_trap_groups_set(struct mlxsw_core *mlxsw_core) int err; int i; + if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) + return 0; + for (i = 0; i < ARRAY_SIZE(mlxsw_core_trap_groups); i++) { mlxsw_reg_htgt_pack(htgt_pl, mlxsw_core_trap_groups[i], MLXSW_REG_HTGT_INVALID_POLICER, @@ -2522,6 +2525,9 @@ int mlxsw_core_trap_register(struct mlxsw_core *mlxsw_core, char hpkt_pl[MLXSW_REG_HPKT_LEN]; int err; + if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) + return 0; + err = mlxsw_core_listener_register(mlxsw_core, listener, priv, listener->enabled_on_register); if (err) @@ -2551,6 +2557,9 @@ void mlxsw_core_trap_unregister(struct mlxsw_core *mlxsw_core, { char hpkt_pl[MLXSW_REG_HPKT_LEN]; + if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) + return; + if (!listener->is_event) { mlxsw_reg_hpkt_pack(hpkt_pl, listener->dis_action, listener->trap_id, listener->dis_trap_group, From patchwork Tue Feb 22 17:16:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755717 X-Patchwork-Delegate: kuba@kernel.org 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 5F271C433FE for ; Tue, 22 Feb 2022 17:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234193AbiBVRSK (ORCPT ); Tue, 22 Feb 2022 12:18:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbiBVRSK (ORCPT ); Tue, 22 Feb 2022 12:18:10 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F35E10CF03 for ; Tue, 22 Feb 2022 09:17:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NgMgPpZya72vOE2RfrVs1/LLoLaBV331bJ+Mf25gQJR94N+qjc8TuO049pDuRStnfcGrlQy2ZSBX4G4MqrDt7PtN11r6sgeRzC5/55CxOXRQ4obTUT/3yfhalD4lEhC3YNAjUP2/0JkJ2Wxzc5HjcvQqvJhZJTazWtNLtXgmJnEg5kHYExen7Gfw5cSdzTy11SvbhePifLbLvck0XfskMdQNMjXI19hb+INILUHmQ5JQq/iaxlzg+8NK25gnfGBh+T/e2qvTQX2LfQDD15xywLjZUpuVYpQqFcbjHYxNqH/vpUN33+0+9rhEqAWPt2pADEpmwlHbHbCG0EXDWttI5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s13cF1kgJtxUaLY2ciGFS74SIhfwgSCm5rYAVT885SQ=; b=muRj9XzpSsav9TFyKDeSZ9JBOUZuyKW9nzBHgxlQV25k6SG9gJqa3dc/Q5p8TxSl+E8/z2a9ddnZdFQKnde/QxzcODIBbLSJhnDagQXiufS2q/ULckCjKmD+v5jKd91s0o2wZqBJzE0puXroS/OVZVJjK22ndgrWG4Cfw8tEzfx44VYbfg0gWipjbJd4+vDkC50HYz9Znqt4hwvQhp5wIrwdno8eH/3gkfgszkWGtz4UGKywgsHcqpSv5a96/SZqBgeIlys1f1hvXAjKqRghJsIm5Aab9bSztDjw410lpvza6HVE+U4Qd362vxnq/fvhqFMYt3g1UitVaALnRRxhfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s13cF1kgJtxUaLY2ciGFS74SIhfwgSCm5rYAVT885SQ=; b=Vz2utmDg7gSKoWdL4pToHkAGCJ0q8W4LbiHtFzWB2TnKvtuK8WrazVptrFzKAw1zKPXekDmn1DMETD13PpZfRLh1SsMsa5c4HtP9GkF2rB1oKDa5i13odbT7cf6q/APVyvtblOtGl9eGvw7Ql4JJIRdCRsP5yuzQZZDZGXa8hIHdEjy7TVcccQyLOzy/YL0MITf6JkUKyI7tgl9Lrh71TF8bE81zwqKeT4SQhMALJTy2LCJ+nVbxLb+VTN7xvtPw9enbDT4aspwWhteZUD79weItCid6obo6jPTMElHFdpBVncihQh2+o0z+hGdLKTYTBYGsV1FPfu1/ldXGnttttQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Tue, 22 Feb 2022 17:17:43 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:17:43 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel , Vladimir Oltean Subject: [PATCH net-next 02/12] mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring Date: Tue, 22 Feb 2022 19:16:53 +0200 Message-Id: <20220222171703.499645-3-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1P190CA0010.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::23) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1aeca05f-7240-4dfc-33c5-08d9f6273cc2 X-MS-TrafficTypeDiagnostic: DM4PR12MB5214:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1StfS6PQr1Adf6zlPLm9rO85dVT6mDx29GmgVVXifLn2LJGnVNxvH1mLT5Lpmx+hwfWOL0Pn9tU5TrugGIaCci2nLZcoHddiHFAGqO1HFuGyoC2GAsvSlbwVRiJrLSsY3DMc2Pmp2QX5ngsemVBUmeVAokkYgOaMgZElgCRRVeHJKTCKxYsUzpFDZdQyOPbwFyu88p3INi9juevp8lLKsKRvJESlugNyP+wun+bkhwj/4uAK9hiieiRh+IFbrjsaR5ykQJrRJtvnvnGnjQAAG48IPeNF986ccpz6qRV/RzYtLFTK2RDLeCpHds9IjSgNIvqBJatBLImy9oh00iOpGVyhuzSv3kEojkBsJUHEMOJwItDYuqL6/6jR6zXo6vd9Pf5mbrheHRwLw1X6yPRAG9OgKXIUyT7OILCzmBnTY44MZuLElx6jwR4loDnfMvTLOfA7KM2k/ZslTr89E1RCdqoMnl7rMCrlnb3D2bUMskgJybeZIWqXs26EZcFYsfg3sb6dbRD/7lMhlT4h1lC8eCl46LQopQcaYtKtWYbPiBdg2c5XWYPN4lqpzhVXJ8lj+jISPAkS1T7+gcvD9OfIqyuZPrHdR2Y61pl6PRZa0YpuKD8fZwiC2/qO6FIjncuk/a22OJyKGLlAFGOZZs+Idg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(54906003)(6916009)(316002)(66556008)(2906002)(2616005)(5660300002)(1076003)(8676002)(66476007)(6506007)(36756003)(6512007)(6486002)(508600001)(38100700002)(8936002)(66946007)(86362001)(26005)(4326008)(186003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3YdSQl0mcX2DR1wBMCyaaa6FPEN3JtVeMTYGdnuP8OuZI7EysFUTP79D7u41S7nBw5ayG8Cnz5nvcfsDiSC6Y4T8uk72yBGXbMRB7LMx6aE8FYppS8hxy477w/UTx5mPXaA7wFQyi8LZJDnWc53G9k8ci2yxz3lVVBSTjluCJcUpZ8kkVvr1NG3L252TZ0osFEQ1AmVOm/+tWHFJFA7djochWpHdNS2Ndwcnv0rBqX4n8V35o2uxZ8BKi+wVBNBzO5mPxdU2A+Fs51mDgOAJm+qBaN/kXGfVECuBeLCu9KdWYo6fRxp0apjmLMH4icRdjpTozxQeBaWF71w1imcy6qiifbk49EMD+4XTz13oSozy7tz4TYT9mR3A0ZTdH8qPO1H/Xx6iOfRYEUzm9JMEmjitIOQQQ6ZyJpwmivy7FE/QwcT7wiaVJoqATVhIc4/8fEHdxlVUk1fNT4cbYrG4Dsff7w89FFWBrTvhsgGnQe3dXpZjd7Dvr9ADipz0j8HHP9engq3ZvdQ3JIWwGgvN2jJppYj3lHg5CgDrPMuyEv+qN7UUcs48tm8m3pUL3vLgYpiGtO0BBmf0uq0mROQpvmnTCUAB4U90acyluthaZOfNSFrkwU4hRJVGMh9npFNDLN3vIs1cYRswwpTitUQwxogG1DzlSC9E5fsxGLMuDjn150S84NMMmGkbxpo6KxVCJimIvBruwlJiIJDyQS+VAL18HqsVLqtDAyRG1KFHp1XXdSz0c77VM2CkafaC21xMi36+JnKsn1dMdsFWWWVW3Tfz0/pug7DvAi1xbgFkGu59nWQdlskEtm4rNwatNYfJ3H/f9c1S2KGiNX0IwDyhRmLEQC1icUKjsVwQGeP8DzMtemJVqwr9Fy2OZ6ucoat1Zv487PiilxlgfnsNq5hgkVxnc1HgzRsxLgLUpHttMQ8u2ruwRJQ6hHYUQUViM3Hw3MOGmsDoEnbzdkmkScIH3NM0Lw/S5aOt/Yj4oyakA4GyUhxq/0kBnf2l3cmz1IqIzb6PJytOL6ztuegtYMy8k8uB5PZTUGe1GADDfkr1coSqNEuUwHFenE3crfWYJ/TCnn6i1NACR6QndSSD7ZkBGXE7mV7TXmfkWnuaEON3HPHkpOEFwvP6Da5uwVXd2MxCXCOzg4a1i66Q0kT/AnVFtoOcF5IUKmV5jrZ9FGCLYZE5foCEyHBsYx5nVbcoRbgl2M+5xTKl33ncWSR6iI1Ih/eDg8wBOMf1ce0OSKUHaw4aoY+RnTbtZl2ZwVVcz3ZHB3pe7bgwvxFQ3if/j6JEKS4NZV/dObxLsPQcttPIeXMHYJjD3VZc8H/9nHFw4nQdzDxD6tV2vrxQEvThlRXvhLsJ940AHi6izVTDk9FcQld8ANVCuLeZ51sVin8sWcl9H89cluQO/o3TP+UFpTHANFwS+Q9bAx2G4hK+eDKgPDhOnjRQzPrvuzRbKobExtSCkPI8dXRBjUcg21ffIwqcUtdHg9NeOXxJGIXRzi7e8VJnT/vM1XXvSkPaHiaEJFPvsdcd8TUqIcUyjPQM8UeRUvvYTkMhqWr4TVsgeP3I62jmHO+BnXzL6If0gbwYXQJ6XsjFo1oWZpzVvwfEAGitB8zU4bbbyTu7iAJJfendV0k= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1aeca05f-7240-4dfc-33c5-08d9f6273cc2 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:17:43.4559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xyMBHVv7KgzJojixYUAd9s29EquG75B33lgRXl6N/iELsFkpFE0NNBX5CDv8WqkGQFFXg/iInetCfEm02ERz1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Only VLAN entries installed on the bridge device itself should be considered when checking whether a packet with a specific VLAN can be mirrored via a bridge device. VLAN entries only used to keep context (i.e., entries with 'BRIDGE_VLAN_INFO_BRENTRY' unset) should be ignored. Fix this by preventing mirroring when the VLAN entry does not have the 'BRIDGE_VLAN_INFO_BRENTRY' flag set. Fixes: ddaff5047003 ("mlxsw: spectrum: remove guards against !BRIDGE_VLAN_INFO_BRENTRY") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: Vladimir Oltean --- Cc: Vladimir Oltean --- drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 5459490c7790..b73466470f75 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -269,7 +269,8 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev, if (!vid && WARN_ON(br_vlan_get_pvid(br_dev, &vid))) return NULL; - if (!vid || br_vlan_get_info(br_dev, vid, &vinfo)) + if (!vid || br_vlan_get_info(br_dev, vid, &vinfo) || + !(vinfo.flags & BRIDGE_VLAN_INFO_BRENTRY)) return NULL; edev = br_fdb_find_port(br_dev, dmac, vid); From patchwork Tue Feb 22 17:16:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755718 X-Patchwork-Delegate: kuba@kernel.org 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 30142C433EF for ; Tue, 22 Feb 2022 17:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234606AbiBVRSV (ORCPT ); Tue, 22 Feb 2022 12:18:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbiBVRSU (ORCPT ); Tue, 22 Feb 2022 12:18:20 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EDB6122206 for ; Tue, 22 Feb 2022 09:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bx5lGDgPzS0Dz5UXyJji3IG9wh5KEGgqknRm9dzkmbDDCb4Y6yZYUndWyst7MdAp+eLg9VfRu8x8+iEP61iyTS7hMU1oXxfyXaF2c/kNPXOoDDq/cKt1QfXYQPFe0KKNdp/0g1Lq19Hc/nh85RME1R8Y8Cu7YyROnFj7vEEJTjsZcbzUUQxs6JOaDjeyk3WzQElv76/G4dFfqfDFdNgHBiJxmrRjIoaYpSddq5Cxygd+du99sx8hjHteR7F2/nf9mAfM/9u+zdHdQhd2+8hYrewISt464XvrueaVqldPdSgXd2BYusFIYN3XJ10ihQO6bxsYQr4ui/GoRrnV65Cjxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iymUOxILIICnRA8qJFVdNAIkLS+PM+w5LkUVPHXS7TU=; b=hwPijVd0tvLp+JIsVehjNt1rFr+8ivtOeg3TQToeGX4Yx+qBI/doJlTk9EzvCErWgNS924XZ/v4bZsTDcPsJac/dku6SLEnSNlaWpSmlcxnkRXq6h+7clZonSi15tj8P2+uVBqAjiP89i/2tNUVnzf+a8gwDYoa95rXXfOYZGdpaWGiwvkI072k7s8BvWgByJ/ToD5NtBT04iprfz2Pzzlfr1LCI42Z+JRwiV/8Bmhp16DP1NR6YlofQn2gn1OgrPR3eW4obtsoc9p2shxA2UnFb5KaF95YPlyPd0i55QD//xmXQQalHoRcTsewi0hW0YSLaCcbg5pMtBINHTlANnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iymUOxILIICnRA8qJFVdNAIkLS+PM+w5LkUVPHXS7TU=; b=QRmOFAIvhD65i8egs5U/Hsc+/wD80SROuatDJDifVmASf6BEgjVa2u7t6IahXCHRX7imEx0ZwGYJPEG/4uwNVbvUmJvb/zRKikRKISrKCSarAGVKdQDcewSiGDIW+9oaoVTAoQZv0sPvZeiohqZB5SlQ7+1gW8opyXVlqSJpZj6qtLbJhbfS/6x6n/j36Ls6Cdpn6bou9eMjAhXU+JXvLpV5k0z/ruu9XhpUAK9sHU/BszMOqusE6YZc5Z/LEYdasOFifdRxOW41xlB7d8Ux8CWER1zDdQJWtc1OKPGUA7owpi+Gp2ektDIFtKIbw5RtRTenDlcvrqeUh94Bj7H78A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Tue, 22 Feb 2022 17:17:50 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:17:50 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 03/12] mlxsw: core_thermal: Avoid creation of virtual hwmon objects by thermal module Date: Tue, 22 Feb 2022 19:16:54 +0200 Message-Id: <20220222171703.499645-4-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR07CA0177.eurprd07.prod.outlook.com (2603:10a6:802:3e::25) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b3eaaa4-27d5-431e-3a56-08d9f62740f0 X-MS-TrafficTypeDiagnostic: DM4PR12MB5214:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DcdiduHmEVjqySjAnkHNevZglipEyOhGqQO3f0XbXTn/xoaRZixWpiCj7HIuePnc9VgTDTPZTUvHTl+V7841pRgJRR4L48V9yt/t2a08xDJDbHbRuRgWJoIvRh1xgSVllX5pnef48G5Djqsg01+uaeuGpf8ZTm0WJ3KhHRSsSHvZRCcYyPKXujRqCPEnCbQE/v8PGxfuIPvllQQuuILNBBhot3Fljea2e5fCvd8DI+a8k2tnTv/cP4Lz6eb76p5hhqUWqWYaeKKzLdUDTHFlk58zjM3WKJ277MpAa4BQXfO349CMU+OGNHsoW4OBCYqRAh3kf8Vzae4HFEK1A//qpOV8luf1L1Q13GuGr318A07jNfsohBp7Kg1F3hJ8tCFlpdTGD2UNcEolLnNTU5EWaO2RIoVT0Cpq5kSHNkRfEre6zduRc9RMuQkZFC1DCAzWacU8OYbIXNeTQuDcZKL4IOF6y2vlyE3AtRfF7IoAkJdeMwm1QF7CqF+kcarJbN3lacie2HFBxoegzQOQlN7gQzCDhfNVB63LSCzuWLYtSp3KeYF6pAB6z5z5N/2m7lcFS2Z/6qVoNCFgs6yvKjvAeKBIFZmCHes7xWuX4rHsAmBnELop4M2wG0aiV/h58BQFNsT8t/FwGZiSD5XSg6wKdw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(6916009)(316002)(66556008)(107886003)(2906002)(2616005)(5660300002)(1076003)(8676002)(66476007)(6506007)(36756003)(6512007)(6486002)(508600001)(38100700002)(8936002)(66946007)(86362001)(26005)(4326008)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3eVz6I2s3V0jST/3kswDotWigky726MyxmGHAyqIPqxmfxFC/rXIeVC5KPmpi9us9B2dPJ6H0Rw4/BvAeJPIop6CTfTo7+wb3DN041xfpLpaOq6PTjdgyQRDSmJ1FBpDtk/j+UeACXHbUtSmFnF669+5akU7pKSxiAqvX5tQGPnzrp/XeWIJNahxWJdAllBH/xOTNU0iz8uDdC1CiZ96ms3VsWnTKEQVaiIq5jK4QcUG4YrADoWm+PH/rqT+6ltxvmAF5A+jMCMDMw1OGs6YjeI8ZDTKNTJwfh9EKuUiBiFdcVkLRrPpQZ1e0zdinDyoOWpwLx0RUK1keCWCPNwXO5HkxQOHx9vMxdjC06Sr7MXcehlqRoWDQaoMRMlBFIvuwAj3vAjZ0z2nf6zm8/MVwHN6/3Q/yqsGhyffj5HfirtsMupCxuJ6sVkGbpLMK8aPmEextWJJK7UzfybATGuQmx22wZUMDbvXm05LGaBWE2F2XVIrTlci2QfY2yJzMIeAfHeMKPYGq+7lh2J7/IZ/Mz2rdJU1PXdbt8AAhK3F8ZafMf7jh5zQJuB5NQq0xGfOMztcKBuVIFIsEeg6h+8Kzvmg/VO45PUSDCDFSWoUNQqNjNKUef3QFLf2dLdPa3qDJ681S302GgWPQUh3YJvJkRPwPinIPH/z5wuRnhVa82P8y4fuPokXbaSTdhvLWoO+1gzuAPMG8RFYXW4QMI/HkRn0jcGn9nGhKWCBehs8D7GwB+sjrk8jMeWohaW74nIERiXZy0eAwU5Am81TfuAHKhftCuV0RSQ+lDgwAzTl08sljKWVVqL3cCqM89LU13O4jfEAoJZ1ydKLLfDMJYxAcrjcIQJWsp2Cifi12IyknYblofqCpSealBgSNd5N5gGCEzP3C9ZVPHU/4+58H9ZaqwyTIHhTVgxTFRttrNPkG6zWBGBr2D/0hY8WT2Mb5/quVhzzsxuy5f45pZ2zrdzl57NjurdJlvICT4CFlcVdKsVO0gFK+/1paQK8nxS+3z+p+0fvbtgRvOBHLxKh9t+/FiFbH9uqt7yj35LKPqE38VJ+tyJ1vfCTD+3+3vE5dHRam4wwsaart3Cwh68SICDhGoLDwp2Td2w8R7c/vMuv6BjUx1zNf9kYDsq+xzRKuw4IbditVuhTLijMVGF6XGxymm43ltmxRZy6EL7TNIYvivifgUx2/tbCZJhl9GBjSE/SNozfneozk1VCiAWGeYHDGGGWnRnKzlg5mQkj4noqpJ6ovrnwlgqjE9TN49Aly8FD3+7rGgBwEgTW0AvLiD/mJb9hsefHXNXg8h81pz5RIV2yPW9vhUgjZsvrcEmVGKB3eV3UNVj3Ie9bZDue+laD+zEkYe2BA3fAd4l3lf0VQeJQ0F3pCt++CJhl2wHmknvF3Aa21S1wpu5WSs6ByXcU2yqE2sJpNoHUnvoUHVIXDiLFRmsbaiGd30dH2Sw8hWvkSXHkLTlbsa8wKWSDg4oUcH6eoPPAoM33M7uFKLdJqWSEyalN4D2xyDPpU9kCX7JUU6SbP7Fiz4TJOASLvPyafnKG2aGRsCercMO8BbhmS1tHwu/XMF9heSYPNIEaig8G8FQ4W665ohYfYd4pg0f2+AIycWL+Zh9/DXIuu07sE+0= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b3eaaa4-27d5-431e-3a56-08d9f62740f0 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:17:50.5778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /Jrq3GXbyvYmZHmtXeHghUrqwXvjQAyRQ1kv9lV7P7Z39aUhWdh1sllIEL7tp3IodWB+h8TICoPRl+SR0T/qtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak The driver registers with both the hwmon and thermal subsystems. Therefore, there is no need for the thermal subsystem to automatically create hwmon entries upon registration of a thermal zone, as this results in duplicate information. Avoid creation of virtual hwmon objects by thermal subsystem by registering a thermal zone with 'no_hwmon' set to 'true'. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index b29824448aa8..e20ac2bf3985 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -357,6 +357,10 @@ static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev, return 0; } +static struct thermal_zone_params mlxsw_thermal_params = { + .no_hwmon = true, +}; + static struct thermal_zone_device_ops mlxsw_thermal_ops = { .bind = mlxsw_thermal_bind, .unbind = mlxsw_thermal_unbind, @@ -678,7 +682,8 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) MLXSW_THERMAL_TRIP_MASK, module_tz, &mlxsw_thermal_module_ops, - NULL, 0, + &mlxsw_thermal_params, + 0, module_tz->parent->polling_delay); if (IS_ERR(module_tz->tzdev)) { err = PTR_ERR(module_tz->tzdev); @@ -808,7 +813,7 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) MLXSW_THERMAL_TRIP_MASK, gearbox_tz, &mlxsw_thermal_gearbox_ops, - NULL, 0, + &mlxsw_thermal_params, 0, gearbox_tz->parent->polling_delay); if (IS_ERR(gearbox_tz->tzdev)) return PTR_ERR(gearbox_tz->tzdev); @@ -968,7 +973,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, MLXSW_THERMAL_TRIP_MASK, thermal, &mlxsw_thermal_ops, - NULL, 0, + &mlxsw_thermal_params, 0, thermal->polling_delay); if (IS_ERR(thermal->tzdev)) { err = PTR_ERR(thermal->tzdev); From patchwork Tue Feb 22 17:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755719 X-Patchwork-Delegate: kuba@kernel.org 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 3BFBBC433F5 for ; Tue, 22 Feb 2022 17:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234605AbiBVRS3 (ORCPT ); Tue, 22 Feb 2022 12:18:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234604AbiBVRS2 (ORCPT ); Tue, 22 Feb 2022 12:18:28 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2070.outbound.protection.outlook.com [40.107.244.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55796163D68 for ; Tue, 22 Feb 2022 09:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nw16YTS2NSCT4ZyecFC8y9vU3MAwHOv9VJjhYyl9dn0/j3/esx+nER0NUvm42aCQmvUU8oz5SPTj6uSQTpybKs7SK6g6P0YWr0GKclxcpVGR7+K3LVHbkVZr5aVBpDYSgmSE8z1BNDyfLl/uwMfthGk7kR3ako5My9QNiey1Tq14YTfnVW3CZLDq5ln/vMBuN8XyeawJe+i+znMg9GXBIRZ6plslWEgAY/BtOSY7hSmPcOfYEDYD4qdn37PMnEPwtvtQI3F6MxQVfrtMCpWr5MmEKAIv0Ikere4z05eADnsLEaSvTanWgEvOhpjwF/qJCrQjaXegMNhQBlB/y9RW9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dTW4INtH4kjhLj4AvV2RGcberBnMKO8QMQ13Q6FTTYg=; b=l9qgtxyoRnIOQidBuW4MozkfPKYS2Hankh/m5ybhCPAlP9yWFbgUP3brfuIazkSGuT7jDr6Ix4iLpM41niovNCiknvYBiSK68hHJ3puOKE7hW5/B3oo2zb8fxJXhX2Lt6cyZ4Ljwoe7035Z+SjFowSJf2H8eKM7CKRCCcUfJQ36Pmbp7eiIEPQ/+K94mNN9MmT4Va+hbXPuC7y1q3XSDKPn4ySDixh0R1u0pOypT22KaGGsAh+SLBIHHXD3CZpCxFn23Wns5ozNGqsHPIyBoyZ/xeNX1yzYedsrd2hCkNOwFliC8UC/H3u5ht7u663mlv7/WgZll8mG0FGk8zAMpoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dTW4INtH4kjhLj4AvV2RGcberBnMKO8QMQ13Q6FTTYg=; b=PiJ68YzF4gatChrt/HSoiKJuQDiU4stzPqmmd3dnE9AeF2INlo0225fwqGn9e9aOlSwtkwjxzahCDcBGUyacc6cuK+MSbE3IcGp1AKk3pdu596VXsDcuXYJEx5+XAR0wFDemVcGTv8ymzBYYfG9kubgP3sIzbYjAk/OR18oyBMw5LBc5MUiY968XKZPwqbx2UCob22oKEUQj0Gh5V0jj2cfAGeHk8F7iHL90h+jYngJe9cgwA+8wjWZEK78RTiVt+aXQUwIUpWBnKMnKN1DYeHTPTPVBfBsouZpvUriROYsfdg75XRuiVss3RWv2I81W/Mmv2ZvWGKTusWhj6DaJDA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Tue, 22 Feb 2022 17:17:58 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:17:58 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 04/12] mlxsw: core_hwmon: Fix variable names for hwmon attributes Date: Tue, 22 Feb 2022 19:16:55 +0200 Message-Id: <20220222171703.499645-5-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR07CA0174.eurprd07.prod.outlook.com (2603:10a6:802:3e::22) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd9e4a24-92c4-4fdc-d550-08d9f6274534 X-MS-TrafficTypeDiagnostic: DM4PR12MB5214:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: auiMfIQgpknQLoYrcHx9szrtuBcbDMKBBe4Z7PhFRXstNq8mLCtcKQ/azvGpvdBtPnODeMJ/1n8W0YtheEoE+CQNMz7si7CuMuC/u0I0xZyVgBV12jDT53KSR1GmoYt4RdDoN1U25e4DWWWBorcNBdqifkW3a+oz9hBDlyZ0geWlCijSGclVe6kOdatZPzVbowUf0m9AIodGWr2eBWBe0xXoIU2dJ0izh+2c6Zokr2btpMP0CWUXxseOl+vQ6xqnV4LRVw9+XXZ7dgZWpPY8vIE3DmzOt8fgK9vwtJ0ojj89wYkPrLQVrWsCnR5RlPV3OZsKYgdsISNn+pZufqal+dunLDZ00Jl+/+73Z0TnZauQDwdQ+ZsaYtywfO4B/3CDnWZEn6lZMo++wov3W+OLRJwSmukhL7Gq/NOyIA+/a1sHo02FKxcXP/vjdnEuJfMDo/y/KkruPjxfyU1cmAp3FqH8PRrBvbK5K6uaI95Qh+CAgYkBnrJcW9j8TAJOmagMq84ceegmhO2CS/2+lL/Bi8x9BtbxY/spvRaGCOYpXiou3+Lueu4eP/sVskyoWhggRyw28C9kAJoh8LTLC48OGLx057trEETTsxbE8PT70WubzqH8c52MoTvq03bq0RWxRjV+JFBC5eYBxDXoDDR0Dw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(6916009)(316002)(66556008)(107886003)(2906002)(2616005)(5660300002)(1076003)(8676002)(66476007)(6506007)(36756003)(6512007)(6486002)(508600001)(38100700002)(8936002)(66946007)(86362001)(26005)(4326008)(186003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8wh/LPwIzopnAk22Bqbu1xjvp1RCjVZB7q7JfyamCXxVXdNkkd52s8doyQdts9z7ayBxy3nbsz129ubNpBeDPa3ul1ZlkmK6Rkdqod4gPZNyA5Bext9rqHNxpEtHi7sdkYA8zKAJGKU79xliPBex5rlO3XHSBKq9Pe8cDLJ15lVN7gveKZfKXFb+Fg51b58eOvSLFqLLTkWgkq6/Q6vZOH3HgpWO5sJ9VnoSnUZxPyOPsI9lMwzvnuVT5fS0HwaiN3+rZzVB99fTEwIhy/zYuPsbX1eLVOE0wVsL/EoIUwyINWNWxlTEIrfu0PLZVjKjlOVwVJGe7HiRTqxIodg872IPYxXx2G8Oc8MGvC8AkkYur8xaSNhB5eSt6DNiPWVvbpxYc3zW39ezIqr6RRGql11g2YjfFUYazm46TVzPjWSRmRmZsYYsRiPsfVeHQVPF+qLmsucsx0wrC1CTAt6kOJd2XyT2SdbAQlGT8VMLZQGGxnLclpGeqZOq4QhxEdHt6fBKFxCKsJIwo2Po7lRI+H/HLaKn4nggyzv947oWsILJTV1ncScJ8H+uIZd8n+jrnVgxXh7R08tWMbxnBzr/+6itBhjoqNI6j4q+HFQtcpqSTEnSxmn1H4QaG2ULVapDoQu3Y1M5HzLTblBuX0a4GXLsbMklQdlbYmneDvh7DX6BFOx1xwqmL2RaWRuRqQOZoacLiGao5ebt4X4TFmMOW0j6+D5wFYbRqrApOjC82X5oboD93rB3c0Ie9hcg5CqcXPWKjkdpdATzhyzttR/JEXdrAv85LZmKMGztSG7PU3BijwHMjZLcGWaV2L+HoPdVfBrc0D+KTmPXTekCUeCPe2maURpSRjp2OmpyEUvV4EHzE5VCcAXwFsxQylNfKZyWj4LRag5lbfysh/tsPJV18AD1veOginaVEHZX5/GaU/azhl9qJ84X41Mx3zHVPQ2eQpEIB2zu+Rftflicr1ynalo/+DPY3WfCcRZYw6VQkzDjDJPoUAkEZGGe7TYqHrn8wZZ3eJrob5JhC1tdeSCN21MmXNFqL2Ih1XSQ5OMNpRVUNxX/vVgK5QkVSwHR3y2mkhbSUWy7l23dBxhN/sEFbEDSvNMjncZuN02YitjfO1DKUIWxw9GakxHxQ2+dg76dXofCWmxE6HLNZ2FD+AHALoG3HPa8MPP7ZlJQ68gpEZaNxq0QSB4k5ULo8ApKwW0SXBkyWIr5a7+V4mYxwr1FTV/MNVIyeNX1tJ4D/aJO5JzYmk8CRMaQJjanxgsIb3ObzSzqZ0oEjvpW+9oyPdg06UTpBZI1EMMnpQJksG4IpnLqFsI8lG2+Icl7V8ZuS/ldM9z+fWG8owb4l8QqqqvC0VD66oQUxyEwZL4/msndnNQn0la3s7o/WyiFOtz8Xc8LF5CtAJtUZYOhW8Ru60nbXAfAKhX9IvqR7FvqsWWCYh6ZdNtjluCM9wNx7eANfCjZ9M1Wdo6UJWgKh3sKpvCQrEF1TGZMgSI+aeUsOmmGSey6GM4hmO1D/lxFYZ9wUdGnNqxMaIxQNTSMivmYSmGqtqHbHpwNjXARC9bXN6vu1ZFEZI7EZbOOn66lbwom2jW1XKC0xMioaxr3+2WR/UWpp15HgzLu0meW6Rit4JdRrcY= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd9e4a24-92c4-4fdc-d550-08d9f6274534 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:17:58.1444 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k1cCwvIVwj6DyA3T30Iy4n2FaQJSAUarJuOoTekz3xEdref/TRAV9ttTRcLitSsessOfet1HFP0XCadICjjIjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Replace all local variables 'mlwsw_hwmon_attr' by 'mlxsw_hwmon_attr'. All variable prefixes should start with 'mlxsw' according to the naming convention, so 'mlwsw' is changed to 'mlxsw'. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c index d41afdfbd085..3788d02b5244 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c @@ -57,14 +57,14 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mtmp_pl[MLXSW_REG_MTMP_LEN]; int temp, index; int err; - index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max); mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); @@ -80,14 +80,14 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mtmp_pl[MLXSW_REG_MTMP_LEN]; int temp_max, index; int err; - index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max); mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); @@ -103,9 +103,9 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; unsigned long val; int index; @@ -117,7 +117,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, if (val != 1) return -EINVAL; - index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max); mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, index); @@ -138,13 +138,13 @@ static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mfsm_pl[MLXSW_REG_MFSM_LEN]; int err; - mlxsw_reg_mfsm_pack(mfsm_pl, mlwsw_hwmon_attr->type_index); + mlxsw_reg_mfsm_pack(mfsm_pl, mlxsw_hwmon_attr->type_index); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsm), mfsm_pl); if (err) { dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n"); @@ -157,9 +157,9 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char fore_pl[MLXSW_REG_FORE_LEN]; bool fault; int err; @@ -169,7 +169,7 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev, dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n"); return err; } - mlxsw_reg_fore_unpack(fore_pl, mlwsw_hwmon_attr->type_index, &fault); + mlxsw_reg_fore_unpack(fore_pl, mlxsw_hwmon_attr->type_index, &fault); return sprintf(buf, "%u\n", fault); } @@ -178,13 +178,13 @@ static ssize_t mlxsw_hwmon_pwm_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mfsc_pl[MLXSW_REG_MFSC_LEN]; int err; - mlxsw_reg_mfsc_pack(mfsc_pl, mlwsw_hwmon_attr->type_index, 0); + mlxsw_reg_mfsc_pack(mfsc_pl, mlxsw_hwmon_attr->type_index, 0); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl); if (err) { dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query PWM\n"); @@ -198,9 +198,9 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mfsc_pl[MLXSW_REG_MFSC_LEN]; unsigned long val; int err; @@ -211,7 +211,7 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, if (val > 255) return -EINVAL; - mlxsw_reg_mfsc_pack(mfsc_pl, mlwsw_hwmon_attr->type_index, val); + mlxsw_reg_mfsc_pack(mfsc_pl, mlxsw_hwmon_attr->type_index, val); err = mlxsw_reg_write(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl); if (err) { dev_err(mlxsw_hwmon->bus_info->dev, "Failed to write PWM\n"); @@ -224,14 +224,14 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev, struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mtmp_pl[MLXSW_REG_MTMP_LEN]; u8 module; int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; mlxsw_reg_mtmp_pack(mtmp_pl, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, false); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); @@ -261,15 +261,15 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; char mtbr_pl[MLXSW_REG_MTBR_LEN] = {0}; u8 module, fault; u16 temp; int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; mlxsw_reg_mtbr_pack(mtbr_pl, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl); @@ -303,13 +303,13 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev, struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; u8 module; int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, SFP_TEMP_HIGH_WARN, p_temp); if (err) { @@ -337,13 +337,13 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev, struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; u8 module; int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, SFP_TEMP_HIGH_ALARM, p_temp); if (err) { @@ -373,11 +373,11 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); return sprintf(buf, "front panel %03u\n", - mlwsw_hwmon_attr->type_index); + mlxsw_hwmon_attr->type_index); } static ssize_t @@ -385,10 +385,10 @@ mlxsw_hwmon_gbox_temp_label_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; - int index = mlwsw_hwmon_attr->type_index - + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + int index = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->module_sensor_max + 1; return sprintf(buf, "gearbox %03u\n", index); From patchwork Tue Feb 22 17:16:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755720 X-Patchwork-Delegate: kuba@kernel.org 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 C1C9EC433EF for ; Tue, 22 Feb 2022 17:18:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234609AbiBVRSe (ORCPT ); Tue, 22 Feb 2022 12:18:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234611AbiBVRSd (ORCPT ); Tue, 22 Feb 2022 12:18:33 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2056.outbound.protection.outlook.com [40.107.220.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B51165C2B for ; Tue, 22 Feb 2022 09:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOhaGAjGEb5gRnI2tKB5BQkYolBweqchZq6t34g0yLGvm0+1jbdoUcN6qMcfvbhf0lRS78HOK33kTkaP5XG7IaqtDUW4WuKNp7kzpOotFWlJ4Uq9V03nDVjS8N9PLteRzqbnb311pv46PAWupaxFk+qO+K3orpWQoIsJdrqr4wUZ2QCDEXj4wpsfZvTisTEqsKcQuJRXdr++cOlziEVazIuTu6VO0443/hPjWn8Z+nTinTut7NMuslJDapVR+2Mn5e/6OY0+HlSfKwt7v4/YAOyPGhWVB/WZQ0n4btWIz2km1K44f0v8bwsq6rHuY9qXen8Vas8c9c6YugC9R5RkKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VuYSQaalNEb9S6dHVnTculp/Dn2udpHe5pgy+EWv5ag=; b=UhcCUJjmwSbrZOxR8us92QMGQNfNRcY2tAeKRtFXZ4FprRUuyB8kSlLv7otQgNl2IRtFoKYfnxgs280IYgWJsnA+HyUgkBpHUNBYp1/EIEta6G56HxvIx/q7tjnnPyShS9GZGTiKHNa4OyH++Ea0l9Y2mDDI1Vzsk0jqxG4KdjFDHki37bSQ4LinbncmHC0paYGnD7pMnk1qIXla+tAzuPCt1voDMgaTHlUw1dUIO2iteiQTLBkGRSfUUydPdR7Hxpv276214SrPKpeTdKctrnZ3h+Q+TdwYpgsnFIRP1liXUJYCPhfzrpV5c33uUMlUV45yMvuU4drwaLxEuOAqRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VuYSQaalNEb9S6dHVnTculp/Dn2udpHe5pgy+EWv5ag=; b=HdE3gz5p4OrYpExmmTPMsW1rOqzC0x5uw9bdJKMJIrlYfzahLVpK6Ajdpt112EdCWnG25HsAEvkOfDTru0tg1mbH/cc1w6WkSK3DGR4Wu581zhaY77OvVtDoyeTd6OF+q2ZPCWzLFpRhCCZMm6GA7psqoYzaDI4JOt2poS4HEmNazcE4rQ2erEoejckb9lhOKtZTrxx3b4GkokQFtoCtQvck+giMLZeZ3MrfpGQkgDtf8jjRRuN1JgZH3G+wxnKGKNIKrXubgf8+3ijYQvJyUIrv/j7iPfgBs7rQzoorW6Qsak9X6VgH1EzFYerG8qdg2Ku9yQAKo5V6UOAx3rpy2g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:05 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:05 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 05/12] mlxsw: core_thermal: Rename labels according to naming convention Date: Tue, 22 Feb 2022 19:16:56 +0200 Message-Id: <20220222171703.499645-6-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR04CA0085.eurprd04.prod.outlook.com (2603:10a6:803:64::20) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 002a59ee-c44f-4c36-0d6c-08d9f62749ee X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fkt0o6Q/sDvJ9U+QkJrZkuYGFEE30IwTJyYPp4ij9/W6Vj0biUrKudyKcMdp1eXN28u9unvywtTJHKPl94eEfkE8JfLiegt/c1Aj72qZQe/+FEeuHd6StlRwnSd6S03OiB7SmKbHGGXmzsw9Qzt6XC9eRZDNjMKkhwVt+TvDJ7Flls65Rmn+cG81AHACvFwjOMsYonBeZ9biWUf/I56AFI2vZe0ufJlUctNoVOrUeZnfU0Hygr3fA5Bw0xsTGJa6ESxiW/sXeS0pzTGLKl7Biszy4tj1kdhvQfhjepMw8RpMkyDs4voVnLf6ooO+fWs5wMQnJJbtiJHrvyk0sra905iYa4qZUB4m00e/+Gr8vYGyGnX7BguK5TGlswt/kCANXyoIsUWOJVEKvYo14HSqcZ0sNVgSJ1qVokESIaZiYyvnh4PjXACnLBXaAKNB9XQVyRTnMQ3hgHpjxtNaQExlkqU9UBKw9JGIXbFosMPYxMmDxa9UEUDqO7lOwQcnDnFe/QI5Jf7W9dbMYYrcryu+ydTuxKhi/YX5LYBKj302Z/rkkSgOH4WEumOc086Hyn5APe1N88xmjEPFXiw4mH/uTtHDKGLXwnARgbZ0O6rpaTZXhq0s+Dr9JQs5UWS4zh71h/BrEnhn05I6+qrCfpHjsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S5LEYPabCsG0hTr98RVaAojpytlm4i6QTNAMRubiASUT+kba8FWRKpGOCIRlxgyKMMqY1efpdymGuj5q9TpR3A+MPmq+sTbZ5i1wrSNcmfRQvAGMfRwRRkh9ngiVzE5BKNhXa0b14JQvJc4UIFuM4O601B1Ehj9vblHcYR6lbl7D6kItsJUFG0wq34a9qDjgm1Udcbg46UGx/Cgt2p3x9kzqkmCKhnPheKe8cMPvtLihHXAtMild2dXwRR8QIS38MJK40qqcHV0kHl4jCqDZR8bG9wYPQWkl+SR0KQeB3zhsEtBZnfFAuqEinU515aH1B/Z7bWZ0y1u39LDVVsNLeTFP4GUmFooLkhDWxjPVxuJtor3zZlLfDlW4Tk5DfssE/Y0FepFeaYn5fX7TDAtUMhDXAXFKAmyc8fg6UnLIQxdPoUFS8rTd3L3W6Ny9sYVaElEA/mQsJDSHTDxWb719ha6VvqnCzbogrkzIjRu3YymszbUEgI4a0pdsUgQxkxLvJZjH1MkGYz7rHVhM7+VshRNMTf5vf4JST7SWTyRw34U7+JU1a5wx1/Y4+a5lchjGgRQGM6s0t5Ud8+o3HGtLCppk4sRuBK7CXF/c2++pWbt1rcf+294tRRecsrHfoBKBNyPLA5AvmaTT8vYRrkOzBkUGI4r5qkq/mFRgg6PozSP9m7YeQG0zIKKZXmQ+DB0YygLRdgfV75bwROlofdDo52ld+RND8wTxVEDFKpLsEeexJsmW36zJnBwcC9dfWMeIheYSuwfnqch6blJY5tvMGhkF2NljJqkc4eNsi4OuukM27RXZlvnzM0rV18yt7LP9xwTvpv76Hi2MDbfeZSrHSISJS6YN1MTObPEfzksWyORAOBr8mcTbXywMsMgOQ7HZ+KiLjaO9owfAEuULlH8bP36mv56Xi6YSRJpqSqPrzAZ0a2ajZpACDE+n2q0dq0K/Ag0bOX//vT2eEBdE/2HOtbalGqhCamX/esO2vcaiv4A0SBt9SOK+Bk7+z5KsxrSNxgITJ+tNir5NGOgeeJREVVY58sMsAQQapBGPjH+XdlGiMaUz8P11NSIXcbREcBcPmapb5QulATWo8HFr3shS8WSnD+TrQfbubSw96I0WkuVYGW4hyYbms6cx+2Lv0DYLZJTv+W4QZ4eGA6FpVirXFsXxZXeBTybQYv/9lLpJ1OI7zs8MSSdkNCOJkXoY6sT9d3TBbU83A2A2r3J2f8m5ywytM8cytSzYfjaRxir2N2Fq/ztULKPb7EqkdeUdf2i/6uxaBAgrlg3pn8Mri8YYLxd4Eu2m76r9ZdPd2KJgOdlrVwMHzSPxwIT1PwqU9vV6B9VIl7VDeKs6kVhEKzFkYzo1+T+ZGeyxF/9DAkGQuIUB1hWlpmgMdKGDdf0xn3M+s4qKQzlWLaZOeUHHbpTvmg8X4ofwzELe5DgtgdegKXqu48vlCEJsY2IrZhmO5IuWfVX7d7zXnrKBBeQIXVzN1EPMsahUxMwZF8Je9kcMVzIgnAcphtEOzwUcQOsNZw/NThPbTzVyL8wiaIlEGryY60z0qEHG6pDNJJ5MHUYXdwOV3MKLYkE8Ulh16Bg31ZmA76i+rivQdnS35Q/YdcvFFFRteRAZC55yGOEqFTd476M= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 002a59ee-c44f-4c36-0d6c-08d9f62749ee X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:05.6318 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7qTkfqoV4xXa3yiuSVwfpEgiGfPj55RSHwnrEcptflj07JU9Gvc6SbQYCFOwHApmswnkU8pwd4KjO/PbOSVx8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Rename labels for error flow handling in order to align with naming convention used in rest of 'mlxsw' code. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/core_thermal.c | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index e20ac2bf3985..784f9c7650d1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -392,11 +392,11 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev, trip->min_state, THERMAL_WEIGHT_DEFAULT); if (err < 0) - goto err_bind_cooling_device; + goto err_thermal_zone_bind_cooling_device; } return 0; -err_bind_cooling_device: +err_thermal_zone_bind_cooling_device: for (j = i - 1; j >= 0; j--) thermal_zone_unbind_cooling_device(tzdev, j, cdev); return err; @@ -766,7 +766,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, for (i = 0; i < thermal->tz_module_num; i++) { err = mlxsw_thermal_module_init(dev, core, thermal, i); if (err) - goto err_unreg_tz_module_arr; + goto err_thermal_module_init; } for (i = 0; i < thermal->tz_module_num; i++) { @@ -775,12 +775,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, continue; err = mlxsw_thermal_module_tz_init(module_tz); if (err) - goto err_unreg_tz_module_arr; + goto err_thermal_module_tz_init; } return 0; -err_unreg_tz_module_arr: +err_thermal_module_tz_init: +err_thermal_module_init: for (i = thermal->tz_module_num - 1; i >= 0; i--) mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); kfree(thermal->tz_module_arr); @@ -871,12 +872,12 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, gearbox_tz->parent = thermal; err = mlxsw_thermal_gearbox_tz_init(gearbox_tz); if (err) - goto err_unreg_tz_gearbox; + goto err_thermal_gearbox_tz_init; } return 0; -err_unreg_tz_gearbox: +err_thermal_gearbox_tz_init: for (i--; i >= 0; i--) mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); kfree(thermal->tz_gearbox_arr); @@ -920,7 +921,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfcr), mfcr_pl); if (err) { dev_err(dev, "Failed to probe PWMs\n"); - goto err_free_thermal; + goto err_reg_query; } mlxsw_reg_mfcr_unpack(mfcr_pl, &freq, &tacho_active, &pwm_active); @@ -934,14 +935,14 @@ int mlxsw_thermal_init(struct mlxsw_core *core, err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsl), mfsl_pl); if (err) - goto err_free_thermal; + goto err_reg_query; /* set the minimal RPMs to 0 */ mlxsw_reg_mfsl_tach_min_set(mfsl_pl, 0); err = mlxsw_reg_write(thermal->core, MLXSW_REG(mfsl), mfsl_pl); if (err) - goto err_free_thermal; + goto err_reg_write; } } for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) { @@ -954,7 +955,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, if (IS_ERR(cdev)) { err = PTR_ERR(cdev); dev_err(dev, "Failed to register cooling device\n"); - goto err_unreg_cdevs; + goto err_thermal_cooling_device_register; } thermal->cdevs[i] = cdev; } @@ -978,38 +979,40 @@ int mlxsw_thermal_init(struct mlxsw_core *core, if (IS_ERR(thermal->tzdev)) { err = PTR_ERR(thermal->tzdev); dev_err(dev, "Failed to register thermal zone\n"); - goto err_unreg_cdevs; + goto err_thermal_zone_device_register; } err = mlxsw_thermal_modules_init(dev, core, thermal); if (err) - goto err_unreg_tzdev; + goto err_thermal_modules_init; err = mlxsw_thermal_gearboxes_init(dev, core, thermal); if (err) - goto err_unreg_modules_tzdev; + goto err_thermal_gearboxes_init; err = thermal_zone_device_enable(thermal->tzdev); if (err) - goto err_unreg_gearboxes; + goto err_thermal_zone_device_enable; *p_thermal = thermal; return 0; -err_unreg_gearboxes: +err_thermal_zone_device_enable: mlxsw_thermal_gearboxes_fini(thermal); -err_unreg_modules_tzdev: +err_thermal_gearboxes_init: mlxsw_thermal_modules_fini(thermal); -err_unreg_tzdev: +err_thermal_modules_init: if (thermal->tzdev) { thermal_zone_device_unregister(thermal->tzdev); thermal->tzdev = NULL; } -err_unreg_cdevs: +err_thermal_zone_device_register: +err_thermal_cooling_device_register: for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) if (thermal->cdevs[i]) thermal_cooling_device_unregister(thermal->cdevs[i]); -err_free_thermal: +err_reg_write: +err_reg_query: devm_kfree(dev, thermal); return err; } From patchwork Tue Feb 22 17:16:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755721 X-Patchwork-Delegate: kuba@kernel.org 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 11EE7C433EF for ; Tue, 22 Feb 2022 17:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234610AbiBVRSk (ORCPT ); Tue, 22 Feb 2022 12:18:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234604AbiBVRSj (ORCPT ); Tue, 22 Feb 2022 12:18:39 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2088.outbound.protection.outlook.com [40.107.220.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F2F162024 for ; Tue, 22 Feb 2022 09:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N7SSgU/WgFwYvvXxmdiDNnGNlF0Ou4x/bhm/l/skNfRv8vW7HVyUwuGihQNPPiMQl+Ml8sou2Zo2FomkBHTiKWdmPr+O0tOYJ7c5gTp9QFOLPwqPKJqTYNVL9cSjIo3H6nRvj187Z1f3Yu6clRPN74zOFA5UKVatZN63W/F1+Z7tzbbIzDUjGGcWJxjuCz6DhYP0OtCFFs0VHif5J54BQxeLDz5Y4K1ZVNnjlao1zaPEfSWKcA513hbP0tcaCQmwHPDWq/0WEAw/O7eHkKbn0nTqZ3/BSguuoz9evcM+Lj2V5W9MSPwzwSYZnJ51307u6wKewBd4AL6dBWvZesUtVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=upIIBueZOMSFugXauE9kqZUDdevU6dmo+/5mQ6/Tcjs=; b=JX2qqShHsIxJCPvUOoo14lLmsaa89ahzSpNGVrXypVC/JwThm8/kAAi86Rzoba9p/lJuFsqzNAqCJd5DQUMQtfoyS3BbQ/xfFhQ0lNozSAW5+RNtLEEQL2l4n3dNPiNKDDfK7GtTA2/xwg0jItSTPuwSlO604eMa+r74zLFSgaHiV52+HKX2VrAp3JNcjx+UtsCStPsmqNk9IW6SEEdpPapdfREIj1Ae+fGXDjYeB+qdcmGr4H4JAO2u/0kyKhcO6cMYyp3F7EpLGZXBwTTxueVgM8q8f35/LKl0XcbK3p9vfrlOjK/Eu/mjOyfcwvahMc/fwO7dQkgloG5CohT48A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=upIIBueZOMSFugXauE9kqZUDdevU6dmo+/5mQ6/Tcjs=; b=dE/CL7MEqJrktljeOevbIID0Tjsj4yUYvJfkOQcbspNQgOr26hxoX1k2xBDV1wTQN3sx/d70Dp0BAs0rLimCmomQuZ5LHRUFJOjfbvwtqvJMCmdNfUTSpHwh5b7u3uIjHHZP5iELTzGi/uiUKHPKOofsm49vWFJ5+vUVViZmeA3A4xGttIZV0umMUtPCmPpkbuqWZW00P1O3RbRb3hoxlNxMjt8N3whf5aDU1IIHeEDehlzu4QLGkcQhMGZE0JsIc+mh0VY+uAIIKyiOqrpYTQfyIzbFbAC9uBkpTa2DGGKQEJSNXS75I03XWXhEH02accwVNW5FRRwCBDRTF7FjEQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:12 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:12 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 06/12] mlxsw: core_thermal: Remove obsolete API for query resource Date: Tue, 22 Feb 2022 19:16:57 +0200 Message-Id: <20220222171703.499645-7-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR07CA0294.eurprd07.prod.outlook.com (2603:10a6:800:130::22) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9eb8dad4-0e6e-4f85-6bbf-08d9f6274e18 X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /SONjovzXgbWBEKJqQt4UmkznOUWaAzCDFK/A1JEwmICp8pf6HsFWujG+XlyCzAGS6vmp3wWJ+yESN05rxIYkIIGam7x5PrNDshVi3NQ7EI78v27HR8hqxSuuFKbjBfoaBSfHmRLRGC1Y+rVSZjEctaAYDUlCWZ7FM69GTLfIPaUrkVV+fEf+ql3POngdlkOmk5v6kbG49SXxqiXf/9dGOhbh+tLRHFL+iS9nvVbk3ZD+Bz/6H2+tqu/67B1QWeGcoXU0ik0SYFFDGSDWqvBNshDbMCBCyP4H/1KPTH9885rPK/f813JwcXurfchiljHULWF0g/DhupcYONwNamaiR9rrznZ6MB09aLAoRm121N8mUXPpZy7R+YQoFEymA+KzEE+Kl084nXYArCJ+9MKXz4t5S3wbaSJo7qRNcP/doLmkPGqrTQdCyEkqJQq3kl7hJGw9gcHfBnooTOAaJRGyyOxmLp1kRVuv6Dmh36WR6Dm90iTHq9T18ujjV+Fi8tkLOefyIrxQDR3442yc+ud/2MVIzkzjPIBL7BzmwZHjnNyenOU3B0U5l6sLjpO2LKmEVghuz6nGCbFhz6bOp+Q5PEirdiRn8v9e0HgMD57MYgeDEN/0f0/wpDN1B3NDML4dVFdV6+3qcQnurCvCfCMEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /vB70PuW3qLD34qtvlsJVT49/3evNlySuQl6Abtf/yYGtP4rSh4wmfxPhZ4VvMIcsCV/mLSDzfBEbIUTjt1icbHqbUfXhSE+mRdhC9ou+GbO4NDnYYqhuktQzjipGYWdMrk32ViZOrIqEW7oJenu2X4v1tZ9zylkQUVPWE2rg1lQ5o4eryZhBc8+++suebGUpW37VO/u4O7iDaGwyYo3rkl3YrhQ9WN5tNcuMD96G5rAVpoMxBfTEFoiDJi6e20gizmNK5zSqzeWcKK+L9CtfVmPQO+4nSPNQTUQAQSpR3JSuUppLL1zBhpow09HWocMfnQVMpYEhd0vbU2Scer3AeLdogFXgAhWoTCsBqraDQwd1fM5wCnFZ/SsG/3Do/5xVq7RmN5ZTc4Jd4zPqcC63R+gDM+/OEtyURcktqSek8s54t3Dr2FKVgLIuap9c/3X2BNZBTkyW795l2x48jAH1MUo1Muq9cGBjTx/clatN33+qHSqIcHoT3SIXI51l1F5Cnc3luo4MqU+cGAWgiO1zUowEA/58W/bKJ65h9pIhAqTfCKAw40xcmKGgJDBP5SpPWrhiG1M3AxWOXkFolnzSqaCGxLT1DSv7QnkmuGvlXMDqMbH+LlCP3MBYPOftRmppp+hUXQlxozZDwwFijovqlShjPOwP7sJcJBkrjqZkYpx0HsptMc1ULR6rQCBV8txKcVkUz6dd018yHH6TOCSegH7iMDdpeFLl+1CwaONdlVA+ndxwUgPoap/GNup09hPrnRFXgW6tWXRIBjWsJi1YKpW5hxLK6jT1fYWlbwI1k07b8JDF+oLe8i1j40pfeFo4PalpBzivqsa4R0FXBQId8QKpx7JSf9fErXJtlG6v6eveqBaug09u9LhsOT9PTMKZuR9mB/CBtcPyFsukPdroq1s1X+1iVfD9icfe8IfHmG9ZRjVUb8lLxkiW92plgMfC965ODBc9uxHUmTxG+HpmDSpNFyQ1/n8kyK7C2wxyGCtZMFNwHOcbnY9SGZRVI4UoE4Fd3J03IHExyqqaOSCUwVnfdwwrgVq/w4cvGVXELIAkwFUKVRvGAfryFzU8QJXOX8lu++0sL2Dx2s/S9ylx2oO4boGXZxd1cWI6DLdHrQ0Y6uo5g6hXp7NUvso+cXAfUnbJxOhFbZ9IIWSFNgNjhepRJaacypRVJZ53yjV8oXjl8OSnpDQqfZEsVP8p+1UqUwNY3KzQnbYBrbmzr5RlWDFEIzmT3S6XZm6sCymjQSk2N2apaPgvQlw4sTL2+1fAmUbGp9DG9/bfG8IM/meDyauy8IWU/k0JgKOQn6JOl8FDCtL6q1whaDRAOYWN9JkVjjzAyvOx8k/ZxjnR6NhqgEuD9MDt4RWIa10HnCkQz1ulP1g6g70lpupPkEaqO0JLs9Ur4l8sBjLyU3whjh9RVenV4aSU58hcWFcmowimVnh81p/VnMgR5hvuyGkiHtsJGhIVljq/3TTbbH/oleNQsN//GADp2RTY4fMbBpXJO07S2skNTXmRMVPpXug3dMmBtwXdb0iicRpISdcoYamJxmNaxWu83z7UD5oGqD+Al7JAvbhQoSZiyQeH7upzbdzeTW/KWDhwjSp3JWBOmjXIKQ0VO0sjoPWKw7s19gdWxE= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9eb8dad4-0e6e-4f85-6bbf-08d9f6274e18 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:12.6672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8uDO6HoQsp3Oe0zTM5C/tY2sO3IAm1Js9y26pQAQRLjrl4Oo79j3vay/g3SzOB1TR+MsMGNFahQiFw5alwgVFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Remove obsolete API mlxsw_core_res_query_enabled(), which is only relevant for end-of-life SwitchX-2 ASICs. Support for these ASICs was removed in commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC support"). Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core.c | 6 ------ drivers/net/ethernet/mellanox/mlxsw/core.h | 2 -- drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 3 --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 12 ------------ 4 files changed, 23 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 1c6c1ea107a1..aefd3eeb3c9f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -177,12 +177,6 @@ void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core) } EXPORT_SYMBOL(mlxsw_core_driver_priv); -bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core) -{ - return mlxsw_core->driver->res_query_enabled; -} -EXPORT_SYMBOL(mlxsw_core_res_query_enabled); - bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core) { return mlxsw_core->driver->temp_warn_enabled; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h index 6d304092f4e7..e973c056f0b4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core.h @@ -35,8 +35,6 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); -bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core); - bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core); bool diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c index 3788d02b5244..8b170ad92302 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c @@ -655,9 +655,6 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) u8 module_sensor_max; int i, err; - if (!mlxsw_core_res_query_enabled(mlxsw_hwmon->core)) - return 0; - mlxsw_reg_mgpir_pack(mgpir_pl); err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); if (err) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 784f9c7650d1..05f54bd982c0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -746,9 +746,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, char mgpir_pl[MLXSW_REG_MGPIR_LEN]; int i, err; - if (!mlxsw_core_res_query_enabled(core)) - return 0; - mlxsw_reg_mgpir_pack(mgpir_pl); err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); if (err) @@ -793,9 +790,6 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal) { int i; - if (!mlxsw_core_res_query_enabled(thermal->core)) - return; - for (i = thermal->tz_module_num - 1; i >= 0; i--) mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); kfree(thermal->tz_module_arr); @@ -843,9 +837,6 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, int i; int err; - if (!mlxsw_core_res_query_enabled(core)) - return 0; - mlxsw_reg_mgpir_pack(mgpir_pl); err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); if (err) @@ -889,9 +880,6 @@ mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal) { int i; - if (!mlxsw_core_res_query_enabled(thermal->core)) - return; - for (i = thermal->tz_gearbox_num - 1; i >= 0; i--) mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); kfree(thermal->tz_gearbox_arr); From patchwork Tue Feb 22 17:16:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755722 X-Patchwork-Delegate: kuba@kernel.org 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 1528EC433F5 for ; Tue, 22 Feb 2022 17:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232817AbiBVRSt (ORCPT ); Tue, 22 Feb 2022 12:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234604AbiBVRSr (ORCPT ); Tue, 22 Feb 2022 12:18:47 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD8216C4F2 for ; Tue, 22 Feb 2022 09:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VzKg/To/ZttR7JCMnhic22QDegUAUisT8YdYNiBkrfRqQoGOZCfbiaOs01ImgK/PWgmUOj/Od3raqRxbWRAXwdmPkgcb1QUKb+lbLIl/giebyOg0+8EtuvIZEwyMYxj6iqNl8l/WWwTscvpXQLdU1x1E8zhD9x0l462ObmYOpJekRsUP5LBeABN2VgRFyw+NiA4FPcGSgGyqkfKEoe1ywVC/U8QXCRMSinFRtoPvCa+2RN3A82tSiIam5BijbkMiVT2y5OQqYc9a6+GBsAaNzTXuPKLwLyKPYEAPYnrnetj3ZUyW1ue5zhKDD1AD0DdFnSMCR8GWIHiFkneIugkmEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OYuFWvylO0zSMxKVA6/ITCk7aLuET5HdHEi/MphajG0=; b=YwDwZSIDaoeRayjCtGWlsMqC12WuldVgtdT+v1AJfPzbsJrh2ABPhk0UVn1ZsTBe32smXT8RNpXL6DaPXqnw3WK296pfnRzgTCU35LCWm7H3h348It9K4lqKUStKvA9aq5qQiN7DnZy+StNBWuuzeKC5WRuxacvk8UF2daSRGoHddWXdvjv+3gatvZCeD3gmfXrak4lCfDlSmO/t+gMyfMJhRbSeZO94SnA/jdS2gM9T0BaJhZ7nkM2ifx5I4b17FjF5OoKD3DceNpQTuE6JY+pnc3wISmmNdOC1RDkgONRSgq2AM90udFnZMaJa8EQvfbWph2WiN5yIB8gJlsIm3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYuFWvylO0zSMxKVA6/ITCk7aLuET5HdHEi/MphajG0=; b=lzSGBJye5aBOFu2lKGKnevbHAJ7CTmKZDth1jlSHZUy7Me10OtyI4fwwwTueNTMjp/H53fM4YF+30TBSpUMuqjJ0T64O/asbp24puaRrCuXZGNUvtL+hM69OZYHdUYxEP4SN73YGkqj2302vsG58Uu8SMME/3Mzq5LInNgWkkVXmDZf/wl3r2lgztylxRB/aoVCNA/ymLkd7SM2dT9iGFuzsG8a2Fd2zyuAlosi69Cjk3mhm2mF3raVjLIR6YtCp+URnz4jWTnOo8+M4WOfTykWG1ig0qeiy80OezvTxp4xWAIywr8M4L6vbTofPpmT/Aof49BEagZwYfkFDYBbgJA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:18 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:18 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 07/12] mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments Date: Tue, 22 Feb 2022 19:16:58 +0200 Message-Id: <20220222171703.499645-8-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR02CA0074.eurprd02.prod.outlook.com (2603:10a6:802:14::45) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a905b50f-4bb6-435e-79c8-08d9f62751d0 X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0KmhzdPRaRWeKcBOWfM1F1ZwBdU8cwzUSPCdbMtFdqVr9Wka/kKza16xhvWieFajbrfy1Bxv41LAaVsxOONvrOhzTlcq5WVYvYmSdKx5LWzwVgLekZURrQCrBRm90pdUjfC7NobznGM79oG7UjtWcioJoa3g1MNhEYeCb37nP+6MMzNSzjWNZZ6XlCfjgRmNycvQZSR350DFA+uiZ4WVOxqsFPh5eyS0eAidaaKbT+zqrxJPtx8ge/ZFDPbcdaLBammKQIjHa+UwvLc1lH2e9Yw7jRljD88BlFXM9Y5p+hWXPyQsnb3wD5dNZJZdGqAYcOwjJ0TqCcgJAUWQ/FCa5EwGUXGSf2A7f1bEwhFuMp+72ov6SRVScwicRa1nCD8NDNSsAVX2SNj3gGeTZy3LtjKFQHHh7t3/0DqR5As1c35GUB3Op2LEgY45yOpe/JFc7VwpZJvHT/rpl5dMrEvdkvUawiZX0hdVKZWknGObKZywHA6jnq4oMF1ZAB1VYGugYH3QCvwDmjr6NnpvnPv1WJdVXe1szuKvDSRMP2UcnF9q6xD5gqAOAhGtWBdEwfapWnQFlC19bCOFYgWnOGsxdLsSnBQ3Yr/Gedl0bFJsPTo6s+4FyzgZZ4qcGFS6kjrzg3E7iPkYLGI5O/RHU3GOQA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: X8lUxUhE3xfCfRzxyw9vw5mGwEnAMVXPGUhFQpTBDS7rGEdqxMboo770Eaf9GuQiTtzVTlZzxycg4yThRECWND0TchlK3oJIp7MnGj6a3GSDCt0ToSAM711wAjL3v12mkhHgbdz5WRTdk+7goqysIWvpWPETqPjySJdJrP7sBbhXpUZeVyVwrKE7x8n9rDnLqMC+Ex0g7MjJOe3hpYWGhiw2xlyOhNHUZkEj5t+T/Nlv4gNdxR1h4bnifLwi6R/yysEvrAOzTGW4J8mviF8RWcDsQGVHh+J91YEzm+0nFq0xcAgCKHyUxUu26BiYO2t7DYYTlMPwpP+kvCIUPodujFhX95B3xmbu6drazECSBQnjgrQwk4V5APGhRfz34hQGx7naFBbf+U+J2A27i848GdRSZ5iApaHXzsjnr2fW/Ksguz5K8F9NmL7F3Tos23HabWAyMnskelXCS4w6p/wp0A35oRenRGjjl4SOD1UAWnm1Vrkg0Whl3KvMPxJTT7K9rCOF/ov4uex5jZv4ej3hz6Aj0vJ9+ANAaWvzpBiqy6fs5KPVfwRLlIgWVR+Hwg6s97NpGkBiALcaPMWJ7N+9X1Njt1qXTZW66bTINa2uQ0s+P0jfNbnkCVBwB2jzLGzcmWXu7QbHN5FVggmFF+bcDvVW0YJhIK/CX5oE7De3Mh4N5QN8fOExkPJV8HEV4EwLaY9H2EZv82ofTtBOzJZEW4g7z9Undy9wPsbykelAFYsm/APJe7zGlE7i3PT2Aish34lIn0EU2Y4MOWLJoSFA4tD7d5sMNV+8ksPFjQzlTdQ+cgQrbBiC7wP4v3NovBiRNHxhKZi7WhMZ5LeqNwhjYxrkM8FVetBOcZg6h6FoVLYIxRXElaCKouHdBpLC5GIsVwEn7Rs4+WNbmvysLFzKC3+WEXAoxFdG/QipzXMuCiruEC0rwC+qvdh3iPrvtFUTYGwAyyfhM8x5CG3so9yc8ewYGh6TE9e2kwjax+PQcsY8QodoFqSmZWRsvDBXCm9rYUlkLI4XiE/XRGAcyXx6Sz347dk6yAkaptdMjgtSBwkMIox7duSxwPqzBYLRL4PnclApumR6jkjw/wB7ChRQTGmIbUqOTv3iDv4llOqfBoqeYFDVBYGwP42WH4GRlGKeG4oYBy8t202oJ+EtZ2DqwYKVCWyXDhmk8oy2b0XDph43gIaCuwQij23GuoaBhP2nI0tlE41CbOT+qPc2kh7mRy0ZtSUkN/ZPskdBwP+1Lj1VnObyc8MlTB3qPjS7BpB7kNN3f2Wv28xdw9NgvQ0GQ5yPGRm5eQ5SXCqqT08Ed4//+XByVxwml84H0EMvJrA0EMJ6oEPfYCLQM4U6e2+Xe4DZkU+WwXx/sj8NOcGRG4DUCJuwcoRBht/MFY6c7K6n/0olSiG1aoAbm6nAYrO7q/qNYAWRr7i83pQYhQuE0ZCbA+Al/SUKtUjA2rLmD5ALBhDLu3EYrjzoLEHsiBoMMov8vMBRrHWVV9DnwLRfkzdJoUlMyLgL2Fq+TyXuXmXDVDWNtXyVFFNkDwLr9hIfFob5Ikuou4zRDIiQUniCg7s8TYhC6frH2NJjXGANEsfEofMdBRm1Oe3j+BAGUQD1l2Ft9fVZq7EAdvjTsAb15S8= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a905b50f-4bb6-435e-79c8-08d9f62751d0 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:18.7660 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jf8v2cdDy7eynWTLePDb1X0LzrUAmEXhuVgW5dTqSqrz/yyZ4J+yzfqb5beTI1PJ9hzI/iIkCk2mqtzBH05mZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Do the same as for other registers and have "mgpir_" prefix for the MGPIR fields. Signed-off-by: Jiri Pirko Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index eebd0479b2bc..1f0ddb8458a0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -11323,24 +11323,24 @@ enum mlxsw_reg_mgpir_device_type { MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE, }; -/* device_type +/* mgpir_device_type * Access: RO */ MLXSW_ITEM32(reg, mgpir, device_type, 0x00, 24, 4); -/* devices_per_flash +/* mgpir_devices_per_flash * Number of devices of device_type per flash (can be shared by few devices). * Access: RO */ MLXSW_ITEM32(reg, mgpir, devices_per_flash, 0x00, 16, 8); -/* num_of_devices +/* mgpir_num_of_devices * Number of devices of device_type. * Access: RO */ MLXSW_ITEM32(reg, mgpir, num_of_devices, 0x00, 0, 8); -/* num_of_modules +/* mgpir_num_of_modules * Number of modules. * Access: RO */ From patchwork Tue Feb 22 17:16:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755723 X-Patchwork-Delegate: kuba@kernel.org 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 2C386C433F5 for ; Tue, 22 Feb 2022 17:18:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234184AbiBVRSz (ORCPT ); Tue, 22 Feb 2022 12:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234620AbiBVRSx (ORCPT ); Tue, 22 Feb 2022 12:18:53 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B4F16C4F2 for ; Tue, 22 Feb 2022 09:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MLSKjPQ1d6uUr2cxmOOd9s6/eWx5z6F90JXhvc5KmLLtBsN588nkqdXr8pHd3/6E0hc3FeuqM1iBiHy0Tfv8OnRlBv1uCttsbOiRjGSl/QQGVRc/OdjrD2GwZ9pIkJE7tI7KBa7nCzodSlr6D+M2WQ0pecBohumuT/tGPVcVXkdkhS7YfT5KqX1QlJumSWfh6RNmc05C5hRI3BoBpnPMrfDnhFvu9KiZd9iTB1xvh0abfDvjCtIeX365rxlD/ucdhJiDRnm2tCum3/IMBIwaJrVPK6jNnTTtZ9aZCapaetPtwlREdPU84Eg5PE1vms1/VSe0rhQgNJ87yJIn6g2ZBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lfzvhn1dbGCkwpzAv0J9NAjpntEZKF3lRdRqJrEpyCY=; b=GmMqHb8I4PfgQ/UeuhQxl5bdFitaJDdDiIHDU8b51dMaHkhNVYpgc3Gn2c9qVao1bwzOTZnmEIogSVzQp35v2wAr2UiZJR3ckL7HvAePkZzvSgkTru5/z+8UtIkaksJUeiODRSKcYgRUjkrzKU6Yplg+nj5AH/E51tYE9oPEntKUSfTTPnwkDk8P5z/auOLmSyFLlr6d3UJxSs4psBbfpyDWMBgAuYXkF54kv/tEPFrng2hUWmSWqQOpWYes5pz/dgSy7cabGL62KhdAl0WEgcGdgljOX8yXr5lo8ui/MHzBz/xTK7ftTCLNwPRlxLEKgvNZcSexeKKWFhw2hCo5xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lfzvhn1dbGCkwpzAv0J9NAjpntEZKF3lRdRqJrEpyCY=; b=TzGFGMdAUGU7ZaTL+cxBiK2CK2c5moVIVk/l69U3h3iOFsKHb68kCtNMDvqWvF4aUJsrZpU66KfvLUidXGXAuScQf5w7aYgZK37gYH/TalvdODVpGtV/7mD9D2HilSL7hGbAL1b+Gw0TbSR48wpSBvd2Qth68+jiaZ7aw8csaF8xzWVoodYYX2dNuvhlCv6YJtjPAIihlX/Hgw6HOzMx7Xhan7LJrB4hsQ9ZDvT9Byx+fWB2hjkl4Zi3PsTR8Xm6dH0o+XLkcDPytLVz0T/3qD/z2KmV2E+W/UtoYOn22nZv+3mb5PkjXkx5Nz1nUijpIBOMzK1bstWxxdHx2q+fOg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:25 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:25 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 08/12] mlxsw: core: Remove unnecessary asserts Date: Tue, 22 Feb 2022 19:16:59 +0200 Message-Id: <20220222171703.499645-9-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR04CA0094.eurprd04.prod.outlook.com (2603:10a6:803:64::29) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f812da20-48fc-4d2c-65be-08d9f627558f X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bUmM2b6GxWSrRXQDXK489krG+nd1ATI2stcnZfwZiAXzGupkn71YAhjnGUxT/CC4RysMBFfkfmPQo6rkW9M5Y18E9sZvfFDum86srKzEjk0D84AaV2O0M7gcfRV1luWtfOzWkA1hE1ZSjr1XEZyJRT+HMMfhsNRCuw7QSPKxXvRjLyaAduB7VhN9RZSs6DGpJ+ACi5AVVS4jQfZ9e7kUfnxhtuE1AoCS/e5h5iDmfA9mT/mJO199z4poRtrEvR5WEWj/QNgteqkCeycBljBZT4mNMEwAxJFYP7Zy+IzYwjcfVLUk4C2Zm4HfIIBlTkl6jiM/dMhZQFitBMribOBX/FTGR46OE/yn8YgjqY1sggFJRlL3P4Ib+9vgmDQVV5A/p9ZsjEy2tmo2bNqdu4kdHL0bVlsyfwudHaTkd395v2iekch0mtVAV+GOxx1pNQfMmOqNJuv/kzm83xGxRM0ef3d+t3LvqjMIr9qmBAFLrmZlt1KbIMFVEZKWpn3V2hDRRY1Z38Jv9gzVMBxHxtnKPQblHqztToZwYdryMAinHtIl/kS8vibSc1LngATVsHGjI8PZvIoEn1Se1aUcJMKJm7S/R8t/EZ6vMFtITX3Wmc+0Tv+SOh4yv3w9Zebde1DmUli9TkEAwrqQiYcoTwZIyg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KVnI1g1iswnrlCTKvcMGkCcIG953q8WvEGuNi/vxI9ch8RUOu7vgG7nUf7WYT5/vRNoH7JgTcGMbxwr+SU0SLKlIgN0I+4hPUclOCeXh9TO6hDD0TO2SKcdPX9ioTPCUc7nDayeggzp8qBDkK64hwYQPsYLDvvjCdsg9buCYyFRoBhGR13yAHPfwytkj/9RFyud56LcvnDaWh57k3HrND2PhBnW+QlymREkd4EIyydR0jV0tFlg1m7Stm+wuV5uk4TEKG+UZv2/lNko76ehAOdzVDMAFihMGGdE9QR4IQURoDqNS848J9ZflSi4JOZmW9BsOvqQAwyjuXyCsldEyZKdpuBmgDf5RG2CLXigzS/r3clIwgBKTrxtf5KCFdLSZbZsMl0Q86nQkPXmSGHyeArD7qj074ToLf+yDhWSznVzh3tPHj3NwIUg2rLjL0RqbQqOU8ZXfwuHJ6gA30oUx51b0yJT5momXAMl+RTGVlBjdiqbW0g9RpAJz2lNzrx9aGrUubz310t4a9O2VqzTk2syyJx1ssyTP+Xa8ZtfrwwKIKyG9wo5zz2k67d2IA/YqxOAcVzIQSlLIr/aeZ6BaOfMWIe0UCZTocFWmInqtk39liEtiSgkw8i/+cm7YEDbI9qGb+js0OnawFTIBq9lbtQywSsn0b/8c2+p4qHRF/dSXkpGkDX9UF4sD1iN9ZCdBKf+enWzrJdJSsRHoVDgKG2IJtK0AT8Eut350fbJRIad7LSvVoN1PmgRFlr6CKG+dB0/4uClm7ex/SzPrXLNEbaNvQGyx+S3Z602DyYMMSjaLvu/jg9rUM5j1/yVLZxWMwoZU5IpdY+qmgJzlNN8VON7hl9ZJMLchen2qh5xGYf4Bd4EjYTlds7wWdm/pxsFZePr00UNPenDR9qst1koHN/YII1UWXIGxrKZoaRS3VDywfq/WDkWa07ILZM6pD8YzTUr0R8GMqYStNPFpUaJK6a9RNl9ULUI5M8X9q2hZb5xM7Dx/K+Q/+f1MllhfqqmQXqxPmcOy0v1pZxOp+z97cC3E7r/jVH5GfX6w8Xn8H6x2+rox8A+FpUNw3vKxwNk+SZt+2g0bO2sPCs1YAmAWFSk1+3p3PtBEb9NaEj2tGMRWki9yW0VdDfMPb5b6CipnNwLXhdJJqNhEOPUeVURnsvzEHfn5X+01Gwa6vsM7Jfi2Pk6wjJKT7dSy0qSZV1LiTWMNR2QrMIqB0UE9OnqjOPF9RPpLS+LmrCIE9Td65b8fF5tSsqP418JB79mxPo90nx75bTP37ha/PifxU28yc+zE70aPIsS4akQ2ZQEHFGH1+9edauLPPN1zBj9qRycwt31HIV4kTjKyAgWKoOM/bACe7DMitRc8JS72+sxjZQDr/bGPYLuQNz9OOy05ZjY4rN/yyXjps7mLJfB3nkoyv7iDumVCpNFL1zsBY71XBeczomQ+7e88+1Dv3Fa/56lZZ3qqkmwdSMY8X8UP1npV00AamgbS+sHPwUp6scUe7ABwIHyKYBhQ0RQONBSOD5a55AssdyeSdlJRPm2mif2O8TBYeVmoAkpvwEAlwtcmaLOvv9+0TftbQToDy991vO/mYhgQzcaIcVfflJm8M8zGadBkjHC5cHsg0UDjYPesJqQ= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f812da20-48fc-4d2c-65be-08d9f627558f X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:25.1766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aSX69iE/y2C/iXW64multhTjMJNZ+AKv8BmgRcYTw0ybms2CWyc6EjYV3IO3bPqsFKuiKLauraos17ragZFbDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Remove unnecessary asserts for module index validation. Leave only one that is actually necessary in mlxsw_env_pmpe_listener_func() where the module index is directly read from the firmware event. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/core_env.c | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c index 6ea4bf87be0b..5809ebf35535 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -462,9 +462,6 @@ int mlxsw_env_reset_module(struct net_device *netdev, !(req & (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT))) return 0; - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return -EINVAL; - mutex_lock(&mlxsw_env->module_info_lock); err = __mlxsw_env_validate_module_type(mlxsw_core, module); @@ -510,9 +507,6 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, u32 status_bits; int err; - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return -EINVAL; - mutex_lock(&mlxsw_env->module_info_lock); err = __mlxsw_env_validate_module_type(mlxsw_core, module); @@ -620,9 +614,6 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, bool low_power; int err = 0; - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return -EINVAL; - if (policy != ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH && policy != ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO) { NL_SET_ERR_MSG_MOD(extack, "Unsupported power mode policy"); @@ -966,9 +957,6 @@ mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return -EINVAL; - mutex_lock(&mlxsw_env->module_info_lock); *p_counter = mlxsw_env->module_info[module].module_overheat_counter; mutex_unlock(&mlxsw_env->module_info_lock); @@ -981,9 +969,6 @@ void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module) { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return; - mutex_lock(&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_mapped++; mutex_unlock(&mlxsw_env->module_info_lock); @@ -994,9 +979,6 @@ void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module) { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return; - mutex_lock(&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_mapped--; mutex_unlock(&mlxsw_env->module_info_lock); @@ -1008,9 +990,6 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module) struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); int err = 0; - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return -EINVAL; - mutex_lock(&mlxsw_env->module_info_lock); if (mlxsw_env->module_info[module].power_mode_policy != @@ -1040,9 +1019,6 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module) { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) - return; - mutex_lock(&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_up--; From patchwork Tue Feb 22 17:17:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755724 X-Patchwork-Delegate: kuba@kernel.org 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 BBF82C433F5 for ; Tue, 22 Feb 2022 17:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234604AbiBVRTB (ORCPT ); Tue, 22 Feb 2022 12:19:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230084AbiBVRTB (ORCPT ); Tue, 22 Feb 2022 12:19:01 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2055.outbound.protection.outlook.com [40.107.220.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78938167FBD for ; Tue, 22 Feb 2022 09:18:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBTTe2ANpwNV6NJ6xTbIlP32snaiC32quZ4z2f1W7jGzNhesBY81SjYBuSLqxSJZVn7N9Kdyr0mLtLz8vW75bcgw5s0o242ouUE+Xe+FVoTZFKwWfHMeU6zVr2FHZgksZINaohHop09ZFpc5rglJ/IBFbOOqSJUL85oHh+Ll8ZAapwxRuVa8kyjOM59NjWQHU71KdF3QwN08HYKjIM46zA40VvEAmc/5g/G8xuMszLAwpioDMzNGNs1gS9KXUTJGjdcK5Ad+Z0F4A2/3w+iviDNi0Lf8DFDcnNlW6fKulXYWO23X4BFGTHdPToR65QfikAgdiQIHf6Nb+AaOyUzmmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WAGkmLvUmz+GSb9yzZT8581wD/K4FHoZyqL4nn4vLek=; b=faO/8j9Ue6KjU50oawgcoWZz21AQQk3dPbLPQzei8up4QPeYXgFTcVVXh1fif8KnLMJC9MFSI0/OEvty4Pz3TCxByqIa2md7KfA2qCLvnwDQcRbIYVmNMO/ZG7jcAsKhbPmT5trjHZjIwm2eQRSiVs8qwGh6TDOrfxf/8N6V8yuXVW+tobDPPcAzuqVZnhf4ck5Of8Kj7c/bsO2ftG9tsv1ADgr6cJP5UAylHAXaoNNbZRJEOYOoNgD1k1qwUJxYgo5SI48DhkE/vL6V2QdaTsFg6msHyrJPaL8lgop/c9bWtYzj02eOM4XE+aLxKEuToDUK0cckVRiB+WQKAhDpCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WAGkmLvUmz+GSb9yzZT8581wD/K4FHoZyqL4nn4vLek=; b=dp0PCXxkToPEUGqrNtyntwUwxfICtv4GfY4QWuJD5nsuEKLvoJSxuBVu76bvvo2SoN8AYVGIaXVcChLkiDBLDBrOKy0H+V+x9gKorWSPeAkd65MEyLqabxZwcVDyfXTabbtZ940y4+/0jCUS0weHyWOhJ5GXoJv+BRiunr5G80tc+mjA964ukAzsCQSr69I5kmyQCTAG/Xnp7+GfjJgOPeMVg9F7KLbAJ8qoj9oSBbCwNGgL+GeTpomtmMmqgFznz7BwfJW+WIhDSL7LsCPMjLtza5CCrHVv8MvdAC2/j5DmAKngERd2zqE+MA3bFjFM8lT3v29UUx6q9o7foWCsHw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:32 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:32 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 09/12] mlxsw: spectrum: Remove SP{1,2,3} defines for FW minor and subminor Date: Tue, 22 Feb 2022 19:17:00 +0200 Message-Id: <20220222171703.499645-10-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR07CA0312.eurprd07.prod.outlook.com (2603:10a6:800:130::40) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a57bd6f3-b1c2-4628-e795-08d9f62759c5 X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gyiLrlZeYUK+xxgu7j/5zTYsRHkR9YTl6SqiICuvpZQbWX61XMBgHAowVCBwivF009y2WLbWi4UOIOYizppUfpGNRJlBm98ZF9kVzrdjojvLORS/yoCBLIK//Gx6ldfk5lPYB2ZSJVLf2QdYDzvJPChjoM9xwtjhFRoTABsx3LCJgQ9W0BGxz0bFWhyCtn7jmmo+S+xqGm8g14t4HzGUxWvJCMeNBZ1ZaNKNvHku7JiYDW1U6QdEhU0z+Narmoy1FciEmeflK86oaSZTEgk+JsXRGhVdyHxLTpLb2RMbSQwLXh0eE30Pkgj/pLAFngxWvcfQ+/xqz+NQZ+WOqqfdjcXz/NtM1s7l8YHUm/FnXblw0lwb76/2xpdnuETX3bEpzEtiTVF0/OJDOH8f1Oc3ZA4hhJLr+GKKZw9czT0rbTu/gNIYBuDtGzMw9alm8olW/YJgcpwwmqKnPeSQfZ2EiLcxMO+RumCOSBdMcNGcGVtKpkogOAKWxpjjEJohObNXljWZA1Tb8XlwTCsZQQTctADyu+X6NoHLDcvRJusc/WL2jVxrf/UYgD8CxRfWeY9Llrdi4CE39ynRH23Z61v2BfqROJNCn1/nEXyD02aPV/9MiNlAQNv/zCLPSwKTKkgX2aM3/gJQrUvry/CUBA1+LQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UYVz7yGbIAgA0S9BoqiFT3jL7KJ/ikrVPSrAY41VQZMyKBdRvnXulenQe/9s8KoiKIAVnHzLV6sPIsYJJa8dzr5lJEqEW293Hmqmljgx9hgJ1xvy1p+ZOsDS5+DGMnPPbhhKQuIWfcbziN/dAZHdTde6tY4uT/Q/kCPEmUmfRDjOvk6PrBtPIw2FrsEaC3z2ea6culXyUxfjSKRkvfIHJ4qJsDwslTPhAByYzdiXPlMb2FT/hPnowEiRpJX14sXU+93MbjDI/3jfd4axxJUpciXob1bRrX5vQvF9qIyMXvTJvJ6id01NrhKhWUjaawzdoF9nU+yn/f6NRYOT8n1n2aBtXlimK1GKhl0HfMQ7qM2RYtmjFPToPbbunhTK8+aT7PKMgawrTGmrV8vrjPF+PGjV8sjMbTBMf+H+SeciSStGW0yTsAuD0cagpEJqnI2xDIMp8uJIdw+eHIRDDFnWj2KIuj7iscIOQLrC6vpGlgBMI5YHYIUaOEMmW8xoWX9SuM49u9gGJZTOUe6n3M3G1pQJIBuElOOUWg04JR7V+6kSqL8sz9bETz6ibrkA6Ot1oj0n034DigwtGJSpWCiGZbitaCvrRfKdvvcHiOnNPrCg4aBIr7xkDj7VGIGH2vC/DNEgWh6qw5KY5v8OYJMxHXoUGE5oAiTm4SpsdMW03ZqkOMGqBzM5+QjQPk3iJWe/stXDtIfkxycYDZBn7gs2nu2EFcC1Rwt2IN+RYPWfedsWiqGTNp1W9k/azWIPZs+/vvjivaz/ynOs05LZO1M96wHp+VBb68ija7CZS286S4wJ1UJ0eBU4FxjHMHWq7e7ekulOAFQzv8ls8giGO//HNyClyFQtEBRRkDpTf+1r4pYiat785AAd7JVz1W4kqvrZ9t2MXmL7vhfqNpLsYqGlJMhCzbz4NVgcb3Z0hdvTCHDOi92I6o1YYDQ9/qzT7kmBRrBHI1eUTIQG/Hs2X46sQ40x1XzNM4BP2Fj2ArWZIsO4IdjU0rdj7UaNZxkKov3oRYTG53wrcxviGFf9ZNYhyx1bug4bB3MeJY/snbEzcZ2NSCWzviNFVn6iCoZUeFnkP08xMtvHQ5dCRufjhBhaa9xyrOoP0d7HJjSSRlEiZOeUMbrRagEnoOR8tZRQXXWPDgSNXHAXwavRxB27oMGwEOU+r3Q2plA86yT9vcu0msKflDRkx8w+PeGtI1VjLiMKO6ukeu9ORufzQdx9TCo87qqLuKHkgRCrUe6UtAyNHArYPZlnOYlfH1TsJZcQs8oqWpLIo3am6shiDWpeTGbHpkRMjQSc+dUVwVU0EDhroPGrZdsUC3y9yYjwymrmhdazNBieYgnfTIoPki0Jzj2VhilrrqeyPsGn6606oyMShdPXzo/WV7pZwHHuVyXvt2iNcOZqGEBCg7hHyHp9m/7xDnligETnR6ynH3R8RkdPHa6m+ymCkRuykue+ZIk9xgBVE113NJnMz7jT0FEpgxFeI4MB85WSuQG4c6UcswbsrWM0i7lQ3BtyT8oyX7bIa7AEyZ7r9UFPMtHhzu/Dx2aibKW5rgNmZFuKl13XC7Snr8NZRGn1EEmFRCADwf+fmzsruQDdfUBDIg3lroEqNYUd5g3OQ3m/4jYAfCnXNJJEVUY= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a57bd6f3-b1c2-4628-e795-08d9f62759c5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:32.2747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZNqM4/T+JIKU8fMvyd0jxycZjRZ+ayVzaSW7I54oqppRUkVCJX5NWZgV4MqJJuPFLGs0syuw0FwJSFIqi35tcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko The FW minor and subminor versions are the same for all generations of Spectrum ASICs. Unify them into a single set of defines. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/spectrum.c | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index a4b94eecea98..e39de7e28be9 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -45,52 +45,49 @@ #include "spectrum_ptp.h" #include "spectrum_trap.h" +#define MLXSW_SP_FWREV_MINOR 2010 +#define MLXSW_SP_FWREV_SUBMINOR 1006 + #define MLXSW_SP1_FWREV_MAJOR 13 -#define MLXSW_SP1_FWREV_MINOR 2010 -#define MLXSW_SP1_FWREV_SUBMINOR 1006 #define MLXSW_SP1_FWREV_CAN_RESET_MINOR 1702 static const struct mlxsw_fw_rev mlxsw_sp1_fw_rev = { .major = MLXSW_SP1_FWREV_MAJOR, - .minor = MLXSW_SP1_FWREV_MINOR, - .subminor = MLXSW_SP1_FWREV_SUBMINOR, + .minor = MLXSW_SP_FWREV_MINOR, + .subminor = MLXSW_SP_FWREV_SUBMINOR, .can_reset_minor = MLXSW_SP1_FWREV_CAN_RESET_MINOR, }; #define MLXSW_SP1_FW_FILENAME \ "mellanox/mlxsw_spectrum-" __stringify(MLXSW_SP1_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP1_FWREV_MINOR) \ - "." __stringify(MLXSW_SP1_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2" #define MLXSW_SP2_FWREV_MAJOR 29 -#define MLXSW_SP2_FWREV_MINOR 2010 -#define MLXSW_SP2_FWREV_SUBMINOR 1006 static const struct mlxsw_fw_rev mlxsw_sp2_fw_rev = { .major = MLXSW_SP2_FWREV_MAJOR, - .minor = MLXSW_SP2_FWREV_MINOR, - .subminor = MLXSW_SP2_FWREV_SUBMINOR, + .minor = MLXSW_SP_FWREV_MINOR, + .subminor = MLXSW_SP_FWREV_SUBMINOR, }; #define MLXSW_SP2_FW_FILENAME \ "mellanox/mlxsw_spectrum2-" __stringify(MLXSW_SP2_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP2_FWREV_MINOR) \ - "." __stringify(MLXSW_SP2_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2" #define MLXSW_SP3_FWREV_MAJOR 30 -#define MLXSW_SP3_FWREV_MINOR 2010 -#define MLXSW_SP3_FWREV_SUBMINOR 1006 static const struct mlxsw_fw_rev mlxsw_sp3_fw_rev = { .major = MLXSW_SP3_FWREV_MAJOR, - .minor = MLXSW_SP3_FWREV_MINOR, - .subminor = MLXSW_SP3_FWREV_SUBMINOR, + .minor = MLXSW_SP_FWREV_MINOR, + .subminor = MLXSW_SP_FWREV_SUBMINOR, }; #define MLXSW_SP3_FW_FILENAME \ "mellanox/mlxsw_spectrum3-" __stringify(MLXSW_SP3_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP3_FWREV_MINOR) \ - "." __stringify(MLXSW_SP3_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2" static const char mlxsw_sp1_driver_name[] = "mlxsw_spectrum"; static const char mlxsw_sp2_driver_name[] = "mlxsw_spectrum2"; From patchwork Tue Feb 22 17:17:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755725 X-Patchwork-Delegate: kuba@kernel.org 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 B865DC433EF for ; Tue, 22 Feb 2022 17:18:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234614AbiBVRTH (ORCPT ); Tue, 22 Feb 2022 12:19:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230084AbiBVRTG (ORCPT ); Tue, 22 Feb 2022 12:19:06 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2080.outbound.protection.outlook.com [40.107.101.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0CBD16E7F3 for ; Tue, 22 Feb 2022 09:18:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aClQRcAJLpRm9FhR8TN63IUZk7FDGv48tZeA9biPC29BuYUFro5KXvC84KGDk2uKmAag94dxhDjgXptfwbUz53estxgea0md53TeyhITtM9GM3DQuZK3nBk5hV5iu2MySiu/D2+uqRezhmuOwdjdF+Vfw5VTIqKxpmiOOFEOIBj9Kd4l46eld2tSc+7gLhaEAa9Ed6cEsWraeWo5wEMtnL3MyF5bsT/bDkOeHOtQv9n3VNiavnFTvA1IKxi683BhvKkCXuk0JxtB59FXPYJyeldTcF4uWypFHyWpsiLIf4Cf3JTVEg/T0N+rOHkRw73nN5XqanI3bU1K/WCok6aemw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uhcTCNXDssSJhfiWHprxoMxKE/2ZXUIA/7fe2pbOh+E=; b=aSKt+zlc4d2MOlgD/lkeu1bY7CyOHZLAlzp9EmVQKqy/qgwIi65Ekh0cGkEB4mvZBNy54PRHhfBZvP/vnTehp4LV0KhLOrVQ0qMGx15+LqhZrtQYLkEwfK3+l5GD/XRkRP+EHz5rVwYzVkvXZ2fjmJqXuNv755Tzp0zljbhlgaI/5dD34gFLlysXTMArLebrR3iFeFrZoKpZ5QkRKD0f2rNqnCrmNb5CA7jqOK4/80rBkoNozLWXGebxn6gY/5DLlrmY5ciahZzpNh2/x0uHUqK/Jw1QvFoparjbRYMOt3EsAzK0HOYpxtc+MLBgX7tQQFva4LRJjU3h0z3nBN/XxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uhcTCNXDssSJhfiWHprxoMxKE/2ZXUIA/7fe2pbOh+E=; b=UFOR0bHP80yy31ikuFZmv46D7ROxcqHmgWkTQjiw8l34GNKhJ3Q1cdrColp/mZdTmGaNsaD2O4MUYzYTzZY39WAtUbO8R2j4oKruikN4NB7CF3btJf9megYCb+PIFtjU4qBCFgTjNfsXspvPnQBxflYeaTDmqjSb7T9ccMY0ULbHdwDTbvqPSwIMW8BW2xajxitWHnYPStwYEbKy7x3hRUl+zRqUDJmse+regrJ1jiJuUTdp78k9SLsEYXuK4s8oaSelB0DazRFvviDzO0TiMWJ72H58u76ddbPNVAcCQXl5gX1l5AmOPG04+7js0oYOIy9S6yQ2ebn5Jf8PY+An1g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:39 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:39 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 10/12] mlxsw: core: Unify method of trap support validation Date: Tue, 22 Feb 2022 19:17:01 +0200 Message-Id: <20220222171703.499645-11-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::35) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6afed1e9-2dc9-4347-57a6-08d9f6275de4 X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xHYuO+9LPidPfKua07VSOVOPuhQXypBZNDhJd+L0Ognu+h3hCCBzCA+kZmVawvZ8QDv/MxNXie8jNsyVkXxJ6p3dPxthFsVa1i39bvfGaH/wyxirfrXM/XLURCYQJrfYlMI8xoxj/TcrZpzNqBH8Tt0pmKr82UB1jf52/sY4NzmA5eeF8uz12eIsYQP1ghP72VabmmHo4TNt+TzyfscnNOY9bDn+BMjaadXa2g5m+/ChpjL4VPWmmTUDEZ0HPX17mNVyDqhHpqp4W2dI1lvss0zpUAJUE+ibxtsXKM66V0RQv3okV4SAPJ3YjHDXtAdFP5C36urb65J7Uu1lv41g2mvlXdO4a2a90//zg54LbkmQprDX5PKi4WhEhJACJyBz/PZIj0/4ArX0oKyVisWMz2MgVxtxILzp3uOOC2lp+6rk2SWCHb+D1dkAbyI8vk/5hMIKHcPAuSrvn1PSO7NAaFkI0WiL8+WGYXaFGj/RUL6ouodjb6bF/i2zVUkf9SXhoSoeBAF2qK1zmbBcjxrWXcpP0nltYbRPVv2fBnAAziPAWpSae86hLlI9f8bmm/L2NimYJi8yucfeAckREZm7NefSBHxdx4vvdlmOclrqyL8C3i1KTzKr466MuA2xHGtXa2bzoYjMSwkQtEJ2LchPMQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VPycAx5W9xMeIbwdb/GAu0bVoUPXN0dXnh2Cwpu1XXjJ4fkssbhLakz/VfPartn5a4HJsAYbRWE7UpteL7JQ2ipEkEcZuDZDiSnZIv6zImq8sUppQEoKSkWnpfl1S2+w50Yb/noa47zAY3Ymw536vCoP1xryQ1AhzleENd+d00hfblybOM45Awbg1ZfPL5m0tkTWUi24Oq1GmO/qd4c2P2OUwfsnDh20fNHsaPuLmrTFQ8ZeZkSJ97o0koFc3UzlFJanuxwD82IRIAYHvticlELUpCQiLdTVL7sLLlJK0L9hjLpeEHDpDO+wS6wuhKpwZZVu7xOXl1EeNR5cCY4N7agdDIzHg2zxdA4GsMjYaZI05BPHFGvlpFdqr+oKdwL1PjI1Ax64QC4/8dap9OD/MzVjjtGpye7qv7wF0CXh/TzqiM5qVNs2RTkQ9ESqxDwmgRc25oc/PVc9qtJapv1WDw0C0IAcUgDaCRm16bQQv+qehTpcfEyHUgD31uplUEfSm+nTQ3Vj8Zrvl0Yu8mYp2k4okq5BrveqV9m8e2DkPeSgEnOC7LToW08T0DdrAP1OouQa3YC/xem1b9mgpE5yjBQvYvVd4eED+ZGP/rO+rKKwe5MlKgbYK9YTbiv8yud43HjoJdxQeruTsf+poASoWscg1slTBbGE4SAHK0pU7kea3mzWrk4dY32/BCGygzL4GFeiKo42PIJy/bC6Y07O56+f68iIIYmiLzRaUJtNJTsf7BepBaSUHX1ONQnqrAxILQ0qRQkwWCYO/BcLeoQpA4DMyYClUimQI+84FRAE7F0qSoAQMNnnyu9zggMyoIQwwLGi3ctQIXBE+iK5uxL7xSaYGQIJZg+RTpr4I0XKvvLspyBWDnxU8FjvKL9S3ZsvKjFPTnWolvhMhWuUa/Ih3q/saRsYacyO/xxl1sKQj+CDXGsCSZyVUXifhGO32eQkL0Zlxe8rJh3K8pvLeSD3xU0JrvvqZ+FYFj671wp8EwR/YnYj47BWi2YODBHhT5Pjir48WoLCj4vDtU4oI6qgZo1SRX5QOUwYqc+1dunIWJ7rglVh0Q7wUQA2N7RI/KumK/PHtTG3qLIQldsIpkFW8gxav3Cr+PVgYe8GF/0BB1mevew15XpWv/ZbHx0QbfifBLSzsaNo6YIGexfv7CB9SP4ZoGk5nDH/uiWzwDs6yggow3pstAStV0hRHR/+0Ij7F26jCYM3O9an2w2Dsuc/T36cX5VSWc2sRZS9nGHsgrpYixD+lu6sU+0tOO8DpfIAnGOhGm7Uen4zAke1IF+BuUCCgx0lAvGgfMNv6vi94zEPWc83UwMLEnYmzYW9m8eSU/w//YXO8eKNnRrBRC43Cz1lqOvzjXOaJ+OBrMbkzK9JyAtqNIy8BEQpIVtiHBdM4JsgaXMA4mlYo2bNIaBzKptChGK/67WGSlbxgZ41kurmktC2j2F43mQ0CDsti8zRje9q7uv4NE7X7caU5LhaOH/RzD47i8wcDcOWCUTApOrAumui+BEyhUoaZajixdVxnmZgODQ8zWdRk3laaemeoJXb3z17bxyXnR1QFQ3O9PBmAZNC9ZxhbkJdzRT8+aB9K865ntylQCXt3ZmRuLSh+RWPxR40j0xaMVZoeSrOD+0= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6afed1e9-2dc9-4347-57a6-08d9f6275de4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:39.1396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YeffAN6fWo350bcjL3Qq4kRFXaJXXXHU+Yn5grcwh2peMDgGUVTGzi5iQjWqzEYf7PwjIxcMyKjZGRpR//pCug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Currently there are several different features defined in 'mlxsw_driver' for trap support validation. There is no reason to have dedicated features for specific traps. Perform validation of all of them by testing feature 'MLXSW_BUS_F_TXRX'. Remove trap capability validation from 'core_env.c' which is redundant after validation has been added to mlxsw_core_trap_register(). Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core.c | 9 ++------- drivers/net/ethernet/mellanox/mlxsw/core.h | 4 ---- drivers/net/ethernet/mellanox/mlxsw/core_env.c | 12 ------------ drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 8 -------- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index aefd3eeb3c9f..4edaa84cd785 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -177,11 +177,6 @@ void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core) } EXPORT_SYMBOL(mlxsw_core_driver_priv); -bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core) -{ - return mlxsw_core->driver->temp_warn_enabled; -} - bool mlxsw_core_fw_rev_minor_subminor_validate(const struct mlxsw_fw_rev *rev, const struct mlxsw_fw_rev *req_rev) @@ -2033,7 +2028,7 @@ static int mlxsw_core_health_init(struct mlxsw_core *mlxsw_core) struct devlink_health_reporter *fw_fatal; int err; - if (!mlxsw_core->driver->fw_fatal_enabled) + if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) return 0; fw_fatal = devlink_health_reporter_create(devlink, &mlxsw_core_health_fw_fatal_ops, @@ -2063,7 +2058,7 @@ static int mlxsw_core_health_init(struct mlxsw_core *mlxsw_core) static void mlxsw_core_health_fini(struct mlxsw_core *mlxsw_core) { - if (!mlxsw_core->driver->fw_fatal_enabled) + if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) return; mlxsw_core_health_fw_fatal_config(mlxsw_core, false); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h index e973c056f0b4..14ae18e8c6f4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core.h @@ -35,8 +35,6 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); -bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core); - bool mlxsw_core_fw_rev_minor_subminor_validate(const struct mlxsw_fw_rev *rev, const struct mlxsw_fw_rev *req_rev); @@ -405,8 +403,6 @@ struct mlxsw_driver { u8 txhdr_len; const struct mlxsw_config_profile *profile; bool res_query_enabled; - bool fw_fatal_enabled; - bool temp_warn_enabled; }; int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c index 5809ebf35535..70e283d22783 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -822,9 +822,6 @@ static int mlxsw_env_temp_warn_event_register(struct mlxsw_core *mlxsw_core) { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (!mlxsw_core_temp_warn_enabled(mlxsw_core)) - return 0; - return mlxsw_core_trap_register(mlxsw_core, &mlxsw_env_temp_warn_listener, mlxsw_env); @@ -832,9 +829,6 @@ static int mlxsw_env_temp_warn_event_register(struct mlxsw_core *mlxsw_core) static void mlxsw_env_temp_warn_event_unregister(struct mlxsw_env *mlxsw_env) { - if (!mlxsw_core_temp_warn_enabled(mlxsw_env->core)) - return; - mlxsw_core_trap_unregister(mlxsw_env->core, &mlxsw_env_temp_warn_listener, mlxsw_env); } @@ -913,9 +907,6 @@ mlxsw_env_module_plug_event_register(struct mlxsw_core *mlxsw_core) { struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); - if (!mlxsw_core_temp_warn_enabled(mlxsw_core)) - return 0; - return mlxsw_core_trap_register(mlxsw_core, &mlxsw_env_module_plug_listener, mlxsw_env); @@ -924,9 +915,6 @@ mlxsw_env_module_plug_event_register(struct mlxsw_core *mlxsw_core) static void mlxsw_env_module_plug_event_unregister(struct mlxsw_env *mlxsw_env) { - if (!mlxsw_core_temp_warn_enabled(mlxsw_env->core)) - return; - mlxsw_core_trap_unregister(mlxsw_env->core, &mlxsw_env_module_plug_listener, mlxsw_env); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index e39de7e28be9..da6023def6ee 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -3628,8 +3628,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp1_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, }; static struct mlxsw_driver mlxsw_sp2_driver = { @@ -3668,8 +3666,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, }; static struct mlxsw_driver mlxsw_sp3_driver = { @@ -3708,8 +3704,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, }; static struct mlxsw_driver mlxsw_sp4_driver = { @@ -3746,8 +3740,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, }; bool mlxsw_sp_port_dev_check(const struct net_device *dev) From patchwork Tue Feb 22 17:17:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755726 X-Patchwork-Delegate: kuba@kernel.org 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 2CBADC433F5 for ; Tue, 22 Feb 2022 17:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234616AbiBVRTM (ORCPT ); Tue, 22 Feb 2022 12:19:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234615AbiBVRTL (ORCPT ); Tue, 22 Feb 2022 12:19:11 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2063.outbound.protection.outlook.com [40.107.220.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DD7316EA81 for ; Tue, 22 Feb 2022 09:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VBUI9TOq/gVe6rmSPTH/yl9VJyf7BL+rvPI0AjTAh7X54KJkWfuhMgqoFcho63Fr/6hqvzdw8WSvdI7JkWaHxjIsNoDgKuGs0frUrCTPiboZ7iaP/5G9f9h9v820JzwMhWiT3Jjv5Caai3vUEXOXJKA8eBdHvkA8FSozqpjHh1mQrmfxS4VUprcaMeEg5cTDZps2rXFtQi6I9BQOQ0jK3PtgarlQh7FOP98vcMNff/+cJ+r2eEbF55HwAePAmo9LPhHUw/P+7IlJFE+RaRMatM/WYH1zRg433NIU5FN907mnf+obcs82hwm3Wpemz/TAERIGR6+2Ba1azmwkZ5IKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gm+8/fJpbvCu2zO6Wuhoyvvk0m6+yReZdD13udKxrDw=; b=YUrIMFuGT9BTIZ6Xtfz2jGtlJJ70ko0wIAewkJQoJn+Uy7xB2ZZVOr6SHwlpEM+/Z2GgYBmtfY4snYa5Qf5V2JhcvtoDXwZ8147HzN/qLJgNObYc/1RZ02N1s0oaDEJTBch0t17Aie5+3OSJNw9auZQQA1avrifljrqK6JBTfFOb1koByQIaLvAQZSN0Foq9tiWKdNSUdqAcoUY8sMfPbVZiv0Qtet9wDXIHq0qigGp0Ac40SO4FvvQp5zCulZCR+QSS2UlzwCHj1PNog4o2TyU7c7qasdI7Hzaq7nhTrU+t7FhG5krvXIZZ4AEhpDwwCOVlogb+C5UR91S+bwFuhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gm+8/fJpbvCu2zO6Wuhoyvvk0m6+yReZdD13udKxrDw=; b=kJEWFRe3rYD1wxohiLvBGURcMDMKM6ROO/Vc3WP+9hrghlmxtZmTLjR0mjzqpw/fR/rNIyXV8m5v+0tLOGPH/3N1Jbkn6KSBWC1jkLd550phnbqli+mNiLWvuWyZwWzo3cM+6RISwkvcmJU2/6uJERwmHTF+SV6SWv4/BLhYS0WGgiYVLXFfTy3pVYWayKbyG2TR4BdaNPsYSgP4PRrLfmQ8ks1V+c9osmEFxiKHrzQyKiBDPdbnSdXYcfKLdrJ41o2GCFg8IBiYbO985pY5HFnMhr3BOz436x3ZDz+Ffisx6aoxD5/g0BR0hMxu9FLIDIGW0ZZbT5RALDlZOm76PA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:45 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:45 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 11/12] mlxsw: Remove resource query check Date: Tue, 22 Feb 2022 19:17:02 +0200 Message-Id: <20220222171703.499645-12-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0302CA0019.eurprd03.prod.outlook.com (2603:10a6:800:e9::29) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6afe07b8-1435-47af-58ef-08d9f6276161 X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 339ifXsY79xE71Z1JYaiNsYhG1g5oz5R8/sxnI0sPrlv1vRz3hkelQfRVrdfrPOIck2RbAjmWRtpB8lfAuMvxFBYbKqjKoonTqlCRas5761+atRXjVJIJ7zNwr6KLd9bn89ylgh7+ADYC5rkz77t92UakytIZUVQa3WqHPcqXf1G/kV0RMQpjZddRAkKbbgyS0rT/0lUZLnIxC37W1QEjpVlrmlxjtRCamD19o0yIwIiZPzWuSTmHKTOBCkTkaYbiUAGmTZIW8549KtJxPMceJnBR2NB576tsoEauzhUp8r4EXzxl/9C6P7TUZHurlHoZf17eRM11miNprilfKJRzG0taJD/w7Hgenyd/bvA+fcd8CmB3z97GvZ1OXzgA3GrMpVfXwL/dXbg2IC/m71iSSfucIUVRMU5Jk8VLWhTP1oFDN2yyGGGRC3k3xBbq5xASGcVnrH/wkftFrEG08EbAIjfsyaCR0ErwzxEUniTodzvZT6MLcDzjh5pmjyXpkVLTQPtWDZc4mrDGSx+1fF+QlaCH3v2G0pUaKZ4HallpbRlM7CkizHKpnfzLESIG+58IP48VDWKRwBwfDWl8+YhuKexhKz3gQQQ+CdLUINblC3lYF36ilJEYextRVxt0bLlZznaHw/DqmxQ9ySkmsioyw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z6BsfM5lr/83D2yFaoRJz/ulqhGdtuajfYWqSIgG97q8WvQvP0nhrNlJLR8nFGqcn7PdpRMdRAV1YaoCIdCRjq8dTiRAcmZlrUul40gVEA1q+4ojZF7I3/SgvEPJRSy3rZdfb3oOQOhDqj1cpjqh1087Jjb3FjlFBoaAfbMLY/Dr8UBIg5f3ZLSxvw1Rutf7QA/BXkitidqqI3HbUG1UXAUx9NrkMtKI+X8DZACZTGitfWuCKAnedXZUnRPD67Zknx1vMyqF23B6AM5mrX0zjokxtISSGnffZUKSm4KZ6fUCuI05/MzqE9G6S0XN46UCVoqpgKlEteyVo4bnGezsLCcvDpgG4s3uS4ssC5KjUBpdkaLkuacdAfHVu7tatRy87FuUvGZZDvwmdwhVn8sm2OW2hs+jcJLcLpSi8m65ho7nGA3oBic1uW64MM/763S7WxUWBvqFEAP5Z0A3Y0LY5j+T0LqQGFEm6R2Aw3BODj95fyNO5pA/Em9AuAJVpMLg7rmv+GEvyVYteUJoTwa5n5e1OIk3PYJZ06Sdx3z7QW20L4vLsD9mDukLfGdOZ46X+j/T6bP0NBpmE1JqVxa2GJCKsSLZTdfmoF/FakzIbHhN1pu1lu8/LckHQbpOiWbnl9Qc0bjF34KT5h6KZQ9afWXf+7FJNHr79D/Ca4hWr/z/rgg5FbolFsX75u5BtDOdak0NZM2Y/HVVfXkbW5lMBbM2g28hJshJXb1mSy3usju9XbEiscdXtwpp2aNmyFXm/rRWICeKH5JG09HQbujOnDafitj4I2SkN959dt4Ha6vHK8N3DODuZoM5C8tDg6IFjbO8R7o3S2SUbaB23QB+jgPcpApirnLfOePOhIw/afPndvFCvc0tsO/+aR65sV6ik0XHqvtH3CAs5l68pWPYmBswI2rhG55HoRB1zPrkb/CE/eifE5UuBqqNN9DtIXicDTqB8WSc58RA7j2rIcl26xFlyyb07h7HA5FmcPhfhccCzyNFFSfOLhuLiFUy9Ap44u8vQVp2dxXngzziMcs9rFZJVeNFq1LqqNtSou8qTuBlytMZXecT4VovkfZ9bxnpNTx87mIJRjlyXIStwU3EtFzK12q+X4fwf4yQeqAkKLPHvB9L+FgbV569efR6r/H3QSB9Oed9I9CwgEZmSO5N1oaGI9NDptYtmgmS6EyfR2OdfzQNdDpJwTBQLUPotOx+dWIUXW5Tq0U5S06KDUtImh0IP2ra8YgmyH98tHEBOe4u9ApvEgc9NWhzrURi72b2UDuRkk0bzSNG8CFVGJp8NbeblM96dGUfHgmJwbys5+A0ddpeUJ2p5Uwj3g29nAieYQed2tTP62FtUYeg4F0s5Jbc/6hCpWAlknJjVwcnw7PF5fusPYWaD65ojykmC7W4chErygTZaTMgL64NMEFhFtlp04fU3u1hYg+vBjeFzRQTIURkCDa3+N5n/XLRlkYwoHQuBCiu7eaBiuW7B6I0NtVOWRKcXfkqinNGxKEFe1BXJ6l+RWd193DJ3CuKtgmCWhXXvqQH6Vs52g+phxYDCTudeuuzw2tFVhWcMiQKJg9N9BuZIW7Y6wsbWGghwhiQ8r01HeckW4kD0sCNRH1++q/uc63xf6XkCsvdQp13YEQ= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6afe07b8-1435-47af-58ef-08d9f6276161 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:45.0062 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 03p+YDeJW6d8kDGebgbEn93Ryk3irm5RlHi/9mnw/rIjWRdpsDih9PwzDv5JW9sCLsVkhmf4zwjjFUEi4o4FhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since SwitchX-2 support was removed in commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC support"), all the ASICs supported by mlxsw support the resource query command. Therefore, remove the resource query check and always query resources from the device. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/core.c | 8 ++------ drivers/net/ethernet/mellanox/mlxsw/core.h | 1 - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 1 - drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ---- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 4edaa84cd785..0bf1d64644ba 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -2078,7 +2078,6 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, const char *device_kind = mlxsw_bus_info->device_kind; struct mlxsw_core *mlxsw_core; struct mlxsw_driver *mlxsw_driver; - struct mlxsw_res *res; size_t alloc_size; int err; @@ -2104,8 +2103,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, mlxsw_core->bus_priv = bus_priv; mlxsw_core->bus_info = mlxsw_bus_info; - res = mlxsw_driver->res_query_enabled ? &mlxsw_core->res : NULL; - err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, res); + err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, + &mlxsw_core->res); if (err) goto err_bus_init; @@ -3240,9 +3239,6 @@ int mlxsw_core_resources_query(struct mlxsw_core *mlxsw_core, char *mbox, u16 id; int err; - if (!res) - return 0; - mlxsw_cmd_mbox_zero(mbox); for (index = 0; index < MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h index 14ae18e8c6f4..16ee5e90973d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core.h @@ -402,7 +402,6 @@ struct mlxsw_driver { u8 txhdr_len; const struct mlxsw_config_profile *profile; - bool res_query_enabled; }; int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 9ac8ce01c061..060209983438 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -461,7 +461,6 @@ static struct mlxsw_driver mlxsw_m_driver = { .init = mlxsw_m_init, .fini = mlxsw_m_fini, .profile = &mlxsw_m_config_profile, - .res_query_enabled = true, }; static const struct i2c_device_id mlxsw_m_i2c_id[] = { diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index da6023def6ee..4880521b11a7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -3627,7 +3627,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp1_config_profile, - .res_query_enabled = true, }; static struct mlxsw_driver mlxsw_sp2_driver = { @@ -3665,7 +3664,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, }; static struct mlxsw_driver mlxsw_sp3_driver = { @@ -3703,7 +3701,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, }; static struct mlxsw_driver mlxsw_sp4_driver = { @@ -3739,7 +3736,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, }; bool mlxsw_sp_port_dev_check(const struct net_device *dev) From patchwork Tue Feb 22 17:17:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12755730 X-Patchwork-Delegate: kuba@kernel.org 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 ED03EC433EF for ; Tue, 22 Feb 2022 17:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234618AbiBVRTV (ORCPT ); Tue, 22 Feb 2022 12:19:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234615AbiBVRTU (ORCPT ); Tue, 22 Feb 2022 12:19:20 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2053.outbound.protection.outlook.com [40.107.101.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55FF16EA99 for ; Tue, 22 Feb 2022 09:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bw/5cy+pwPnFwpBooK/Weha3t1S9NzyZ60Tfv01jYvuLc8BT9EwiVGmyDAb2hsS75+PlfeoV2kx4CmWDyIv/U8RjoKC1oOqs9rgfcze7Tiqq7Fr06hzfR5i06k1qHZ/2R+H/zJrwImg9B7J1dpX4bNDp+dHclRx6gd7CIuy8TAKM8x93XvIdbxWZHEzlXnqi7uo9pliYJjPpshjmk7fkMxpu/5zndEBY1n7IM8D0NdOzGcoDjDC0ej5oLVX267GC/Edu+eeH+9NnFSdYug/86KwQY54H/qJ7SrJmABHC1QRtiB6BSg4BF+HABEhaS3CpBZpcCXbwlHnAjyPhhmUL3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nkhIVlWFF+jAWGKUfQHdRaOYtVp2wg/6SfOM2ARXFfQ=; b=ZExs2WbqXV5GrEwkt6y2+FFB2rlMCfbaSAfNhqcl5tPtmkA7ikFQPx1nAh7TnYHe1Ug3kUQ/B1rsKi7pKYr0wj0hKVHoPesNe+pnlJGZglBycB5mk+tVyAGIJGoRKmvyKCcWA4rjrmnfjmrEjrp5o9MoR2umvl4wZbBWmD7UvQAO/sAbL25QIBBQ6S10FZGwJMf/SH6cBWhjfbBl7rMjQI6kuZuyYpiOpQe71ttINlgpPR4JpbNYr9MuJ6LItsl62WrwbPr9/+xqGGNSi9cPLqF/cBKAdLH0rJYf/q3RKduOnDw0CFLo3mfNXkelKiT5y/AkAsARqhPRzODYlGav0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nkhIVlWFF+jAWGKUfQHdRaOYtVp2wg/6SfOM2ARXFfQ=; b=sy1My0yee6+XQW0A4/f4ycok3RhyYB1syWNO03dg8anlUYgCRlEm4MoABdsgs+wdzqqbB4aj3+V4A9uIMQV9eQwqNF8pIvH3ZyC9BuQvUZRrUaKG+Yi/I8TP9GoTelJPnz7vQWCgFlkezPGmIyiIL5ZwJ98OxH4whfUsWCA5fcnl/4cfuZ4vdW7eNEA6WXNvb1GU0s2MCBMJBLR5VCBHiEshg3b5vxOSsmdLzbCclhrmdGUgdOJ5dIZvemWMWTVCWD/ic1KAoIZ+Vl7mZa/M7CKroFV2oz9Unim3qDVekW3RTwGMe4RXRl5FfGaC06+4aM8JiUDrKWp/lFQrKPOFLA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 22 Feb 2022 17:18:51 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%7]) with mapi id 15.20.5017.022; Tue, 22 Feb 2022 17:18:51 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, danieller@nvidia.com, vadimp@nvidia.com, Ido Schimmel Subject: [PATCH net-next 12/12] mlxsw: core: Add support for OSFP transceiver modules Date: Tue, 22 Feb 2022 19:17:03 +0200 Message-Id: <20220222171703.499645-13-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220222171703.499645-1-idosch@nvidia.com> References: <20220222171703.499645-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0101CA0047.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::15) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c06cda21-0c44-4a3c-a07e-08d9f627655a X-MS-TrafficTypeDiagnostic: CH2PR12MB4262:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AbyVgER0BklPpgxbEPWtYXn9d6bEqplAuCxGiR9l+tMQdQwk04n9+7YEn8s1IbYrDr/uT5xAkQzkvL5wcf78Rjx4tMjLvouaDZoAzooLbS1Dp3qYqBrHmvs3Wblt8h9YUP4PgwCv/ebe5Ob86fhdiB+TASVkjTTuRO3hYKEVDhFN3aJSCw17qSq0JSBUGBqRXk5rHdOWmTGV7cSiMHS0mDcThSCiPj6H52kFs7py6sYSWotFsd1X6z4pAb3XZ6fiqnB+fekTqf5uPY81nZ7jvQY0AqZCmvg8IlnvER7LUSVQlfQ8xyukeEd1Uy3DYCWuDJKmZA7z6kpEbYYNQUBbgak1JFJUZ7k/C6GbCpnJSvpQMazAHO3NOlCNpOmabOvvS2TpxfManLkFK3ZRKZQyoiFVS6jor1bRP8+LVWTd0PESw1O77zBzxD9zgr4LiTzU3jQV4kzmcIDvX4ZKBdzLJL8qa4KwmKujEd/qhgG8rQmtjrSiiAANOPodwutH+HMKiknC35EF9fAky3AcsTxJT+5gEcO0WxFo64Gm1YOVyK4AuNSKQcloxjMPdoMAA5CNHIfluj5RwCCH5lGNKMlxx6Kfrdnt9IIdUsjrpdr+N7wLzEYuhhxOwjnmxeY8iYqA9ZbvyoSuk7wqc94fA6REOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(66556008)(6916009)(66476007)(83380400001)(508600001)(4326008)(36756003)(8676002)(6666004)(6506007)(6486002)(5660300002)(186003)(107886003)(26005)(1076003)(86362001)(316002)(2906002)(8936002)(38100700002)(2616005)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MpZUsGW99XeCGcN/7rwjt6tuMmquZCXbCHY0f3Lr9XxiQPfc57AquxeCg+ODGeRg8xyFz3JmCGaFAnvB5uKGsVgS5IsviATi/xDIv3UGGV0Vwy3nx3JACDkuJFfmrwcnmQjsgVFUxHLCU8NUsARnTcunQXEN9SZLO9Ov29Iyq77x88bLXVSrPhSrZM7B1k4TQ8XZVqEcTAcJVKKhG/aJCoxwOlJQ5ghy42d7GBn+cf2ldnP+Zby6rOcbEOOjAciW2KmwTKZ5P240RpniG5rO2su+xWacxzuV3+Z8iWIkw877zibJQCCUh8VDCThCAHCY9P1a/ZDZRwl3rAdOWjzvXNADSXoGvDlhVVynOeNQxalQOzTgzkv7+yA8kZWsXoXPuMKK3CGDgfoox4YTH7CWNSgW4CUuogpzcZ6WdruE6f4FuYp77YdIycfX6uclUa49UA+tc/UoGyZT09ouUO/vcH9+NAjTq1+jUvG4rwL9FJDe5BOOooTYmq32W3GyUyLT/AkjPJiMyJQvzUCQhVCGGznu1pLyAlVKOf/UKNyR8x+AUIpVLZEU36qauMz71UWKEOS2qTsfzLayC4o2vgZyq/EoojwCWDZqfeZV1DnEzi3fEYDJXcpnmq6y92LgTamWd5qoCI8aIlZDe15c0GE94KzdviDC2VS6/uzUXtTLq9hObtneMJHdCTJEBYu28+5dFn3pW+QS1Tx/0zuzqNM1pPbzxAGmfTnaHIo1nKGWn66hL5FcfIbMMs/MJ0cFnJT+Bv6fimYAzrL0OdMsyHYHsifHI0oq41xl9ua2dlJntx5S4jaVAZCjDPGo6EKxaRH74ft6bt+AQULxqA+mZKMDtldCfOYFP1/b2WluwQQwWuUUToSDZAeIhgN6Nws2OVB2vZYXGQ/HrXjwE+UameFReqPlumUQZ4P3q8R8hCNIY727jL/bTdXvEzxTSa9stXs137j3NHwOvEo0Zbai/XD/WC4RaUPBHhePMxQnkQKp/JU7bZKeaR6zFaKBzHHySvBSma3N98+HIkNh3hGqhu8J3wrWcQ5GDbg/Vys+7Dgq8tUT7SHZX1hAJYT4Hj2cmG7ZTRpc0G0Ly0Y2BwO5Mx/8uTQX3Fo87RAgnW1nDWLa53N/9E3SAWEATx36c9bPFoQW8Td+myXJo26sjtF9RS7G8yOUq3v+20EbQlg+I61oJW8EwNP1io5PeeGWLpkgKsYOwjE61FVJtY+zG6W9zhjDaTCloReP8/jY4qLrOwyL9wvG/awrA0bcDADOcV2MifNIrlFoBIHOqEkeMv3sSEMx5P31KD7OfH7SHAlSKZn90xnbgnkJEPMtpGhpcmW7MlAM46ELqNxfCEwZmIjyoyzen7jL3+ETRJqIRneMZcLhLLkqTgtrrO77UqDkBDgUNrw8nbNQfYYBRIMsKQ8ktrrtqRItAtPc9LT2Yn0p/RDF4vDOsm+8aTxKyWLQNyjotEWohRRhLHe1imlG11tRE/jxPigBstGh4OaEk0wVeZzWwLKcv3MsjU6qvYbJmeRP4ACLSxz7AC0sr0FaezGh8V/l/jpvZvoFa4Bg+tSbxO9fbZeDF9rXRrvEoeAipPgLd7CcK/fMBpYXaSYfOPLr2+Ef6uh0WE0tQRsVav+s69NXRYw= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c06cda21-0c44-4a3c-a07e-08d9f627655a X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 17:18:51.5324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HYCUzpSNp2ULWhgEUbc/sY+YKD85jfbpJlDIRtc6yo3l6gnhfo98jrUm7eq9jDoZZqkXQHbOjydozp6VZ5ZwNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Danielle Ratson The driver can already dump the EEPROM contents of QSFP-DD transceiver modules via its ethtool_ops::get_module_info() and ethtool_ops::get_module_eeprom() callbacks. Add support for OSFP transceiver modules by adding their SFF-8024 Identifier Value (0x19). This is required for future NVIDIA Spectrum-4 based systems that will be equipped with OSFP transceivers. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 ++ drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c index 70e283d22783..29a74b8bd5b5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -87,6 +87,7 @@ mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, bool *qsfp, *qsfp = true; break; case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD: + case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP: *qsfp = true; *cmis = true; break; @@ -303,6 +304,7 @@ int mlxsw_env_get_module_info(struct net_device *netdev, modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN / 2; break; case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD: + case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP: /* Use SFF_8636 as base type. ethtool should recognize specific * type through the identifier value. */ diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index 1f0ddb8458a0..dce21daaf330 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -10037,6 +10037,7 @@ enum mlxsw_reg_mcia_eeprom_module_info_id { MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_PLUS = 0x0D, MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP28 = 0x11, MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD = 0x18, + MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP = 0x19, }; enum mlxsw_reg_mcia_eeprom_module_info {