Received: by 10.213.65.68 with SMTP id h4csp1179719imn; Wed, 28 Mar 2018 23:00:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx48WO4F90Ud/Nikc9HJ483xMJDJ2S1lWaY/vkT4aE7LiY1iFvipRJWRkkwpkBPL90h+hDws1 X-Received: by 2002:a17:902:9a96:: with SMTP id w22-v6mr1168605plp.209.1522303237275; Wed, 28 Mar 2018 23:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522303237; cv=none; d=google.com; s=arc-20160816; b=g7uFmtQdm9JEsvVbgb+Dotn/UNdhfiYWIClw1s0wj5GFjFebXj6HoVgq7w9Gshm1vH CZZWZfCfVkGe+Po1MiIYWBPXPAMtUi33+HlwPcGe6l1cAgfnFpQOxeyL/IiEYA7dG/wV DNT8yfZgPaNk+oSXf4+66JWWFZQC5oJMbUs1mCIYLl07V+IRvB0/j1gkTOW3+nbiPH33 tI19ZwUSgQZBvQQTOHQ1bc569qg+xIfwXJbRbRnO0qcrdBmVA9FWfX+9/Bbgp87sax+p jPmS1Hdr1esZkRSq0ox8S5qBXRkiy78WK1zSn1DEqyeXue9V5fDr2l306kQw3pwedKC1 jI0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=736TbknFX8eimDJ4gT8L1zoqbkSbRWfVjiIf+KZFb+4=; b=RCdCPQz4w6N5ICMRIax1xROGa6CB8bmjePxOFgZQuxLAoHoc5VtahroUpjI6KxVniz gGKHjLB9jPp/ntE0lDVJ2wX98FYhGt+vK/w12pCYLSoAuff9JEWL2Yh6NIC2n7qGcIbz d45Qw8/ZMG9TQ6umBdl+gCOqhBU6cwr+gB7B/ijxQdJ5zDo+KL5kK8asEfX/R6jbZe2D bVpn8HYURpiCs0x6/Plm+a3b95IQwxm7QkQPpLLHGoAmmwOlCE9kFU4vkJoIRQBIyf8n l+/TiAzKpVZ5WC7t5YBeBHmNlqAU9bCtV1dT9M5YUinwfZ0rycflxlycGtwifWZ/tEMF lXwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si956593pli.427.2018.03.28.23.00.23; Wed, 28 Mar 2018 23:00:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751230AbeC2F7X convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Mar 2018 01:59:23 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:41876 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751182AbeC2F7U (ORCPT ); Thu, 29 Mar 2018 01:59:20 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2T5slkH032443; Wed, 28 Mar 2018 22:59:06 -0700 Received: from il-exch02.marvell.com ([199.203.130.102]) by mx0a-0016f401.pphosted.com with ESMTP id 2gwm1krdyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 28 Mar 2018 22:59:06 -0700 Received: from IL-EXCH01.marvell.com (10.4.102.220) by IL-EXCH02.marvell.com (10.4.102.221) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 29 Mar 2018 08:59:03 +0300 Received: from IL-EXCH01.marvell.com ([fe80::5d63:81cd:31e2:fc36]) by IL-EXCH01.marvell.com ([fe80::5d63:81cd:31e2:fc36%20]) with mapi id 15.00.1210.000; Thu, 29 Mar 2018 08:59:02 +0300 From: Yan Markman To: Florian Fainelli , "netdev@vger.kernel.org" CC: Thomas Petazzoni , Andrew Lunn , "David S. Miller" , Russell King , open list , Antoine Tenart , Stefan Chulski , Maxime Chevallier , Miquel Raynal , Marcin Wojtas , Yelena Krivosheev Subject: RE: [EXT] [PATCH net-next v2 1/2] net: phy: phylink: Provide PHY interface to mac_link_{up,down} Thread-Topic: [EXT] [PATCH net-next v2 1/2] net: phy: phylink: Provide PHY interface to mac_link_{up,down} Thread-Index: AQHTxuZTe3I/uM/sTEyeUn5wn3S4MaPmuDiw Date: Thu, 29 Mar 2018 05:59:02 +0000 Message-ID: <843035ef7cfb45a7a02be516b8fcdd49@IL-EXCH01.marvell.com> References: <20180328224416.6981-1-f.fainelli@gmail.com> <20180328224416.6981-2-f.fainelli@gmail.com> In-Reply-To: <20180328224416.6981-2-f.fainelli@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.5.102.207] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-29_03:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803290067 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Florian Please keep CC Yelena Krivosheev for changes with drivers/net/ethernet/marvell/mvneta.c Thanks Yan Markman Tel. 05-44732819 -----Original Message----- From: Florian Fainelli [mailto:f.fainelli@gmail.com] Sent: Thursday, March 29, 2018 1:44 AM To: netdev@vger.kernel.org Cc: Florian Fainelli ; Thomas Petazzoni ; Andrew Lunn ; David S. Miller ; Russell King ; open list ; Antoine Tenart ; Yan Markman ; Stefan Chulski ; Maxime Chevallier ; Miquel Raynal ; Marcin Wojtas Subject: [EXT] [PATCH net-next v2 1/2] net: phy: phylink: Provide PHY interface to mac_link_{up,down} External Email ---------------------------------------------------------------------- In preparation for having DSA transition entirely to PHYLINK, we need to pass a PHY interface type to the mac_link_{up,down} callbacks because we may have to make decisions on that (e.g: turn on/off RGMII interfaces etc.). We do not pass an entire phylink_link_state because not all parameters (pause, duplex etc.) are defined when the link is down, only link and interface are. Update mvneta accordingly since it currently implements phylink_mac_ops. Acked-by: Russell King Signed-off-by: Florian Fainelli --- drivers/net/ethernet/marvell/mvneta.c | 4 +++- drivers/net/phy/phylink.c | 4 +++- include/linux/phylink.h | 14 +++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index eaa4bb80f1c9..cd09bde55596 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3396,7 +3396,8 @@ static void mvneta_set_eee(struct mvneta_port *pp, bool enable) mvreg_write(pp, MVNETA_LPI_CTRL_1, lpi_ctl1); } -static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) +static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode, + phy_interface_t interface) { struct mvneta_port *pp = netdev_priv(ndev); u32 val; @@ -3415,6 +3416,7 @@ static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) } static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode, + phy_interface_t interface, struct phy_device *phy) { struct mvneta_port *pp = netdev_priv(ndev); diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 51a011a349fe..9b1e4721ea3a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -470,10 +470,12 @@ static void phylink_resolve(struct work_struct *w) if (link_state.link != netif_carrier_ok(ndev)) { if (!link_state.link) { netif_carrier_off(ndev); - pl->ops->mac_link_down(ndev, pl->link_an_mode); + pl->ops->mac_link_down(ndev, pl->link_an_mode, + pl->phy_state.interface); netdev_info(ndev, "Link is Down\n"); } else { pl->ops->mac_link_up(ndev, pl->link_an_mode, + pl->phy_state.interface, pl->phydev); netif_carrier_on(ndev); diff --git a/include/linux/phylink.h b/include/linux/phylink.h index bd137c273d38..e95cc12030fa 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -73,8 +73,10 @@ struct phylink_mac_ops { void (*mac_config)(struct net_device *ndev, unsigned int mode, const struct phylink_link_state *state); void (*mac_an_restart)(struct net_device *ndev); - void (*mac_link_down)(struct net_device *ndev, unsigned int mode); + void (*mac_link_down)(struct net_device *ndev, unsigned int mode, + phy_interface_t interface); void (*mac_link_up)(struct net_device *ndev, unsigned int mode, + phy_interface_t interface, struct phy_device *phy); }; @@ -161,25 +163,31 @@ void mac_an_restart(struct net_device *ndev); * mac_link_down() - take the link down * @ndev: a pointer to a &struct net_device for the MAC. * @mode: link autonegotiation mode + * @interface: link &typedef phy_interface_t mode * * If @mode is not an in-band negotiation mode (as defined by * phylink_autoneg_inband()), force the link down and disable any - * Energy Efficient Ethernet MAC configuration. + * Energy Efficient Ethernet MAC configuration. Interface type + * selection must be done in mac_config(). */ -void mac_link_down(struct net_device *ndev, unsigned int mode); +void mac_link_down(struct net_device *ndev, unsigned int mode, + phy_interface_t interface); /** * mac_link_up() - allow the link to come up * @ndev: a pointer to a &struct net_device for the MAC. * @mode: link autonegotiation mode + * @interface: link &typedef phy_interface_t mode * @phy: any attached phy * * If @mode is not an in-band negotiation mode (as defined by * phylink_autoneg_inband()), allow the link to come up. If @phy * is non-%NULL, configure Energy Efficient Ethernet by calling * phy_init_eee() and perform appropriate MAC configuration for EEE. + * Interface type selection must be done in mac_config(). */ void mac_link_up(struct net_device *ndev, unsigned int mode, + phy_interface_t interface, struct phy_device *phy); #endif -- 2.14.1