From patchwork Sun Aug 11 15:08:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1145345 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 (mailfrom) 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=none (p=none dis=none) header.from=nic.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="oS6GIPEs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4662RQ0Tg2z9sN6 for ; Mon, 12 Aug 2019 01:08:17 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbfHKPIP (ORCPT ); Sun, 11 Aug 2019 11:08:15 -0400 Received: from mail.nic.cz ([217.31.204.67]:50424 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbfHKPIP (ORCPT ); Sun, 11 Aug 2019 11:08:15 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 06339140AE8; Sun, 11 Aug 2019 17:08:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1565536093; bh=peqVi3Kr/YFr7ZQTja6Q4tk5oqFPjW1MCqMTxD+/tX4=; h=From:To:Date; b=oS6GIPEsubKSr6c68YD2CP+42Os7FyIP+cJA5YbCyPxPyk9DDUfm5O3cE05zV8a2e S1ndYFbNNWz9Y17kb6lP6JgIpn1GtgJDNo/m3t/QPojoCMFJHUxDm5dbQrRRSdXoFr Ws/m0wofLKFHaBhQa3TpOurcLRW1ufg6wsmB1sLM= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , Heiner Kallweit , Sebastian Reichel , Vivien Didelot , Andrew Lunn , Florian Fainelli , "David S . Miller" Subject: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup Date: Sun, 11 Aug 2019 17:08:11 +0200 Message-Id: <20190811150812.6780-1-marek.behun@nic.cz> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz X-Virus-Status: Clean X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The mv88e6xxx_port_setup_mac looks if one of the {link, speed, duplex} parameters is being changed from the current setting, and if not, does not do anything. This test is wrong in some situations: this method also has the mode argument, which can also be changed. For example on Turris Omnia, the mode is PHY_INTERFACE_MODE_RGMII_ID, which has to be set byt the ->port_set_rgmii_delay method. The test does not look if mode is being changed (in fact there is currently no method to determine port mode as phy_interface_t type). The simplest solution seems to be to drop this test altogether and simply do the setup when requested. Signed-off-by: Marek BehĂșn Cc: Heiner Kallweit Cc: Sebastian Reichel Cc: Vivien Didelot Cc: Andrew Lunn Cc: Florian Fainelli Cc: David S. Miller --- drivers/net/dsa/mv88e6xxx/chip.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 2e8b1ab2c6f7..aae63f6515b3 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -420,15 +420,6 @@ int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port, int link, if (err) return err; - /* Has anything actually changed? We don't expect the - * interface mode to change without one of the other - * parameters also changing - */ - if (state.link == link && - state.speed == speed && - state.duplex == duplex) - return 0; - /* Port's MAC control must not be changed unless the link is down */ err = chip->info->ops->port_set_link(chip, port, 0); if (err) From patchwork Sun Aug 11 15:08:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1145346 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 (mailfrom) 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=none (p=none dis=none) header.from=nic.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="CVcanJRq"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4662RT5pR8z9sNC for ; Mon, 12 Aug 2019 01:08:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbfHKPIP (ORCPT ); Sun, 11 Aug 2019 11:08:15 -0400 Received: from mail.nic.cz ([217.31.204.67]:50426 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbfHKPIP (ORCPT ); Sun, 11 Aug 2019 11:08:15 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 2C852140AF8; Sun, 11 Aug 2019 17:08:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1565536093; bh=63hpz9X1d4h8UOFdTkL0pziBy+mG6P1Hxi1huXlX5dA=; h=From:To:Date; b=CVcanJRqbnXgmildjgYa9szymQXfqRdc/WqqmiK5gyIyceaaQcmx6zLxHl86bVHzM LUWJKzbHzqHj+RsfSpu7/KHGBkJdlElSv2BeA/x9+Fj5LMAeToVIIE8F2PhYUheYPK dNvDplO5ggqxpiIFnh2Ia/S6duVMX0mW8ZnImP1E= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , Heiner Kallweit , Sebastian Reichel , Vivien Didelot , Andrew Lunn , Florian Fainelli , "David S . Miller" Subject: [PATCH net-next 2/2] net: fixed_phy: set is_gigabit_capable member when needed Date: Sun, 11 Aug 2019 17:08:12 +0200 Message-Id: <20190811150812.6780-2-marek.behun@nic.cz> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190811150812.6780-1-marek.behun@nic.cz> References: <20190811150812.6780-1-marek.behun@nic.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz X-Virus-Status: Clean X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The fixed_phy driver does not set the phydev->is_gigabit_capable member when the fixed_phy is gigabit capable. This in turn causes phy_device.c:genphy_read_status function to return unknown phy parameters (SPEED_UNKNOWN, DUPLEX_UNKNOWN, ...), if the fixed_phy is created with SPEED_1000. Signed-off-by: Marek BehĂșn Cc: Heiner Kallweit Cc: Sebastian Reichel Cc: Vivien Didelot Cc: Andrew Lunn Cc: Florian Fainelli Cc: David S. Miller --- drivers/net/phy/fixed_phy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index 3ffe46df249e..424b02ad7b7b 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -286,6 +286,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, phy->supported); linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phy->supported); + phy->is_gigabit_capable = 1; /* fall through */ case SPEED_100: linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,