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 47AB4C433EF for ; Tue, 1 Mar 2022 20:15:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9F3683B73; Tue, 1 Mar 2022 21:15:15 +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 012C883A8A; Tue, 1 Mar 2022 21:15:14 +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 CD20083C1F for ; Tue, 1 Mar 2022 21:15:08 +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 1nP8tm-00BCKd-Au; Tue, 01 Mar 2022 20:15:06 +0000 From: Tim Harvey To: u-boot@lists.denx.de, Joe Hershberger , Ramon Fried Cc: Tim Harvey , Sean Anderson Subject: [PATCH 2/2] net: eth-phy: prevent undesired de-assertion of phy-reset on request Date: Tue, 1 Mar 2022 12:15:02 -0800 Message-Id: <20220301201502.28026-3-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220301201502.28026-1-tharvey@gateworks.com> References: <20220301201502.28026-1-tharvey@gateworks.com> 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 When gpio_request_by_name allocates a gpio output it by default will de-assert the gpio which for phy-reset will take the PHY out of reset. As this occurs before eth_phy_reset is called to assert the reset line it can cause undesired affects if reset timings are not properly met. Configure the gpio with GPIOD_IS_OUT_ACTIVE so that reset is kept active (reset asserted) to avoid this. Cc: Sean Anderson Signed-off-by: Tim Harvey --- drivers/net/eth-phy-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 1f285f7afd20..27b77444a0c5 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -137,7 +137,7 @@ static int eth_phy_of_to_plat(struct udevice *dev) /* search "reset-gpios" in phy node */ ret = gpio_request_by_name(dev, "reset-gpios", 0, &uc_priv->reset_gpio, - GPIOD_IS_OUT); + GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); if (ret && ret != -ENOENT) return ret; -- 2.17.1