From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C925CC282C2 for ; Wed, 13 Feb 2019 11:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89942222BB for ; Wed, 13 Feb 2019 11:28:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="izwa68V+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391893AbfBML2s (ORCPT ); Wed, 13 Feb 2019 06:28:48 -0500 Received: from mail-eopbgr150041.outbound.protection.outlook.com ([40.107.15.41]:45056 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727977AbfBML2r (ORCPT ); Wed, 13 Feb 2019 06:28:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o/4VTJrEVPG1480ZrGSF6DbfLB2YlQvudbLunxjrN90=; b=izwa68V+VHKyqdXf/+57ZLso5bavCQAugrh8k4cjgs8KnEGVv7dy3gS3AmQ35VN0Somtb6fXYBUj7kJpugmCr1X9KjCxH3HX4bM0WexLmBAtHGypsO+x/69rqLVbeKDRe9s0psEFSV8wun+fJyV8cEAd9RHxdkel56eXSkPtGrU= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB6230.eurprd05.prod.outlook.com (20.178.95.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 11:28:43 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866%5]) with mapi id 15.20.1601.023; Wed, 13 Feb 2019 11:28:43 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , "andrew@lunn.ch" , mlxsw , Ido Schimmel Subject: [PATCH net-next 00/12] mlxsw: hwmon and thermal extensions Thread-Topic: [PATCH net-next 00/12] mlxsw: hwmon and thermal extensions Thread-Index: AQHUw49GG4HtjbPdKEeyzChiMrS4KQ== Date: Wed, 13 Feb 2019 11:28:43 +0000 Message-ID: <20190213112814.32334-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LNXP265CA0090.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::30) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7c9382a4-90f2-4d3d-383d-08d691a668fb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB6230; x-ms-traffictypediagnostic: AM6PR05MB6230: x-microsoft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qUl+YeP1s38O58sBYMHFnzpACD3bR0fodMS6Abbp?= =?iso-8859-1?Q?2CYEucHyRJS32t5CaKLNy5U845d11UKGOpeKJ1KcRwNUM8umhkY2Fj3s4P?= =?iso-8859-1?Q?hyFA7NSEzt0mtlNpp5V2QgGRMUZidqWjSSOfrKP97rTeK/3I0uuXHTkK4Q?= =?iso-8859-1?Q?KzS+m4zbjyMftqPMCau68y4PJIvPVfNSXWB11WGlXmqEKd+dt3jBM5SSdW?= =?iso-8859-1?Q?VFg+Z/69vQ0wm36gF8It3S8OfwzQ7BGBLUiqwGIh1p8KmXImy7k2uFaXcH?= =?iso-8859-1?Q?zf6eDjhzpdIIh/AGH2hoV8cavF/BGxu4+HnKqhbM/niofJf6NIXhu2vuMl?= =?iso-8859-1?Q?6oR65rsZRur2uxwpKTs+sCQ0k0WSRTIlloaCVUMMbVPiFa4EzTTFMlbR5j?= =?iso-8859-1?Q?jRXJej+MWooMpVmvWIcxI/HrEXKeiznS01cQvTQ=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 094700CA91 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(366004)(396003)(346002)(136003)(39860400002)(189003)(199004)(26005)(186003)(386003)(6506007)(2616005)(476003)(102836004)(486006)(2906002)(8936002)(106356001)(105586002)(71200400001)(2351001)(71190400001)(50226002)(97736004)(81166006)(8676002)(1730700003)(81156014)(6916009)(305945005)(7736002)(14454004)(478600001)(6116002)(3846002)(86362001)(2501003)(66066001)(256004)(68736007)(107886003)(53936002)(6436002)(6512007)(1076003)(36756003)(25786009)(54906003)(316002)(6486002)(4326008)(5640700003)(99286004)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB6230;H:AM6PR05MB5240.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +/g4zvKcUvkTuZGpvEoQbnGTJDWA4M1rzp/cNG8vc64Ne3J6GtJUodivxPMpCtQb6j9Ajxidw0Qlj28oX0VyhDT8/vxqQWczn6iSiZV8dK3WDA4YmVWypPqL1KRw1ufqgVbKKpC3GBGkNy0PkcIISLAoWWH2fWUbuxGnS1nFlTGGcrWHiDAo4vQ6bl4kJ4/Gz1L5omyVZahhwvy4er19p0TejDvlLSI3oyc2icdR7ji2Z4zm1a+4XLJ6xkllhY/8qzlQcNSNA1B9ddKhg9JslAYyt02gf5oaYJ+bOxnzFfP22l68Xn+A1ccMhn10i7E09MOOS81ap7fdhsGou4n8/vjNsl4frHQ0FNlE8GuX1X40zFHbrGf7tO2LMtEkbCeDwMpswiX6jhJOYNBICLoP0aLXzLx8vK5iKYI8VE9V5jg= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c9382a4-90f2-4d3d-383d-08d691a668fb X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2019 11:28:42.5702 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6230 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Vadim says: This patchset contains various improvements to hwmon and thermal code in mlxsw. The most significant improvement is the ability to read modules' temperature attributes (input, fault, critical and emergency thresholds) as well as fans' fault indication. These new attributes will improve the ability to monitor the system. Patches #1-#4 add the necessary device registers and APIs to read modules' temperature attributes and fans' fault indication. Patches #5-#8 perform small improvements in hwmon and thermal code such as using a more indicative name for cooling devices. Patch #9 exposes fans' fault indication via hwmon. Patch #10 exposes modules' temperature attributes via hwmon. Patch #11 adds an hwmon label to modules' temperature sensor. This helps to parse the output of utilities such as "sensors". Patch #12 allows to bind an external cooling device ("mlxreg-fan") to mlxsw thermal zone. This will allow the mlxsw thermal zone to change the cooling level of cooling devices not programmed via switch registers. Vadim Pasternak (12): mlxsw: spectrum: Move QSFP EEPROM definitions to common location mlxsw: reg: Add Management Temperature Bulk Register mlxsw: reg: Add Fan Out of Range Event Register mlxsw: core: Add API for QSFP module temperature thresholds reading mlxsw: core: Set different thermal polling time based on bus frequency capability mlxsw: core: Modify thermal zone definition mlxsw: core: Replace thermal temperature trips with defines mlxsw: core: Rename cooling device mlxsw: core: Extend hwmon interface with fan fault attribute mlxsw: core: Extend hwmon interface with QSFP module temperature attributes mlxsw: core: Add QSFP module temperature label attribute to hwmon mlxsw: core: Allow thermal zone binding to an external cooling device drivers/net/ethernet/mellanox/mlxsw/Makefile | 2 +- drivers/net/ethernet/mellanox/mlxsw/core.h | 1 + .../net/ethernet/mellanox/mlxsw/core_env.c | 117 ++++++++ .../net/ethernet/mellanox/mlxsw/core_env.h | 10 + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 275 +++++++++++++++++- .../ethernet/mellanox/mlxsw/core_thermal.c | 77 +++-- drivers/net/ethernet/mellanox/mlxsw/i2c.c | 1 + drivers/net/ethernet/mellanox/mlxsw/reg.h | 137 ++++++++- .../net/ethernet/mellanox/mlxsw/spectrum.c | 62 ++-- 9 files changed, 617 insertions(+), 65 deletions(-) create mode 100644 drivers/net/ethernet/mellanox/mlxsw/core_env.c create mode 100644 drivers/net/ethernet/mellanox/mlxsw/core_env.h --=20 2.20.1