Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp460543lqr; Wed, 5 Jun 2024 10:49:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoesiQGohhWVyH0U4p0X51e5nzQMACXJsL16K0dIDG0s6p9+1FZYjiHfZBDg3ukeC21F5TXkGoeGos7eIOCU1fMGMPH5Ay+e/Wht5nmA== X-Google-Smtp-Source: AGHT+IFhhiX+5XSOmXomo6RFLEhNnvlrGCvD+zL/jG7yBDaQ73q+CSrNSSL+6aHcowwmO8hG7fb9 X-Received: by 2002:a05:6a21:8195:b0:1b2:710a:5cfc with SMTP id adf61e73a8af0-1b2b71790c0mr3131290637.57.1717609775882; Wed, 05 Jun 2024 10:49:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717609775; cv=pass; d=google.com; s=arc-20160816; b=UiZWeX+hCAZxjg+caqCg71kId12Mo9M08mqo9e/qoBfmUPAotb9GRGHeBtirCXz0za N3vO9CUXQKI5hQv1p7gTBBx2UOPmb0EoXgddL5eO+1Qj4XTW2zno07+8eG9ZzIz7weCZ N4P/Q/qUdrIyVzIPgq9tERSk5tphk5Iw8/DNF675WkCNkOW+wBT2peKcYoTri/rxkvCq 6QNt5/DpRmGSSaNGtFav8AnHyrjKcbvebtAHBEA3If0FJkPvh7fKBDUjBgWEIO0PLoPQ yDJlE2JujSIJ0I/Q0CdY3zyjVD58kUulV70YXkynkxx3piuw2in4/DDzkMEnYipWXqEp xg/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5Dxcu2E+RVr75ZGFcLY92MESegsFEFC/kQXxKiBfaU0=; fh=D1yCr2pLd8vmwsgmD/RkI91apq5yZf/XDL4mm2AC2DY=; b=wbwXrIfgOZeTtA387Ugpq/r0x/pqtCKN6IKdpr+g00Hwa+7javHHRm9lrDI1z1eelO ZwJTElohCFfKfG5OYhaXNBPMyLxk5MIg0QWsijK8VC5AX2unLtS4FkCRFsAbAut7Qttl x5rHvNAsiROU7EdH9fAPW9dtQ96XGP1DV0BeUbmGHjShXfDsGyCGIjf0Rt+3hdJViRxm EehZOIKDeN5Thws1zhrA70dOW7R0Yw3+Bh1Mfb0cOZBFDo0lihI79MmllUYT4UrdR/72 XePPQiG767HkefgbT8sNmXC9rdiPVyvsdTBYgGHHqEj1E+Ce0w5r+px+IIodXNcEp7Fl +yrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rm4Xt4VM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242c279f3si1299050b3a.226.2024.06.05.10.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 10:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rm4Xt4VM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 7E03028715F for ; Wed, 5 Jun 2024 17:49:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9526D155CAA; Wed, 5 Jun 2024 17:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rm4Xt4VM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B3EDF19D8BE; Wed, 5 Jun 2024 17:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717609768; cv=none; b=AT6ecMRWBKK4hDXKg921IOmjR76gZV6ljGLd4Atuk818+AGYfQ0wC01jsCDTekmdSF85XaiHjPHH1sutggKTMP8WTBfPlMQbwivFI4Zz90SQCCsfsJ3zdrmTEaIb92bSUv+ZHbVmB4oDT4FJtd0fbmDP/Fd2hCKEDuRx4L1GR7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717609768; c=relaxed/simple; bh=FwUaowYM9CbMgAtVVYcQAHzZ74XJ4DqCZ2hH6TrRPps=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QMpYVeNn6eZD1h0OZXK9a4c+Dx+4ZyV8jwpQYvD20EOcYHEcgRcmqj1ogPWfbeYcxYY05+kz0aZ7Dzt6evo7ZfUAZ9pKlqYvL+vM7XgmZT2MqewBHyUgG+8vG+uS+KG8nUaZgrQqT7BS7rBnA+41FyRC/hX6wIdOT9IUhwtEjD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rm4Xt4VM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B24C2BD11; Wed, 5 Jun 2024 17:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717609768; bh=FwUaowYM9CbMgAtVVYcQAHzZ74XJ4DqCZ2hH6TrRPps=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rm4Xt4VMCa0Bdg1NIpHXW5I3D+Rfzouxtpn5mhNpaNTLNw1F6TEZNlQtyvqkPDLgV wkUFUnCjuma2YxYaid2dXDDbKEQsOdjZeZRThBRD64FI0onL0YFQd386VJyU7OffVu 7MJdEbqLH62CUuHtYol2hXwmf/+5YMMmlH6Rl4UKF4xI0lTpMSAc4pDAEc+jVCjZMq G+LKc2JRIEsgvCcc6I4g3tLCGtuiEXWBePHFfUh8K+PNN1mzKWc/0qQWKbEMaTZN/D F8PNNrD6WolqKuGuq83d4ZqDbajVYLZq7AK5VM1HwEPTROT0EjbiPmPyLMFI0uWL+a ekNTSVMJc04fQ== Date: Wed, 5 Jun 2024 18:49:20 +0100 From: Simon Horman To: Serge Semin Cc: Andrew Lunn , Heiner Kallweit , Russell King , Alexandre Torgue , Jose Abreu , Jose Abreu , Vladimir Oltean , Florian Fainelli , Maxime Chevallier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sagar Cheluvegowda , Abhishek Chauhan , Andrew Halaney , Jiawen Wu , Mengyuan Lou , Tomer Maimon , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 08/10] net: pcs: xpcs: Add fwnode-based descriptor creation method Message-ID: <20240605174920.GR791188@kernel.org> References: <20240602143636.5839-1-fancer.lancer@gmail.com> <20240602143636.5839-9-fancer.lancer@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240602143636.5839-9-fancer.lancer@gmail.com> On Sun, Jun 02, 2024 at 05:36:22PM +0300, Serge Semin wrote: > It's now possible to have the DW XPCS device defined as a standard > platform device for instance in the platform DT-file. Although that > functionality is useless unless there is a way to have the device found by > the client drivers (STMMAC/DW *MAC, NXP SJA1105 Eth Switch, etc). Provide > such ability by means of the xpcs_create_fwnode() method. It needs to be > called with the device DW XPCS fwnode instance passed. That node will be > then used to find the MDIO-device instance in order to create the DW XPCS > descriptor. > > Note the method semantics and name is similar to what has been recently > introduced in the Lynx PCS driver. > > Signed-off-by: Serge Semin Hi Serge, Some minor nits from my side flagged by kernel-doc -none -Wall ... > diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c ... > @@ -1505,6 +1507,16 @@ static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev, > return ERR_PTR(ret); > } > > +/** > + * xpcs_create_mdiodev() - create a DW xPCS instance with the MDIO @addr > + * @bus: pointer to the MDIO-bus descriptor for the device to be looked at > + * @addr: device MDIO-bus ID > + * @requested PHY interface An entry for @interface should go here. > + * > + * If successful, returns a pointer to the DW XPCS handle. Otherwise returns > + * -ENODEV if device couldn't be found on the bus, other negative errno related > + * to the data allocation and MDIO-bus communications. Please consider including this information as a Return: section of the Kernel doc. Likewise for xpcs_create_fwnode(). > + */ > struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr, > phy_interface_t interface) > { > @@ -1529,6 +1541,44 @@ struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr, > } > EXPORT_SYMBOL_GPL(xpcs_create_mdiodev); > > +/** > + * xpcs_create_fwnode() - Create a DW xPCS instance from @fwnode > + * @node: fwnode handle poining to the DW XPCS device s/@node/@fwnode/ > + * @interface: requested PHY interface > + * > + * If successful, returns a pointer to the DW XPCS handle. Otherwise returns > + * -ENODEV if the fwnode is marked unavailable or device couldn't be found on > + * the bus, -EPROBE_DEFER if the respective MDIO-device instance couldn't be > + * found, other negative errno related to the data allocations and MDIO-bus > + * communications. > + */ > +struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode, > + phy_interface_t interface) ...