Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4676912rwb; Tue, 8 Aug 2023 11:59:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5sWJq4EhM32DjioSPZ3oaptwoCDCsjwcV77JCPpbDmd1dH04Q+hixPtnrwfhbKJy4pyh0 X-Received: by 2002:a05:6a20:1385:b0:135:4df7:f165 with SMTP id hn5-20020a056a20138500b001354df7f165mr371048pzc.21.1691521154037; Tue, 08 Aug 2023 11:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691521154; cv=none; d=google.com; s=arc-20160816; b=GZSwz6oyfGdZyVA14F/rZ0vz3F18JSpWvBkIJekz7lcRVq7laAkkBZ7OcXDf3110R+ YP0T6ibrQIRlfjq5c7+RXuAfQbWg1ZB9UGcXI5zSPQeMD5m8B/nir2yMTBZ3RF6R6oo1 CdUlezWzrjUt13tX0jyTn6+wpx0jo23CLr3GoYKkrfCeIXK0+y0TizcQgFF/MJcmfhRS ojP+sHrw/CRnftExpqz4LLeZfZ3lpCnLMlenAG2M5INhjfMNMCnssm0tjcmWGs4FEidn 4G6452QzOaDFG2q5RJejvmpTHBlii0XAq98BmGJ2EuEVLb/hpC3hJ6bjku83PeNzdp/p MgGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MkyQ6QEBJ5R+A4KzXauS14DJOe2NQamik93pPPAJ9ek=; fh=bUtrPNdVcdvWUPwLOlUZfmZgIpdeo1FKbHEQ2oji7j4=; b=eMqaS9V/DdK+eorHFxKAmR7Niswq934h5bjvsS7bwZbR1fQ6RpWjASOk/7UqRUVR4P UuBEBOtptRsCRCYiyqOCNw3K6ZXBdtVAgp9eHq0mZczVYcjO62Kyx5kXOfV1R4qPRVqp RDKO19XLRHUoxN6ml662KiJvhl7FulhM/xwyP+oWlCOHI63d2VVUCHUMtuBk0129tDCd i3fPrWbEi8kK2iiVVFUeH7LkyXpwnJzryEKvdfNJkgGCy4hDNZw1fFBEjFsDe18BJT9h nLna6DegO07pPL5a57EwBQWy3KIKaF6OAphUHAfXHxkvSsDvM7Kufdp1WUCmu7ZHc//A tYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=kW1hXpMI; 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 y16-20020a056a00191000b006875bd6d8d9si7586854pfi.169.2023.08.08.11.59.01; Tue, 08 Aug 2023 11:59:14 -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=kW1hXpMI; 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 S231540AbjHHQAd (ORCPT + 99 others); Tue, 8 Aug 2023 12:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbjHHP6t (ORCPT ); Tue, 8 Aug 2023 11:58:49 -0400 Received: from mail-ot1-x364.google.com (mail-ot1-x364.google.com [IPv6:2607:f8b0:4864:20::364]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52E836189 for ; Tue, 8 Aug 2023 08:44:23 -0700 (PDT) Received: by mail-ot1-x364.google.com with SMTP id 46e09a7af769-6bd0a0a675dso457812a34.2 for ; Tue, 08 Aug 2023 08:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691509460; x=1692114260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MkyQ6QEBJ5R+A4KzXauS14DJOe2NQamik93pPPAJ9ek=; b=kW1hXpMI+oS0W4xi2vS/augcBsN81pJ7H4T6YgBkm9izpcMbwq7spbsxOx2cgnx1cL YYsRTlhokZZCaLoDDA/Vp3p4xD/YAyJSopBMqjSrs/wT4Af/HCdWON38vwvUmmzbz7AT vC9uV60VvwUI2zkiNYYwfb5+2dg3+llNcmQht6bNQj8tzXqkB6plkIhRa57TFte6ciLe IqMvxnvMkHY/1uxeY7a5AEcvviROVlsKorv0hYw9t8sKHPahkCCDoTliYDvui20Wj2Df pTxqG0RHxQiqncUjgnr51SLVxuljgQN0m9p1X3bUHbBb1L+OdRBwWoNszV1GhU3ngh3N ynQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691509460; x=1692114260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MkyQ6QEBJ5R+A4KzXauS14DJOe2NQamik93pPPAJ9ek=; b=LX92vduVXBMxRJnIsXJIWkVNJIclSAG9HJEDn0tF8JUlE1x2TiksC6NkslcOSI5J6S OoUBek9d7rHkLHO7UVsk31uvZi6CT890nIMKm6bY/5Wg9Td7Qy+7XMsAKVcbiS/8QcQo Rz0xx0bLBtiKZxZpBSGszF8BIT4j2w5dNCsCh65a81xjy27KsV9Gqb9TycnNcxZRt5Y8 N1ve6gqT6lN7pMyndA2wa6ogE0fo5UNoyDxRvXzONx3dZ++wFZGdjTe3kzVs9T4eOpi/ D7LjIO6SlQzg9xMB3on3AOF9EUEwMw259HNEueSq2J7GzyryoeR9aZEv6Gx1b5lJ5WOH Cg0g== X-Gm-Message-State: AOJu0YyGLjc9HNdAkLEhNRCqQYZ/3S7dYhyVZneWbqNN2RpgHNCiJv7k G3g8w7wR0ubry786YOe7IgYkKOHi79Dg1BOWKOVCrYuZHiLZ X-Received: by 2002:a1f:c1d8:0:b0:487:1962:7495 with SMTP id r207-20020a1fc1d8000000b0048719627495mr6886859vkf.1.1691470841920; Mon, 07 Aug 2023 22:00:41 -0700 (PDT) Received: from dxue-amd-5700g.libretech.co ([72.76.64.93]) by smtp-relay.gmail.com with ESMTPS id c11-20020a02a40b000000b0042911ed0da5sm584619jal.11.2023.08.07.22.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 22:00:41 -0700 (PDT) X-Relaying-Domain: libre.computer From: Da Xue To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Da Xue , Luke Lu , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] net: phy: meson-gxl: implement meson_gxl_phy_resume() Date: Tue, 8 Aug 2023 01:00:15 -0400 Message-Id: <20230808050016.1911447-1-da@libre.computer> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham 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, otherwise the carrier cannot be found: eth0: mtu 1500 qdisc mq state DOWN group default qlen 1000 After the patch, resume: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 Signed-off-by: Luke Lu Signed-off-by: Da Xue --- Changes since v2: - fix missing parameter of genphy_resume() Changes since v1: - call generic genphy_resume() --- 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 bb9b33b6bce2..bbad26b7c5a1 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; + + genphy_resume(phydev); + 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.40.1