Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp389272lqg; Fri, 1 Mar 2024 08:10:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXxkSCaU7AcF8pSSxL1itnkJurz6+GqUR5vgyLmKLGYX8eGsCvDwOtwXa+47zmZcl6WWrSC20jJslSlKCKdYQLOm1Pik0RjaG/Axu5zTg== X-Google-Smtp-Source: AGHT+IG0iVsNmaHLIyWKD2uBz9lGH5XuJi192j87+upOSAVNQ+Ds6jDRMfuOghe0J61GZlxof7IK X-Received: by 2002:a05:6a20:9183:b0:1a0:ce99:9ac6 with SMTP id v3-20020a056a20918300b001a0ce999ac6mr2752041pzd.26.1709309423930; Fri, 01 Mar 2024 08:10:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709309423; cv=pass; d=google.com; s=arc-20160816; b=alTD6tMwGDOBWO9jikG6rerWYOxzNZ8UhMst0iftPQ6cNsQLKVM3IevApj5cBLYyfy Ou2Qxpgdnsr9oSUFJ1/sgDVGu2XxVCDRAS0sp8q3FPdT/T1ECi4KoiSmTddVHlIkXjcM k4d8aH+1BM0A2QBubgg7i2UTrm06BvlLC2al526owZH1XJlhDJiXXUGZ0vCrlHLL4uce QqqXYUOLwP6v4jWZlZWYao2/KgCiO7RQmZPVfpoWpAnc49g8IZLo9iqWTeBrsg/gZ0S2 qPhAzLdoF+59nFmbQ1g17Ja0IHJiz2a/WxfsJf8/gOgukdbShG/X94/QIKRve+jyTBuH xwFw== 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=7Y/1rcI5WNB1I1M/cu+SE5UCu5kGQ0fc3QK9NH0VpIo=; fh=5/fkld+zcf/XuSy0V3t++3lCdQF6MsgduU+DVU86hTU=; b=RDrBe3rukvw9bQ6+YNoF6iDuJnBOoXfnwBSQdJyuDkIy22/07yaHJHXmOMDEGierP8 RZw9C0X8Xx2K/bJ4xK5tU3DU3VAy93MU6iqsH/VwMCJe+sfvOrwAbWezMwhv7Ck1wz94 8IucFSpFBfKeOcFRAADo+VkxNR+/P21f0Hc9H8Xp0eGDOHltratWQtxPJ2ITN3hhTkqU Ui2kSR65PiBOkCIPgAY53qWGP1TdgkxetZjRCqVBgwYvAyNGQVkdf+CPazqKbDBVWqy3 X9Er05Fqzk24BoH3rsTUST4AEWwCyG7++bmu0ogeH8UwqdFWwpOmuUqiBOYVaHL3XhGA Gg1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Pbva1Ex4; 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-88668-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j10-20020a056a00234a00b006e05cb39617si3896808pfj.116.2024.03.01.08.10.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 08:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88668-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Pbva1Ex4; 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-88668-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88668-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C010282050 for ; Fri, 1 Mar 2024 16:10:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E7AB70CC5; Fri, 1 Mar 2024 16:10:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Pbva1Ex4" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 C41E941C7A; Fri, 1 Mar 2024 16:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709309413; cv=none; b=jnC3xb1aGJJHHRUh9EaRqYP/abv4+8D+r3HSiFamID3x8E95ssWu6e9CVAWQXo/71dnqhD+Uv0UjgnGkrFrNuNxCZoJlQbAzLwc3snLML/QC5TvAu2FkA+amdlXTqH5IJiLCv/MULxBuUFTnn/ENQc+eLoKp2bS+QwmVwq7dBnM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709309413; c=relaxed/simple; bh=ZfWPAHRMQ4AV1/EmBLZZvxi+ZiKHtDAYbU0vxjHvS+Q=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iYVRmzOmebzyS4EUjH4tzfU3RlPkSqQQk0wRXrlBdW2inVp/AOt6C8LLO3kmhMdix7EOLdNmXcLfTJBid1eMK/ogaNNrK2bBCRC8WUgaj0QMHdNUEbiHo4uI8D0f2YKlI6+9LpaIBOcqlbco1ArxIcduQmF51gsDC+F/wZYzezU= 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=Pbva1Ex4; arc=none smtp.client-ip=217.70.183.200 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 116C620008; Fri, 1 Mar 2024 16:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709309408; 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=7Y/1rcI5WNB1I1M/cu+SE5UCu5kGQ0fc3QK9NH0VpIo=; b=Pbva1Ex4/Wg84CrwIHwBfQh1USib/V/EEcBXecMJuMXt7tVkm1STF5m+fqMDRtGu/ysDbc tuzEbouoCe5W2iDBywLAuOMaj6d+b5hsFyMJW731CcttscM3uXPKcKTy9mEqRTY3c1A8IW lswFTLcOod9Cwy9OYwEmmF5m+8iOxd0yAGCKnhXmb/au1eDyHvGisDwsqlvapDFtTeZ0dJ drn3E7U7sPKY0VO0jdLiqdzH3oxZ9Dt1M9MQ6D2Da+uz+VvWYNU/hninzYICa9ulnyiWBb WabfSaCHltjbwwxg5uQGxRlk3ijBuDGHxv0zhoVN18B63gENMr6BeE1cKCVmPw== Date: Fri, 1 Mar 2024 17:10:05 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Oleksij Rempel Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Brown , Frank Rowand , Andrew Lunn , Heiner Kallweit , Russell King , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project Subject: Re: [PATCH net-next v5 10/17] net: pse-pd: Add support for PSE PIs Message-ID: <20240301171005.43188d02@kmaincent-XPS-13-7390> In-Reply-To: References: <20240227-feature_poe-v5-0-28f0aa48246d@bootlin.com> <20240227-feature_poe-v5-10-28f0aa48246d@bootlin.com> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; 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 Hello Oleskij, Thanks you for the review. On Fri, 1 Mar 2024 15:24:07 +0100 Oleksij Rempel wrote: > > -static int of_pse_simple_xlate(struct pse_controller_dev *pcdev, > > - const struct of_phandle_args *pse_spec) > > +static int of_load_pse_pis(struct pse_controller_dev *pcdev) > > { > > - if (pse_spec->args[0] >=3D pcdev->nr_lines) > > - return -EINVAL; > > + struct device_node *np =3D pcdev->dev->of_node; > > + struct device_node *node, *pis; > > + int ret, i; > > =20 > > - return pse_spec->args[0]; > > + if (!np) > > + return -ENODEV; > > + > > + pcdev->pi =3D kcalloc(pcdev->nr_lines, sizeof(*pcdev->pi), > > GFP_KERNEL); > > + if (!pcdev->pi) > > + return -ENOMEM; > > + > > + pis =3D of_get_child_by_name(np, "pse-pis"); > > + if (!pis) { =20 >=20 > Do we need to allocate pcdev->pi if there are no pse-pis? In fact it is not needed in this patch but in the patch 13 which use regula= tor framework, as the regulator is described on each pi structure. I will update them accordingly. > > + /* Legacy OF description of PSE PIs */ > > + pcdev->of_legacy =3D true; =20 >=20 > It is not "legacy" :) PoDL do not providing definition of PSE PI since th= ere > is only one pair. May be: single_pair, no_pse_pi or any other idea. You right it is not needed for PoDL. Maybe no_pse_pi is better according to= the following thoughts. Just wondering, how a pse controller that support PoE and PoDL simultaneous= ly would be exposed in the binding. In that case I suppose all the PIs (PoE and PoDL) need to use the pse-pi subnode. Then the "alternative pinout" and "polarity" parameter would not be requested for PoDL PIs. > > + dev_err(pcdev->dev, "wrong id of pse pi: %u\n", > > + id); > > + ret =3D -EINVAL; > > + goto out; > > + } > > + > > + ret =3D of_property_count_strings(node, "pairset-names"); > > + if (ret <=3D 0) =20 >=20 > if (ret < 0) > error: can't get "pairset-names" property: %pe > if (ret < 1 || ret > 2) > error: wrong number of pairset-names. Should be 1 or 2, got %i Need to modify this to be able to have PoDL PIs without pairset description. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com