From patchwork Mon Dec 16 18:32:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 1210713 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EPNmuv7M"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47c8zG0CzPz9sVw for ; Tue, 17 Dec 2019 05:33:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730643AbfLPSdM (ORCPT ); Mon, 16 Dec 2019 13:33:12 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34787 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730720AbfLPSdB (ORCPT ); Mon, 16 Dec 2019 13:33:01 -0500 Received: by mail-pg1-f193.google.com with SMTP id r11so4199497pgf.1 for ; Mon, 16 Dec 2019 10:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LsjRazNxwIjB/kfHtlv+QoNeEmV3wJwVhLTpn5ed/GQ=; b=EPNmuv7MqNfortefo8XxuPcLZY3v2+0pE/+qs5Mn/GhZSLiGYUEIFwOATXAMBhey5i evD1gcEeThnipE0cQo9oRKVuW70omJvIx4KGpA+ONYBCnaayq7479PtwTiK8fkQd9PJp jXXnQczA3ti83FYCWD7QEfUngm2rHMWv3dj0nz4B5fYnwVA2FhEQA5kQXsvZPTj65Zpq W4d6W2uJkoTEJDk4HWbJ3J89oMQwwpfoBnsuSos7jCnUphCmRT2XJDKGYAlDyApOzjHy zx0KYeSXpgtcgoy0tJWJ6OZa0xqM3icfHeXZLiRB3vfkEhC0TzBI/R7nPp4RYRIcGvyz 5J3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LsjRazNxwIjB/kfHtlv+QoNeEmV3wJwVhLTpn5ed/GQ=; b=E/NSBA6eaYQR7FUrcOzVLvuSRsZtanVpmpgMWfZIeE5dyKYzyw0ZVggR079RvCPnQw xtWGJ3/faMnJm0ZW/SR1HUAxr/DoC1NHr/Yeqe33c9/He1DobXLlRePcI31LDCLdTqmX W1IHMs2qS89fjO1ReCNP1dI7eSwsGaRa9Prn6yMsB0ozMD97smAfKuXWl632EPntD15J MOFxTeXJXQ5ROqIe9RDgYfDnO743HyVdsPvZXjs8khSSvmVRtECLEeEORXeAA2m7mvFj f55+glXpZlT9wbj+FXN1T3jyne7vBDSWJhqNnluFbSWQ2y5X2d4LTtL/722GAZ+VtFZp gPXQ== X-Gm-Message-State: APjAAAW/2oxAsFlBUKndVCSyKVH69qH72qvdmCRVf3gsvbBFvy7KNTvM Ssvoy9+kKsscB7priHrULRoYVhZ6 X-Google-Smtp-Source: APXvYqywyd+9sNBYjD8oNqLxF1Md9OVBnbnTKmYuQP3g7+J+J1BRsdzZYnneQ8i6drfpJFAw5/qcJg== X-Received: by 2002:a63:d62:: with SMTP id 34mr20598440pgn.268.1576521180321; Mon, 16 Dec 2019 10:33:00 -0800 (PST) Received: from localhost.localdomain (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id d65sm23400738pfa.159.2019.12.16.10.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 10:32:59 -0800 (PST) From: Richard Cochran To: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, David Miller , Michal Simek , Radhey Shyam Pandey Subject: [PATCH net-next 1/3] net: axienet: Propagate registration errors during probe. Date: Mon, 16 Dec 2019 10:32:54 -0800 Message-Id: <42ed0fb7ef99101d6fd8b799bccb6e2d746939c2.1576520432.git.richardcochran@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The function, axienet_mdio_setup(), calls of_mdiobus_register() which might return EDEFER_PROBE. However, this error is not propagated to the driver's probe method, and so deferred registration cannot happen. This patch fixes the issue by handling the error code properly. Signed-off-by: Richard Cochran --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 20746b801959..53644abe52da 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1835,9 +1835,10 @@ static int axienet_probe(struct platform_device *pdev) } ret = axienet_mdio_setup(lp); - if (ret) - dev_warn(&pdev->dev, - "error registering MDIO bus: %d\n", ret); + if (ret) { + dev_err(&pdev->dev, "error registering MDIO bus\n"); + goto free_netdev; + } } lp->phylink_config.dev = &ndev->dev; From patchwork Mon Dec 16 18:32:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 1210708 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="q0owXzgW"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47c8z63nLcz9sVw for ; Tue, 17 Dec 2019 05:33:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730858AbfLPSdE (ORCPT ); Mon, 16 Dec 2019 13:33:04 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:39588 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730833AbfLPSdC (ORCPT ); Mon, 16 Dec 2019 13:33:02 -0500 Received: by mail-pj1-f65.google.com with SMTP id v93so3355697pjb.6 for ; Mon, 16 Dec 2019 10:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=muvIZPXZzFYwA2KnEz8hZgGKrX75pxgv3Lg3oHbwLBw=; b=q0owXzgWorl+IT7EkpCMUN7xBbxlHC/mqAg9W9RTyNS1DZPouBDeAjh2z75XOKd2XM H2zvMJ4+D+vRCyLPoV6/ukez7dhju4BzISB2MFuIgVn9R1bF60KrQ550ejjEjQQhfJ3d R6NMNgCf9eQ1IK4+oUHoP4GJq41qma1QJ5kd37GC7FjKlmfruE/dmor9jXZdFrXVKioA MjjovHVvZIdkz64f6uLojQxp16D0wP4RaCry0+ZHNRAZb/NA2qnA5ZNWLVFXFDoN8Puk qTHH3zv1kSFftAZkAo5ErJVGH268XiYuT8vWzHBZEYjeH53PXUOGImxAgc3iof0dfak+ TCqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=muvIZPXZzFYwA2KnEz8hZgGKrX75pxgv3Lg3oHbwLBw=; b=rx8fPSaXrhpNFaax4TAnhztqsrjlV2VC+tWfNxnwp74azV0vZBzyhByYbP1J152C92 TH9FqmumAypddugp0sWW/rI1Pou1138P++6YA1kw8omwCdJDsHFlm3bC+W3K2ceT3S1E s+Gghy7kuFVW/WPxSbkgSRNL5zDQDNYDyI4+z1wYeegOrPjF0RABWPzABx0tNve1twEw Jr3kbD2RIGjz9EzEH0AKFi2ef1gdNTNyeMkDKu2DMSCugKCOiDFLlJ+CwIlMZxE0zIJs hqhD376XD43QCNXQi5EU9bIZ415hafwSIMezEQPyqYRf4pRuOKAZ1/3G3ELpVtjd1dkx pZdw== X-Gm-Message-State: APjAAAWhV0Oh3tdNvviBLQR/k7mM3J1YKSyjqXMbF67aVqumdsyzaN3l RWaZl0IBvf0ZMT64F9aIWK9gbcR8 X-Google-Smtp-Source: APXvYqygLqbMNydAuYdfkCmF+8oCs3Vw2xkRqAtHA6tCsjJGXCzAIzsezFGkNLbfktPTVScTqWNo8w== X-Received: by 2002:a17:902:bd85:: with SMTP id q5mr4061608pls.17.1576521181571; Mon, 16 Dec 2019 10:33:01 -0800 (PST) Received: from localhost.localdomain (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id d65sm23400738pfa.159.2019.12.16.10.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 10:33:00 -0800 (PST) From: Richard Cochran To: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, David Miller , Michal Simek , Radhey Shyam Pandey Subject: [PATCH net-next 2/3] net: axienet: Support software transmit time stamping. Date: Mon, 16 Dec 2019 10:32:55 -0800 Message-Id: <79b2d20c323484b8f86690ea56dae52b1be6a8e9.1576520432.git.richardcochran@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org MAC drivers are expected to invoke the transmit time stamping hook in order to support both software time stamping and PHY time stamping. This patch adds the missing hook. In addition, drivers calling netif_rx() should first check for PHY time stamping by calling skb_defer_rx_timestamp(). Signed-off-by: Richard Cochran --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 53644abe52da..05fa7371c39a 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -675,6 +675,9 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev) cur_p->skb = skb; tail_p = lp->tx_bd_p + sizeof(*lp->tx_bd_v) * lp->tx_bd_tail; + + skb_tx_timestamp(skb); + /* Start the transfer */ axienet_dma_out32(lp, XAXIDMA_TX_TDESC_OFFSET, tail_p); if (++lp->tx_bd_tail >= lp->tx_bd_num) @@ -736,7 +739,8 @@ static void axienet_recv(struct net_device *ndev) skb->ip_summed = CHECKSUM_COMPLETE; } - netif_rx(skb); + if (!skb_defer_rx_timestamp(skb)) + netif_rx(skb); size += length; packets++; @@ -1367,6 +1371,7 @@ static const struct ethtool_ops axienet_ethtool_ops = { .set_pauseparam = axienet_ethtools_set_pauseparam, .get_coalesce = axienet_ethtools_get_coalesce, .set_coalesce = axienet_ethtools_set_coalesce, + .get_ts_info = ethtool_op_get_ts_info, .get_link_ksettings = axienet_ethtools_get_link_ksettings, .set_link_ksettings = axienet_ethtools_set_link_ksettings, }; From patchwork Mon Dec 16 18:32:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 1210711 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TMhmToLv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47c8z94kL0z9sVy for ; Tue, 17 Dec 2019 05:33:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730644AbfLPSdI (ORCPT ); Mon, 16 Dec 2019 13:33:08 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:33966 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730772AbfLPSdD (ORCPT ); Mon, 16 Dec 2019 13:33:03 -0500 Received: by mail-pj1-f65.google.com with SMTP id j11so3369144pjs.1 for ; Mon, 16 Dec 2019 10:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X1zMAvxCxhNskiOgc/FddBrf0+UkJNkVR3iWyW4+/VY=; b=TMhmToLvRQp7S5PBPOfHiUUGksvPcQcvqxmiCD3+MZ97QglcZ4fHgSxHtFKa+GN0Fy SEyD/TX8F7mW2eKPrGsE+3liuilWz7QkuFpBmfO/VFvtb9/6JbBG/U0tnGgR5bXGPL33 9H3vzg6Qd0Ii7R++kF7UKiUzmJipvTEtBILZASk9QYsR3QHgNx4fblWUNR3x8Ldp3jcK 9FxM81lPQbBBsKJBO//GaEmhAa9OQhfXhxfKm1G1eH10ihLPNd/u/r24/Hb/1utjUWXd TQ7mNlRzhYK7nGd3HRmAnjX+QAcQucFGFfeP8uG0iKO5J73L3Fl+D1Q378lTpXljntkK R0EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X1zMAvxCxhNskiOgc/FddBrf0+UkJNkVR3iWyW4+/VY=; b=jhoPJagwC6SZutKM67/TE9wiKfY/JOA+lsegMVaLsRRK+FzWg9n7ccU7H2HETmkwzR ZcEmjO+E4pWoW1HUqU40NhAZpAfQMOtYCdE83TKhBVlPEB1lFYx39sqdza9dAToA2ys5 CaCrGbPTc/PlHndoaxWoOvUh5u0jK7YsFMCWdBU9eZMhrO4e5j4a77xE9uF8j6I2moOu ZMuWcPS9M1v52T9FD0QTRAjLupu5Tr1Hg9DKO+FxZsjfINrJrOV8hh/v9oje7cKXTBlS o0Z0uV0jVEeENJsYboLVbY2QxG4SCGyzJ9THycbn3rhW7y0qRbFyBBHEAgMuDx9VrJh/ 1pqA== X-Gm-Message-State: APjAAAVU1LNekgwdU6kV6g/FFtmH0lHmRr7FR9ZgtGqsMCzObrPVMw/p RFhdapIPXg6TmJNYKr5nSRlw3gdm X-Google-Smtp-Source: APXvYqzYPP3GI6b+mc7I95bJF2flZn6xh7EvsGcWzXAw1CEIntK0FV1qXcs9LWm/EAIJ4kPexaeDsA== X-Received: by 2002:a17:90b:90e:: with SMTP id bo14mr613573pjb.17.1576521182870; Mon, 16 Dec 2019 10:33:02 -0800 (PST) Received: from localhost.localdomain (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id d65sm23400738pfa.159.2019.12.16.10.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 10:33:02 -0800 (PST) From: Richard Cochran To: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, David Miller , Michal Simek , Radhey Shyam Pandey Subject: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy. Date: Mon, 16 Dec 2019 10:32:56 -0800 Message-Id: <361f63095be92df10e8e953af3b981cdac58d98e.1576520432.git.richardcochran@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In order to allow PHY drivers to handle ioctls, the MAC driver must pass the calls through. However, the axienet driver does not support ioctls at all. This patch fixes the issue by handing off the invocations to the PHY appropriately. Signed-off-by: Richard Cochran --- .../net/ethernet/xilinx/xilinx_axienet_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 05fa7371c39a..d0b996f220f5 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1067,6 +1067,23 @@ static int axienet_change_mtu(struct net_device *ndev, int new_mtu) return 0; } +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + if (!netif_running(dev)) + return -EINVAL; + + switch (cmd) { + case SIOCGMIIPHY: + case SIOCGMIIREG: + case SIOCSMIIREG: + case SIOCSHWTSTAMP: + case SIOCGHWTSTAMP: + return phy_mii_ioctl(dev->phydev, rq, cmd); + default: + return -EOPNOTSUPP; + } +} + #ifdef CONFIG_NET_POLL_CONTROLLER /** * axienet_poll_controller - Axi Ethernet poll mechanism. @@ -1095,6 +1112,7 @@ static const struct net_device_ops axienet_netdev_ops = { .ndo_set_mac_address = netdev_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = axienet_set_multicast_list, + .ndo_do_ioctl = axienet_ioctl, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = axienet_poll_controller, #endif