From nobody Thu Sep 11 12:52:08 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AD99EB64DD for ; Fri, 4 Aug 2023 03:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233910AbjHDDLT (ORCPT ); Thu, 3 Aug 2023 23:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbjHDDKg (ORCPT ); Thu, 3 Aug 2023 23:10:36 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D63BE5B94 for ; Thu, 3 Aug 2023 20:07:48 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fe11652b64so2718514e87.0 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=V/pyKboIuGbDEbclsoBx4hd2AzFwVc5VglAslIVQXNnxzFnbAe0ruIJ2WoDrdrbq25 W//AAY2TdXeyI0UiMrJM+w5RiL3wZ+9//lmwTjnpgYSJLtX043x5RYXOykjg8ZR7M8bU QE02sfZilQc/4SFVoQlp1va7fGvL6N+L7d2IUl1m2X3Ssrb5JLlSfxK/KJXg0fmhq2Vc fczQWIZ7hNPvouXTR3TY4zmHebER7WX7tUE7qvRGr1D68zsih6kxNdNke2nTsvIcx8aR NpfK32OFD9jePlxO3GgcSV99sGVu7ItbJo7mWLm491L0BNE1JeZuBe7JJjOIaae+RgBq J2eg== X-Gm-Message-State: AOJu0YzHF+5WgVhvoywBNjpqo14p/fitgmkpYFKOVHorWrBf/o4p/541 Rks/OH4VvFwxRu6ZG7DEledxQ5Nd50a93Lqlr65E 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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(-) 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 *ph= ydev) return 0; } +static int meson_gxl_phy_resume(struct phy_device *phydev) +{ + int ret; + + phy_clear_bits(phydev, MII_BMCR, BMCR_PDOWN); + ret =3D 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[] =3D { .config_intr =3D smsc_phy_config_intr, .handle_interrupt =3D smsc_phy_handle_interrupt, .suspend =3D genphy_suspend, - .resume =3D genphy_resume, + .resume =3D meson_gxl_phy_resume, .read_mmd =3D genphy_read_mmd_unsupported, .write_mmd =3D genphy_write_mmd_unsupported, }, { -- 2.39.2