From patchwork Fri Aug 4 03:07:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Da Xue X-Patchwork-Id: 13341181 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 763F4EB64DD for ; Fri, 4 Aug 2023 03:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0gpL0tugegxrsCSMx+q2ngLyHX50OTUNOeiMCnKsWZs=; b=Xpo/uWpSPmKZ5v whijdW563XglADNiio7WpRY9G3Zaw+0EPIL+zouhW1iGO0JpBgWq/rpaSlpab6G844ZNv0tR64ksm s6epeeHAVSdDeIhilo5z0/35ICUuU7N7LJ6ru7Efc1e9r/m9GWC9q43qK6OI4SQNZZ2EJQ7qm0PQ3 Jsw5BTSm1gqTx+5zVrTPVtLP3gqEk69gxvSl8YSe1OFKbfJlDS1VwYrwbWeEXdYoMaPQfaTvbvPTe p1K18pPVbW0U1HC7i9efOyyA7NC7u2vuUyWyHmvNd79jYlgLEuFEiEf13agbrjX5k8rGUvLDdoeFR 3X+UdupniNvys6cyD/bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRlAP-00BQzL-1T; Fri, 04 Aug 2023 03:07:53 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRlAL-00BQyD-2n for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 03:07:52 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fe48d0ab0fso2701123e87.1 for ; Thu, 03 Aug 2023 20:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691118466; x=1691723266; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=d8AfrAY2ZGogCZnT9pjHagxUiEJXfq8HDQdgAefjNa0=; b=YGRo1eUfG9G7kRGOEjZ+7NoTA4rrjEDVVR+TetxIZiZZa5VsGyi9CTmIW93z7HHM2Q MEcDwbZ3EIdulRzTK9HB5kFoqsnvo6Q28KCv+pFiWzzFAS8oyC5/Fz9Pq5fwPy1bXM6O Sbakd4AHZxedXK7An7OslMvpfKEBcQxeaxTmuzvet/FZN5r8RhYMfju6SrEbC3/NweIF CG5vbsquWWnEdg3TMFM6PuMz83aHQGe9H9RJyTlbjrxV7tk14odjWDTtHk+/R5gNSTlK q8noRZF4JU6i2c4jot2r5L4JmUDNwRjKh3o/bx+I3z5g1uAtbcdfyE7OxzAftgA/WKJH 4SGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691118466; x=1691723266; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=d8AfrAY2ZGogCZnT9pjHagxUiEJXfq8HDQdgAefjNa0=; b=OXK9eI1pDoGJP+AVW0fV91L1IQ2cDalBi5pwWwPL+yZMjltrvldyUH8A5NRSn4Evbv 5T284wCK229xKQ3W9QPgTriaA4hLhTy0+WCjJvrx6rVYouYLkFzTmC4Gn61Ae1Ulj3Zu Il7pUkdayXNWEq+B902AbDE+xqhotlbdIm5FgWpqErxwMglUxmqhXBhAmgeHOf1AnHMB PO4rbRGnxeIHFr5WrRvKBp4Ep/gOSsBtiHbOQqzPAymKz4l257FcWMF1a8cbff1xz3OO c3D+8dpFzLn5Ht0t1tHO+U9tJe0Edc7pGVAYSeUqFRttP+JWuTEWnyUqHEetb6Q9zMws Fjdg== X-Gm-Message-State: AOJu0Ywpc0CoNMu3cuS7X7hpUUyxM+fok+oKAVRhJMiSt6y9/JUOg1EE moa1tcv+/f2nkpRAReNNkVi9p1IpUZKp0tixQ4qA X-Google-Smtp-Source: AGHT+IEqNunxQUqBpOT9oFHZJRvMLIfY+kP6NYcf4dY3x9ci1li3qv1UVhkhpZD5GfPLyxsn6u1BdIqwlGVGGd2bug8= X-Received: by 2002:ac2:4242:0:b0:4f8:5d0f:c779 with SMTP id m2-20020ac24242000000b004f85d0fc779mr285207lfl.40.1691118466227; Thu, 03 Aug 2023 20:07:46 -0700 (PDT) MIME-Version: 1.0 From: Da Xue Date: Thu, 3 Aug 2023 23:07:34 -0400 Message-ID: Subject: [PATCH] net: phy: meson-gxl: implement meson_gxl_phy_resume() To: Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_200750_750957_65C16D36 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org After suspend and resume, the meson GXL internal PHY config needs to be initialized again or the carrier cannot be found. Signed-off-by: Luke Lu Reviewed-by: Da Xue --- drivers/net/phy/meson-gxl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index bb9b33b6b..c4a07e6f7 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -132,6 +132,18 @@ static int meson_gxl_config_init(struct phy_device *phydev) return 0; } +static int meson_gxl_phy_resume(struct phy_device *phydev) +{ + int ret; + + phy_clear_bits(phydev, MII_BMCR, BMCR_PDOWN); + ret = meson_gxl_config_init(phydev); + if (ret) + return ret; + + return 0; +} + /* This function is provided to cope with the possible failures of this phy * during aneg process. When aneg fails, the PHY reports that aneg is done * but the value found in MII_LPA is wrong: @@ -196,7 +208,7 @@ static struct phy_driver meson_gxl_phy[] = { .config_intr = smsc_phy_config_intr, .handle_interrupt = smsc_phy_handle_interrupt, .suspend = genphy_suspend, - .resume = genphy_resume, + .resume = meson_gxl_phy_resume, .read_mmd = genphy_read_mmd_unsupported, .write_mmd = genphy_write_mmd_unsupported, }, {