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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 849E3C433EF for ; Sat, 14 May 2022 17:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234573AbiENRSc (ORCPT ); Sat, 14 May 2022 13:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbiENRSa (ORCPT ); Sat, 14 May 2022 13:18:30 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A69A1EAFB; Sat, 14 May 2022 10:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dxDs5yrcW45vjplOBhaNnU+S9CSWYkuBCk04Qmhp8xA=; b=wufhlEK7Gr4scKS8+uJ3+7otF9 4dZvDvOeDgRPJhf8hbVaqryp7VpnwVW+wz3mrDkhrwl2erXXNwAonQmnqd8JA3kNf4ZhyLRl+OqAV fZ0fEI1GglVjcLN4bV162CUAs1u7Lh7taz9rA2E1np2P7ar6Xtl2vpWq5kurwPRUlom8I04iczXDY 5JDzQmPwiSHBSIriZaExmU2b0jRMBPOn6VEmsJzQKE0v38hE6ew7Ugp4MhPCPgYN9cWPUg1k5HMWw mqJAiFH6CQu7TTq+7B5BLASlkZtOyPNeqM+cSfhk15O7O/D5P00eaqT9Vmf8sA8U26yxMwut9USeS g7f7YuXg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60714) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1npvPH-0003sm-OH; Sat, 14 May 2022 18:18:20 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1npvPF-0001iv-1O; Sat, 14 May 2022 18:18:17 +0100 Date: Sat, 14 May 2022 18:18:17 +0100 From: "Russell King (Oracle)" To: Maxime Chevallier Cc: davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Florian Fainelli , Heiner Kallweit , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next v2 1/5] net: ipqess: introduce the Qualcomm IPQESS driver Message-ID: References: <20220514150656.122108-1-maxime.chevallier@bootlin.com> <20220514150656.122108-2-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220514150656.122108-2-maxime.chevallier@bootlin.com> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, May 14, 2022 at 05:06:52PM +0200, Maxime Chevallier wrote: > +static int ipqess_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) > +{ > + struct ipqess *ess = netdev_priv(netdev); > + > + switch (cmd) { > + case SIOCGMIIPHY: > + case SIOCGMIIREG: > + case SIOCSMIIREG: > + return phylink_mii_ioctl(ess->phylink, ifr, cmd); > + default: > + break; > + } > + > + return -EOPNOTSUPP; > +} Is there a reason this isn't just: return phylink_mii_ioctl(ess->phylink, ifr, cmd); ? > +static int ipqess_axi_probe(struct platform_device *pdev) > +{ > + struct device_node *np = pdev->dev.of_node; > + struct net_device *netdev; > + phy_interface_t phy_mode; > + struct resource *res; > + struct ipqess *ess; > + int i, err = 0; > + > + netdev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ipqess), > + IPQESS_NETDEV_QUEUES, > + IPQESS_NETDEV_QUEUES); > + if (!netdev) > + return -ENOMEM; > + > + ess = netdev_priv(netdev); > + ess->netdev = netdev; > + ess->pdev = pdev; > + spin_lock_init(&ess->stats_lock); > + SET_NETDEV_DEV(netdev, &pdev->dev); > + platform_set_drvdata(pdev, netdev); > + > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + ess->hw_addr = devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(ess->hw_addr)) > + return PTR_ERR(ess->hw_addr); > + > + err = of_get_phy_mode(np, &phy_mode); > + if (err) { > + dev_err(&pdev->dev, "incorrect phy-mode\n"); > + return err; > + } > + > + ess->ess_clk = devm_clk_get(&pdev->dev, "ess"); > + if (!IS_ERR(ess->ess_clk)) > + clk_prepare_enable(ess->ess_clk); > + > + ess->ess_rst = devm_reset_control_get(&pdev->dev, "ess"); > + if (IS_ERR(ess->ess_rst)) > + goto err_clk; > + > + ipqess_reset(ess); > + > + ess->phylink_config.dev = &netdev->dev; > + ess->phylink_config.type = PHYLINK_NETDEV; > + > + __set_bit(PHY_INTERFACE_MODE_INTERNAL, > + ess->phylink_config.supported_interfaces); No mac capabilities? > + > + ess->phylink = phylink_create(&ess->phylink_config, > + of_fwnode_handle(np), phy_mode, > + &ipqess_phylink_mac_ops); -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!