From patchwork Wed Apr 13 15:17:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12812124 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 AD179C4332F for ; Wed, 13 Apr 2022 15:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236366AbiDMPVc (ORCPT ); Wed, 13 Apr 2022 11:21:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbiDMPVa (ORCPT ); Wed, 13 Apr 2022 11:21:30 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2088.outbound.protection.outlook.com [40.107.243.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DAC439B80 for ; Wed, 13 Apr 2022 08:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nj43vggwSD3rjmJsc2nvcuxZ1DwQMiSmj+fUmbO077snA++QHtEG09TBHzFFv+qTawkxG1/SzdU+nLuhjAnhwJHftXa71xmx+Om982+GEQMsIcwvsi/hTNJ5o5mtmc6I0LYuP+Uz1xF2J8A721eY903cMrLzJFvl+QHFB9dmQSIsvS9/JH8lvVm2QKeo96wmIms+yq+/5UpMQvwowGL+33+cOCA4Rfr+cLavroGTTp2cSDJACum4pnS+S33l+C12sfYnrFq2fnXBdwJd4HyVzFM9+mXsp6jxxifM1XNwkMO09UkZomUJQZSfhOv/uRMR/bKKxI1ykJDpGg64Jy5Vrw== 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=bELZQPi3CxouDaEj3ffFIRf7ZoRdABasrG9GhfqIryQ=; b=mfVMsrZkY9EO/HUB8+2H3O0/+9ofkeBwju1ItOwkbyIYkf6cJfqyzOxcLCjj1zBD4dx3sULtkOcDx3q3D1sw/DOxTP1AU2MVZvdpcTOrIxdtQLD7NHYZQFqtqN8KU3bisXzxtgXVcwDgNIzz+hIMXXzgEPP+4/HYK8cTQpnmQyp6c/RmC8VH/H8qzLaCTkLdeCf3FI21XJ1VJxHKcjz9e0aF2di8byPl1le4sZkTwtaSqnrS4SIbrEM23kIArXNKp/CEG5oP2jKmnehWLVEGabs9JOVWhmm49LOehel84QuzAtPEW59SyU5F7LSZRzChKUPtuQnG782xGBVXy/qFOg== 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=bELZQPi3CxouDaEj3ffFIRf7ZoRdABasrG9GhfqIryQ=; b=apIBL0QcO37U990IfWf6vXWYtWmfxefCJBroLG3sPbFoX/D9Ta/U0twojZN8wfcKZZ2nte/KNW64vWcEn/E2FMGj70nntkbzzHDPIqiBo8GQk1XdxKqz3wr/oq8Et1Cla+pffOEiYuy6kly7F9XSpFhhP+yNU0HACN+eMSHJco7j9aFOmjz+6kjmRwkaGYyAvpyBBKFKuI4CRIZlNjJtSNYqmWpU7YLiTWPRsz+cn8kJY3g7Q2hQS1VIxtnCmFpGVHpLrYfKQx3xJhqRJctbvAJvOYDamGbw2jk1BNxZG1OyVghGQ5haG3SxB6CIkFRRav6BLb5+igIn6fR9hv5eKw== 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 MN2PR12MB3885.namprd12.prod.outlook.com (2603:10b6:208:16c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Wed, 13 Apr 2022 15:19:01 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::6131:18cc:19ae:2402]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::6131:18cc:19ae:2402%5]) with mapi id 15.20.5144.029; Wed, 13 Apr 2022 15:19:01 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, petrm@nvidia.com, vadimp@nvidia.com, jiri@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 8/9] mlxsw: core_thermal: Use exact name of cooling devices for binding Date: Wed, 13 Apr 2022 18:17:32 +0300 Message-Id: <20220413151733.2738867-9-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220413151733.2738867-1-idosch@nvidia.com> References: <20220413151733.2738867-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR07CA0252.eurprd07.prod.outlook.com (2603:10a6:803:b4::19) 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: 44360c7a-4a60-40e6-979a-08da1d60f069 X-MS-TrafficTypeDiagnostic: MN2PR12MB3885: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: nFi4xYnaG7JxcSb8JBLuDea+DzJzeIPGlrqO4OK63jegH1lYoloxZA2AdESw5le3gwCq2sJcnrzzvg0SaejTXxYQ9zKAOqNlJRcErHGDVR7SSv14nKCKA3hnE+o0Va0CQuEajlGE/U2iRG+454HC4tGObkpsVKqfyg0TiWTN0Ll+nmVhq+XQj9BzipVFv2kTZ9NGtd7L6QmOkuGMB8YieD4JP9EjD83OpKYPr1uHGML39GCy8rxurMoWs7NUBVPv5OLQXZbOf/u+LJNktTPRsgs9HhQC6740l/Mx9+cX4qG6uRtH8UR37HUGT24Y1+JvM24vAyyv3clZ/jqLdKTf2Qe79LqaqEuGEG110s/NN8Pk1goC2oc5RWUmV4kljNej9mkX8htp80lfkRTMz1S+SFOKy/vHM+VOFGKrqaQ7clq4LUDRw1zguNNGAjzKh0JKCj7JmVdff6hQHE7smOQjBlDesWGidJ3ILM44ahx/+FO7x1F2ZLPCbe/RAhr2XojNJIDAaY3lToFjWIfouMLe4g6vfzI2q/4LF/272ZEWuu3/bwankmyRaCSlgVfiIEgpdOHfg+zWe2UBcx4Egzg286Y+ih0v1P6EiIaE1/dE7iSTp2z2QBjPodYjlsjrN0i/aWEAGZ9g8PWMcDmQbi+Rpw== 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)(6486002)(66556008)(66946007)(36756003)(2906002)(316002)(6916009)(4326008)(8676002)(83380400001)(86362001)(508600001)(38100700002)(5660300002)(8936002)(26005)(6506007)(186003)(6666004)(2616005)(107886003)(6512007)(1076003)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qSIGnNaNLJZkyjErFj3YqhMEAFLQNISITaSST+n1T6V60ap5YB+S3zhnBnpb+vm072L2ANV3Flxp8OW9nlATt1uRP1N5Tb03GlxB/nt+l6m0hR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V4LhtishDqnPfNvSM11S6Zgi+PWT2ueSxJbCSblOd39f6a+U6+PKT+U6Fg76qYNr6DNG5WJgsd6fYPXAykeZGw3rlSv51YlFsu3Q7TG29wTYgvG8cY2aLK97GOW0pNSRpYgmEU4zVyLx7MlZGTzRgmzEXBbT5ri772EtqU9F5v22CAG+Ho7er7O5FtUkDmQ6Ch3vWDWDXc3D/sxlxPy6Jyp8DF/pXPrkAZ2P6eAgHRAHTSEXROb00szVqCg7Qg2Dr2ExJ+XAw+Ur3RcCcBhK+VPim8KSwo5ogXc7YHWv6qN1h8v6JxkRQNarU+kpUAMkXOieKTd3RzCVl31gFE6Q0cai6QHmy7dp9/FcsD23jW/VVrde7iVxA8kPqjyVkqXo8+GuNsHkFXcQqb0yrbyRbha6DM1Vk3GjtLOWrEf6tnvWod5CjY2os2eQIkzV6ENqvgysyoQpCevQUMNP3Y1ZTqUdjLaHKlduwR6Q3UsuhmEQgYadcRJGyEmWTeNlYsnzbuIpvSTqTW4us8o7xhs4qndUFFphLsYMFWa4JovtWmg8mI0kiDKr8Sg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44360c7a-4a60-40e6-979a-08da1d60f069 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2022 15:19:01.4801 (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: 3TWm7R/rEGuu4+MgioRpfT1FDlvI3DNPFfhuIH2IYWWRxxgBt8/osMpzdO7uKSQ38u14lmOaCzTcMULJ/WqFvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3885 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Modular system supports additional cooling devices "mlxreg_fan1", "mlxreg_fan2", etcetera. Thermal zones in "mlxsw" driver should be bound to the same device as before called "mlxreg_fan". Used exact match for cooling device name to avoid binding to new additional cooling devices. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 23ff214367d3..49ea32457703 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -129,8 +129,7 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal, /* Allow mlxsw thermal zone binding to an external cooling device */ for (i = 0; i < ARRAY_SIZE(mlxsw_thermal_external_allowed_cdev); i++) { - if (strnstr(cdev->type, mlxsw_thermal_external_allowed_cdev[i], - strlen(cdev->type))) + if (!strcmp(cdev->type, mlxsw_thermal_external_allowed_cdev[i])) return 0; }