Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3031647rwo; Thu, 3 Aug 2023 20:42:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkYVJKJ7GxXePJwzhU1aCotTrv1tR8IwDeMRKMdwFMCFir5F7mea0W0Gdd8pjGS+uSBWdf X-Received: by 2002:a17:90b:4a84:b0:268:266a:1ab with SMTP id lp4-20020a17090b4a8400b00268266a01abmr904343pjb.5.1691120521527; Thu, 03 Aug 2023 20:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691120521; cv=none; d=google.com; s=arc-20160816; b=ypWPNZ4iU1KeB+Ce1VZR94iWhAO7MrtGJ25pcvnOtCN36MNzFE0wRPB00GaC8M22wt 8P/oRI57JT5PkLPEhjGDnlfKmGTKlgEB/gxoXPMfX+CtBn7+hO5FvUtJlJ1RUZx488za NF/HjeybrPQx5OhByTP8rVXHgm5sDpoKAVMPlZDG4QYf8ShxHhalN3NCtYHmh1IfCEBO oPuLymsSGbIoCnvUqApoA5buouVYNKft19VFjC7j5novG7hukyX+0LmcxkUB9/h5yN3R p2qTLhnnXZzAj2bXZrPIkILECGmXdIxFBezrgDqOl0hseyTfL/vn809mY9sHboK/CLA4 pk2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=d8AfrAY2ZGogCZnT9pjHagxUiEJXfq8HDQdgAefjNa0=; fh=9YV1KEDtYY0F1E6Re4Xl75+njtnCT96MvAW8A+AjWY4=; b=FxoYdxiAqUPc/S6Mx038Lr3IEmBlQprXCILhc2P+oQlO0GUWZRMBxLWxKLsUTDRJs2 4TE2PeO1OPtmEOHdnxrgaWd0YWR2HOxddwqlL77IKlGYv4tB9I7bqjv6a7H5ZdhFBA1L 7QLMvgI2dmGrePZhXVCvhC7Izz58T0RuNu55bwDpyhUKlG48MLg6l2H2RdGLr5N3R6QL d4ss/c3Vs2LzDdVHNK566kxuRzNN6qCnvZCD9wWH0E+U0c49vk28L9OTjMwuJiQB5AGY GkoMvp3c1Tq6TTdwLNXw9auOysObQfzvOfkmJrQAamMmcgXgRJ9coEW1XTtWWhJnS+KN /CyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=YGRo1eUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c29-20020a631c5d000000b00563e09f3c3esi1053033pgm.359.2023.08.03.20.41.48; Thu, 03 Aug 2023 20:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=YGRo1eUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233893AbjHDDLS (ORCPT + 99 others); Thu, 3 Aug 2023 23:11:18 -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-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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) 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, }, { -- 2.39.2