From mboxrd@z Thu Jan 1 00:00:00 1970 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 0734DC001B0 for ; Tue, 8 Aug 2023 05:01:17 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From: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=i3hZtwKtEtWe2lCz7/bMhppwRulPFdEBKL64y+i+mag=; b=xXHfloeOI7fHeC FjTFakANSW2ukbnXJJlXR80P7Rc0fVYX7j1SJYKVhP26DePAsue2GsnFW0Wy5CcpjgASRLIevChdN T8SfMiSKiQDUqb/34UIxxDhj6vg8hpStgAmqEcJSZbYZZgRTbMVLgNxFSLxW6OgMYlclvNbw1PMGn qogd5zBYTpk0AMMe7slaYjs1zVicfw42+m3CwFV7nlnbh2bqvt/wzcfbNfQfeh7ROX51HLPYnmJVY APacxH/++RitY8xkEslriDBijTVOMOeFAf75anOug6uJPFvHfAZio0qy93jyBO1EsMWV8DWFro+sX mFZRPmLkmRxWaDD3F2cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTEpq-001jwl-2V; Tue, 08 Aug 2023 05:00:46 +0000 Received: from mail-ua1-x961.google.com ([2607:f8b0:4864:20::961]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTEpo-001jw7-12 for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 05:00:45 +0000 Received: by mail-ua1-x961.google.com with SMTP id a1e0cc1a2514c-791b8525b59so1954089241.1 for ; Mon, 07 Aug 2023 22:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691470842; x=1692075642; 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=DtCxRcMkLQ/R+ymX7FzAMJS99OZMN05pESUIfkD2jM0AzNyECi2mkyBe6/NfCcWa8l 5pas6dYbyCFUoUyTWelW+4XVIXuhWBZkoQgHo8yD65d12AeXBQQ6NgAp8MijmIHtpjvL 1lM9ZtmsLoArXN9CFEludqtQRCnS/t+3Mmj8MaKNtG/toPS6qisTODrSIB8v6iYwRgIC 8QRwq3TZlaIowc9Plptkrz81wU6rg83xuvehrR1lNBKCDQNkkQI3vOjSKabwhZn8TpCt SnbX7bEIKbJibCHasId34cCC3Z0GltGB5t3ruwhgrgi3bpiitgAxDray52bHQBVomaf/ JbCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691470842; x=1692075642; 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=MexAeFkwRyiHau7UTyuqg1pgCDGMEgfWwTprJvlbSgjkk9Dk9FV1vD1pUKahohok4Y uZZx5w/2oENjIlNjJawVTVvBDY1q6awla8kldI75tusheUPfn68Rk5I9rlxhS7VNUzyS hiPRmGg3UsLecvhxHuHCZK+O4S7712YSuhQD3mc3siUZA3I4BKFrgB2PhoKLl4XYzlhe LrDQV4HdYirabgEki6UCvtPhrwqOA7tiFvQPo6RDbCD6OHhFeU4MdtfBzwbzJ9uk6Xsn b2UOthRy0i2mvNiKMYqN/BJO2yG2GT1EvJf/LDOK4jQHENzul5Frai9gFZfcg5sX0Zc0 36Ww== X-Gm-Message-State: AOJu0YzANaKQrJo2mf/nlN3wHtfqji2YPTTbZ3OU69bNIDVP6ace9xP7 /EiMHhhVodvC39qKPrwaFBs93W84BLdtzt6mLtYG08NN/NJe X-Google-Smtp-Source: AGHT+IGOiebSl22GAJa1Vqszzuk5r+Le/tkscMQwKLAbyswQsnfaT24eZusPYQGYRv08JMU2SVc/f7X59f9M 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_220044_388334_17D269D6 X-CRM114-Status: GOOD ( 14.42 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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, 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel