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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DDEEC433EF for ; Tue, 1 Mar 2022 20:15:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C65D83C00; Tue, 1 Mar 2022 21:15:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E38A783BCC; Tue, 1 Mar 2022 21:15:13 +0100 (CET) Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A4DF483BBE for ; Tue, 1 Mar 2022 21:15:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1nP8tk-00BCKd-UN; Tue, 01 Mar 2022 20:15:05 +0000 From: Tim Harvey To: u-boot@lists.denx.de, Joe Hershberger , Ramon Fried Cc: Tim Harvey Subject: [PATCH 0/2] prevent undesired de-assertion of phy-reset Date: Tue, 1 Mar 2022 12:15:00 -0800 Message-Id: <20220301201502.28026-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Some PHY's have strict requirements on reset timings which can be violated if the PHY is taken out of reset before a proper reset pulse is performed. When gpio_request_by_name is used for reset gpios without GPIOD_IS_OUT_ACTIVE the GPIO will be de-asserted when requested taking the PHY out of reset. Resolve this by adding the GPIOD_IS_OUT_ACTIVE flag. There are 42 occurances of gpio_request_by_name in U-Boot for gpio's with 'reset' in their name yet the only one that uses GPIOD_IS_OUT_ACTIVE is drivers/net/dwc_eth_qos.c. While I think setting GPIOD_IS_OUT_ACTIVE is the right thing to do, I'm only changing the ones that I have run into issues with: drivers/net/eth-phy-uclass.c drivers/net/fec_mxc.c Both of these have functions that are called that assert, delay, de-assert, delay such that I know they will properly be taken out of reset. The Linux kernel had a similar issue [1] Tim Harvey (2): net: fec: prevent undesired de-assertion of phy-reset on request net: eth-phy: prevent undesired de-assertion of phy-reset on request drivers/net/eth-phy-uclass.c | 2 +- drivers/net/fec_mxc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- [1] https://lore.kernel.org/all/20210202143239.10714-1-mike.looijmans@topic.nl/ 2.17.1