Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1176052lqb; Thu, 30 May 2024 02:34:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVA+RVq2z4wu2+Aq6MV0OF6KAKhhTyAHqQ6Ye7xgor4tausVG9i+me+9TnkJUXw1OgXbGTCvu9WtRrtPQJxCGZcLqjecOHe+ikyTysmig== X-Google-Smtp-Source: AGHT+IEgKNOz6qIY9fRbPyldlRwFi5vy4twc43785WenptaUVeMVT++jUEu/E7OhnfaI0IZRatUc X-Received: by 2002:a19:7404:0:b0:523:ae99:b333 with SMTP id 2adb3069b0e04-52b7d4b1aacmr1091739e87.64.1717061642134; Thu, 30 May 2024 02:34:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717061642; cv=pass; d=google.com; s=arc-20160816; b=cZeaIu0bN8vmdSMAvYOstrL46a9/K9AHYeXI1ZGdGYqldsiKwOqNdE7zfM53yE3Z6E UJ8L6BqtX1+4UoM9mx8mjBrBiT2LGqHNEqP30XwAtOpRvCDf7F7XO6hUAvvmQrfQJeyw 8xiRNNH23JOZ9mv4Jr3Jg/NTVHPvZafnm875wZCpCqZWgpKRJdQjfBwIgEuG2Q4NYnI4 zMaYg69ZzHLSAX4FD5f+/qFJoqQka8HHuI6Y5zp5ie4/xesdxoDLJZGB26ugRwwacTZb 7dagvqLvcUzjW88ogFBM5irRWnzghijec91DBfcUTf7IBK729EG+KlhBKJfvpoI0Pk2t HnWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=kktmPQ8UkkibGHep0ZYqlFfuJ4jZwmWmpyZWosFkVgE=; fh=s9pKPlPVuD9W9s7EsDAIwuic7grQ52y3R7CapIk4w+Q=; b=SK4tX7rMvfs4QFe9u4IEGKZCM6MaHjg70fcsChKd/mrXLTyDiZ7BRifDUn8qFomUvw ew97reSPM/nugyD0u6elMUWNA2Q3A/TRiwlH/fk7bVgNDnIhKBSgPHg6lZrTQ1DQ6T/u 1HBn39QjJRBm4crze9I7ex4sXP8wKcz7iBiZTuw+sDU2c8WmW500adXg95ma0uTM3yd9 LmbIDuo/SvSjFeU+EXWZ2o38MTGLd7UPZTDhk3WTdkuvhaQ/wrQx6T//ZR0DwiHYTEr2 zNic6Y2hTMLcipAWrxcwKyB/rki02a8m5VJQH+O2S0L2YIlvLIInL3vANqBzeVFUcfiB lUDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ehny38kh; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-195183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a64a884f153si187843166b.711.2024.05.30.02.34.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 02:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ehny38kh; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-195183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BD3891F2402B for ; Thu, 30 May 2024 09:34:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 568E56F316; Thu, 30 May 2024 09:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ehny38kh" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B172F145B38; Thu, 30 May 2024 09:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717061633; cv=none; b=Lc3c/99xJl1rF9IRUMLpXlTTMpEywj+ZzrlTf40uqilK/cwX0hEN6bW970CVfPA0sriPrV63+HNYAM1JnJLSC4N4tikEc0G6Qye5s/CcKWU7LdLtc+3mQLNbWAPUK0kSA6JsLSVfQkfBzB9JYjeU2RLdtXMO/SfbXyp9Y4pmdMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717061633; c=relaxed/simple; bh=hgS8VKpsnoGNLurT4aSMHtModguZRSzXJGIC1bs3hLI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BkygzkwfF/A08oinBjwTcIL/81zQtKiRQXJ160RXByvGJ/KJsqW7NGm3DVw1ol9rSi8acTTCF5ouHzJ9xssDWqN/txLwtrMWLg6YXa2AXa4uZbvlroa4d8+6G0qfjKRB/YXsygnTHItxNg7rhj/tjxnC2jnSfJrLo2KE12NY59U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ehny38kh; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 374851C0008; Thu, 30 May 2024 09:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1717061623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kktmPQ8UkkibGHep0ZYqlFfuJ4jZwmWmpyZWosFkVgE=; b=ehny38khWiMM/cdQIjCq5EdFThIKnQV0uDrKL7hQ6hmZ5J71NpyH6j70jotn2ksxlvkUun KRmrwSg7CFPUTeFkpgTqvp3TF2r6Ru76YG3PFF23C+xQNxUrjZBAuahI4dBSI2TDi5ZufU k1ZUJwgjJVVNz2g5kQzFBnFUiGmTp1DRoOYhdcvOdLj4MTqK8DQ30zlJ0lUk7V3OqmAx3b /dI4al/oUlohRi/TpVMLUVse5v1W4K+l6pNy2if4c58F5SnA4GZaPqytj1dqG1PY7M6IW5 4M/LFuCVeoJkUj3QzjOIgQopKaOqbceKNIpKT88YMcXptK83h/mL4KTYwOuGOw== Date: Thu, 30 May 2024 11:33:41 +0200 From: Kory Maincent To: Andrew Lunn Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Oleksij Rempel , Thomas Petazzoni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dent Project , kernel@pengutronix.de Subject: Re: [PATCH 4/8] net: pse-pd: pd692x0: Expand ethtool status message Message-ID: <20240530113341.36865f09@kmaincent-XPS-13-7390> In-Reply-To: References: <20240529-feature_poe_power_cap-v1-0-0c4b1d5953b8@bootlin.com> <20240529-feature_poe_power_cap-v1-4-0c4b1d5953b8@bootlin.com> Organization: bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com Thanks for the review! On Thu, 30 May 2024 01:13:59 +0200 Andrew Lunn wrote: > > +static const struct pd692x0_status_msg pd692x0_status_msg_list[] =3D { > > + {.id =3D 0x06, .msg =3D "Port is off: Main supply voltage is high."}, > > + {.id =3D 0x07, .msg =3D "Port is off: Main supply voltage is low."}, > > + {.id =3D 0x08, .msg =3D "Port is off: Disable all ports pin is > > active."}, > > + {.id =3D 0x0C, .msg =3D "Port is off: Non-existing port number."}, > > + {.id =3D 0x11, .msg =3D "Port is yet undefined."}, > > + {.id =3D 0x12, .msg =3D "Port is off: Internal hardware fault."}, > > + {.id =3D 0x1A, .msg =3D "Port is off: User setting."}, > > + {.id =3D 0x1B, .msg =3D "Port is off: Detection is in process."}, > > + {.id =3D 0x1C, .msg =3D "Port is off: Non-802.3AF/AT powered device."= }, > > + {.id =3D 0x1E, .msg =3D "Port is off: Underload state."}, > > + {.id =3D 0x1F, .msg =3D "Port is off: Overload state."}, > > + {.id =3D 0x20, .msg =3D "Port is off: Power budget exceeded."}, > > + {.id =3D 0x21, .msg =3D "Port is off: Internal hardware routing > > error."}, > > + {.id =3D 0x22, .msg =3D "Port is off: Configuration change."}, > > + {.id =3D 0x24, .msg =3D "Port is off: Voltage injection into the > > port."}, > > + {.id =3D 0x25, .msg =3D "Port is off: Improper Capacitor Detection"}, > > + {.id =3D 0x26, .msg =3D "Port is off: Discharged load."}, =20 >=20 > I don't know of any other driver returning strings like this. Have you > seen any other PSE driver with anything similar? We would like to be able to return the failure reason but there is nothing generic in the IEEE 802.3 standard to be able to add it to the UAPI. The TI controller has SUPPLY and FAULT EVENT Register which could report few messages. I am not aware of other PoE controller and how they deal with it. We could add sysfs for reporting the status messages for all the ports but I don't think it is a better idea. > > + {.id =3D 0x34, .msg =3D "Port is off: Short condition."}, > > + {.id =3D 0x35, .msg =3D "Port is off: Over temperature at the port."}, > > + {.id =3D 0x36, .msg =3D "Port is off: Device is too hot."}, > > + {.id =3D 0x37, .msg =3D "Unknown device port status."}, > > + {.id =3D 0x3C, .msg =3D "Power Management-Static."}, > > + {.id =3D 0x3D, .msg =3D "Power Management-Static\u2014OVL."}, =20 >=20 > Is there something going on with UTF here? the \u2014 ? Some copy paste of the messages bring a non utf-8 character :/ Will fix it, thanks for spotting it. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com