From patchwork Fri Oct 20 08:14:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 828503 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yJJgJ3ky6z9t6J for ; Fri, 20 Oct 2017 19:22:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752623AbdJTIWD (ORCPT ); Fri, 20 Oct 2017 04:22:03 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59894 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201AbdJTIOa (ORCPT ); Fri, 20 Oct 2017 04:14:30 -0400 Received: from ayla.of.borg ([84.195.106.246]) by baptiste.telenet-ops.be with bizsmtp id PkEN1w01g5JzmfG01kEN4D; Fri, 20 Oct 2017 10:14:27 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1e5SRi-0008Nn-Mu; Fri, 20 Oct 2017 10:14:22 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1e5SRi-0004pW-L1; Fri, 20 Oct 2017 10:14:22 +0200 From: Geert Uytterhoeven To: "David S . Miller" , Andrew Lunn , Florian Fainelli , Simon Horman , Magnus Damm Cc: Sergei Shtylyov , Rob Herring , Mark Rutland , Nicolas Ferre , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 0/4] Teach phylib hard-resetting devices Date: Fri, 20 Oct 2017 10:14:17 +0200 Message-Id: <1508487261-18524-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi David, Andrew, Florian, Simon, Magnus, This patch series adds optional PHY reset support to phylib. The first two patches are destined for David's net-next tree. They add core PHY reset code, and update a driver that currently uses its own reset code. Note that these patches depend on "[PATCH v2] of_mdio: Fix broken PHY IRQ in case of probe deferral" (https://www.spinics.net/lists/linux-renesas-soc/msg19442.html), as v3 needs to propagate errors from of_mdiobus_register_phy() and of_mdiobus_register_device() [1]. The last two patches are new (sort of, see [2]), and destined for Simon's renesas tree. They add properties to describe the EthernetAVB PHY reset topology to the common Salvator-X/XS and ULCB DTS files, which solves two issues: 1. On Salvator-XS, the enable pin of the regulator providing PHY power is connected to PRESETn, and PSCI powers down the SoC during system suspend. Hence a PHY reset is needed to restore network functionality after resume. 2. Linux should not rely on the boot loader having reset the PHY, but should reset the PHY during driver probe. Changes compared to v2, as sent by Sergei Shtylyov: - Fix fwnode_get_named_gpiod() call due to added parameters (which allowed to eliminate the gpiod_direction_output() call), - Rebased, refreshed, reworded, - Take over from Sergei, - Add Acked-by, - Remove unneeded gpiod check, as gpiod_set_value() handles NULL fine, - Handle fwnode_get_named_gpiod() errors correctly: - -ENOENT is ignored (the GPIO is optional), and turned into NULL, which allowed to remove all later !IS_ERR() checks, - Other errors (incl. -EPROBE_DEFER) are propagated [1], - Extract DTS patches from series "[PATCH 0/4] ravb: Add PHY reset support" (https://www.spinics.net/lists/netdev/msg457308.html), and incorporate in this series, after moving reset-gpios from the ethernet to the ethernet-phy node [2]. Thanks for your comments! Geert Uytterhoeven (2): arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset arm64: dts: renesas: ulcb: Add EthernetAVB PHY reset Sergei Shtylyov (2): phylib: Add device reset GPIO support macb: Kill PHY reset code Documentation/devicetree/bindings/net/phy.txt | 2 ++ arch/arm64/boot/dts/renesas/salvator-common.dtsi | 1 + arch/arm64/boot/dts/renesas/ulcb.dtsi | 1 + drivers/net/ethernet/cadence/macb.h | 1 - drivers/net/ethernet/cadence/macb_main.c | 21 --------------- drivers/net/phy/at803x.c | 18 +++---------- drivers/net/phy/mdio_bus.c | 4 +++ drivers/net/phy/mdio_device.c | 26 +++++++++++++++++-- drivers/net/phy/phy_device.c | 33 ++++++++++++++++++++++-- drivers/of/of_mdio.c | 23 +++++++++++++++++ include/linux/mdio.h | 3 +++ include/linux/phy.h | 5 ++++ 12 files changed, 97 insertions(+), 41 deletions(-)