From patchwork Fri May 8 12:34:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12796C38A2A for ; Fri, 8 May 2020 12:48:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB8C724958 for ; Fri, 8 May 2020 12:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942103; bh=7fa/eJupouYkwqroFu6QkxFryOR+WnizWgdKI1tS3Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BV849nqqPGDifMKk1O7sM9Vg+MlFpFBY65nwxf1zm4eAqr2/Te81y9kSvCDwSPNCl UiNgqUNBSKdJ5CLVK2EGI8+voHM4epqmx6//pKa+plw6vu1CfnXXwdK7oJphrnEnj2 Tyrcw+tqqfI/kH/WG2KwZG6bMPV2WDocmamB5MEk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728181AbgEHMsW (ORCPT ); Fri, 8 May 2020 08:48:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729664AbgEHMsW (ORCPT ); Fri, 8 May 2020 08:48:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E1B9421473; Fri, 8 May 2020 12:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942101; bh=7fa/eJupouYkwqroFu6QkxFryOR+WnizWgdKI1tS3Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0oIAm6c5l9bDFU4i+PCARmWjYmLUnifq6pGvJib1pXBe1veMa+37IQ2woIIKoNfco kEpaAnyzlul7CcsHyAwsW/sls4f/HfvMxMrk7HPsL0pmXs0FOBujZZgrVwemYKeRyq C4mcKmZUdOay9mlk4O0I+SWbrCapb59q+hev7oYQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Shtylyov , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "David S. Miller" Subject: [PATCH 4.4 297/312] at803x: fix reset handling Date: Fri, 8 May 2020 14:34:48 +0200 Message-Id: <20200508123145.266175751@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sergei Shtylyov commit d57019d1858a6f9b3ca05d76d793466ae428cfa3 upstream. The driver of course "knows" that the chip's reset signal is active low, so it drives the GPIO to 0 to reset the PHY and to 1 otherwise; however all this will only work iff the GPIO is specified as active-high in the device tree! I think both the driver and the device trees (if there are any -- I was unable to find them) need to be fixed in this case... Fixes: 13a56b449325 ("net: phy: at803x: Add support for hardware reset") Signed-off-by: Sergei Shtylyov Acked-by: Uwe Kleine-König Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/at803x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -198,7 +198,7 @@ static int at803x_probe(struct phy_devic if (!priv) return -ENOMEM; - gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpiod_reset)) return PTR_ERR(gpiod_reset); @@ -274,10 +274,10 @@ static void at803x_link_change_notify(st at803x_context_save(phydev, &context); - gpiod_set_value(priv->gpiod_reset, 0); - msleep(1); gpiod_set_value(priv->gpiod_reset, 1); msleep(1); + gpiod_set_value(priv->gpiod_reset, 0); + msleep(1); at803x_context_restore(phydev, &context);