Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4088435pxb; Tue, 26 Jan 2021 12:04:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxm0NhO5CgziLZJSXfBwQodTbIgfS6zqqbKW1XmO+KyK0y9KjQMYh3zMQdW3ckwL1WGxGVN X-Received: by 2002:a17:906:1712:: with SMTP id c18mr4608168eje.417.1611691488577; Tue, 26 Jan 2021 12:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611691488; cv=none; d=google.com; s=arc-20160816; b=So4f7uP1q9do2FIWcE+7bLsLD58YjFYIfRzfJdhYQje1BucnU/yZDF7epAchTqLpMQ 7bJC51hswKgoN3oQubdPZYqeAoS1w2ZlJL9A21kiPMYkOivDNPUlVnqZnMqF0hINlfDj ayH2PgmMioGaOwHRSHHzONpG/2kHegtpYU1yQ6WC6L+JOIMzBpI9ehQ54klMtFZiMNs8 njqETaGkPbpdP5V3Y0nxg/rE2zDVsZj8wQ+8HC2yHV1bVh8BhMg/w4RpqEdDqKSdO2j9 eRgG9zOuSFRdsGrvRtHU2HVzA07tgjvYrMymL5U/2N+W7goq2y2DKY5bamoIzJNHTJ2H xPRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=aeJHkpHLkJ+gSYi5bSnmXbfIEoMk/OUOiDNUVFPU8ZU=; b=LzCbbzFMLxjYKfp/jGyLubONGIPaKgbaOGqCnujEgt+K7kQ/+8zfLXXbOEoKO8iFUx S3T6Y/lec9B/L3bzU4vFNWOD05s+9CVxFoaTBfX0s4CbaunnDjFxhqzRtLLr7S2wDnCC HpR9Gi8eyOM6qYa3OtQdZzF+yG2GJ5hYS4fCQN+Znv1g8FkESHnUu5OobTHyaOrvaPgn pP6eMOjrURdhB+PwEs8cYbVtIzBSxVeZ5y0sJMeejI7Mul6ct74QEITNDDY5N1RqB/2E fL3Y0hmmpMYtQRO5xlzBhFL0lG59l/Z+GpC0e1GcfI/iqrAZlM4ON8qQCnxZSJu0yYyj GvWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si9503127edv.363.2021.01.26.12.04.22; Tue, 26 Jan 2021 12:04:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729630AbhAZRba (ORCPT + 99 others); Tue, 26 Jan 2021 12:31:30 -0500 Received: from atl4mhfb02.myregisteredsite.com ([209.17.115.118]:38644 "EHLO atl4mhfb02.myregisteredsite.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733086AbhAZHhA (ORCPT ); Tue, 26 Jan 2021 02:37:00 -0500 Received: from jax4mhob02.registeredsite.com (jax4mhob02.myregisteredsite.com [64.69.218.82]) by atl4mhfb02.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id 10Q7ZjFM000941 for ; Tue, 26 Jan 2021 02:35:46 -0500 Received: from mailpod.hostingplatform.com ([10.30.71.206]) by jax4mhob02.registeredsite.com (8.14.4/8.14.4) with ESMTP id 10Q7Xw9k002082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 26 Jan 2021 02:33:59 -0500 Received: (qmail 22912 invoked by uid 0); 26 Jan 2021 07:33:58 -0000 X-TCPREMOTEIP: 83.128.90.119 X-Authenticated-UID: mike@milosoftware.com Received: from unknown (HELO phenom.domain?not?set.invalid) (mike@milosoftware.com@83.128.90.119) by 0 with ESMTPA; 26 Jan 2021 07:33:58 -0000 From: Mike Looijmans To: netdev@vger.kernel.org Cc: Mike Looijmans , Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , Russell King , linux-kernel@vger.kernel.org Subject: [PATCH] net: mdiobus: Prevent spike on MDIO bus reset signal Date: Tue, 26 Jan 2021 08:33:37 +0100 Message-Id: <20210126073337.20393-1-mike.looijmans@topic.nl> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mdio_bus reset code first de-asserted the reset by allocating with GPIOD_OUT_LOW, then asserted and de-asserted again. In other words, if the reset signal defaulted to asserted, there'd be a short "spike" before the reset. Instead, directly assert the reset signal using GPIOD_OUT_HIGH, this removes the spike and also removes a line of code since the signal is already high. Signed-off-by: Mike Looijmans --- drivers/net/phy/mdio_bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 2b42e46066b4..34e98ae75110 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -543,8 +543,8 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) mutex_init(&bus->mdio_lock); mutex_init(&bus->shared_lock); - /* de-assert bus level PHY GPIO reset */ - gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW); + /* assert bus level PHY GPIO reset */ + gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpiod)) { err = dev_err_probe(&bus->dev, PTR_ERR(gpiod), "mii_bus %s couldn't get reset GPIO\n", @@ -553,8 +553,6 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) return err; } else if (gpiod) { bus->reset_gpiod = gpiod; - - gpiod_set_value_cansleep(gpiod, 1); fsleep(bus->reset_delay_us); gpiod_set_value_cansleep(gpiod, 0); if (bus->reset_post_delay_us > 0) -- 2.17.1