Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp341744rwb; Fri, 4 Aug 2023 13:44:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEViwP1rvNrvaPxCenZ2UPj19zvXtWnV7gMsOztB4JOwUug67jLYsup5eZCsts1mwOHzycV X-Received: by 2002:a17:903:1c3:b0:1bb:c896:1d91 with SMTP id e3-20020a17090301c300b001bbc8961d91mr846569plh.31.1691181861787; Fri, 04 Aug 2023 13:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691181861; cv=none; d=google.com; s=arc-20160816; b=XJHIoEYQ+kyc9Jn9Js10xwWalOCLzNY4SX6Pn81dkkmXniMULIhZnp1uSkzryu75AV vydndOWm16Etwk3NB0uSsZTFIOWI9+gKA3pJpji4s08F5jHwDzq0iv7f65fpKN9EWmQS HFzyc3Dg2n6N7A5fk26URp8HY8FC4xefL7H7HXKF0Nsr1IvABTJwmRIfvqbk/ekwlRGW TTcXNi97HoMh8A/l6kXGRBP2CFSy4xZQ2s8m20TesqnB4WvR5wPJljbETeh+xhM1D8Tr Vsz++uxXwcp1VPR3qszq0sDjxqjkXvZ2OcFK04s6xgwsSdu2dTO+qwfK48JGCgUMsAj4 ew0g== 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=LQFjBf7YtxXmJlSdHAu4ArmD+GnCH3KaGA7nl8cwkTs=; fh=bUtrPNdVcdvWUPwLOlUZfmZgIpdeo1FKbHEQ2oji7j4=; b=Pq9UxHIu4NEcobQYNPFO36nERkBJdmeScwZ0f/K0B1BNt8OXQZPh2v3xI4mbCN3FWJ cWDz4IBRciw6w61qbRp/gOX6uHDz7lBlYvj8ZRkbj3zCaaqvgDd6ZSLzsoxf+BKsWhmN NHSd9Ng4O0jpqUyWP07+r31wOxpSBMngaigOwYAtaCZ6lQx5qiLV9+kJQHNRUkwe17Ir xnE7vbwCGUtp2LEovWRzlkvnx1HEeU2NS70ZI6j8sYdwomZof/vJ7XYOYcEvwLyBNIG3 be2dYElRdzDI/bc4Q5HFQ9DS2BJ2s9cRKdYbAknoLtebeSlFQNirODtzMNWbU7Y9aPPa xgHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=UtRNJsHx; 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 jx11-20020a170903138b00b001bbf89feae3si2097222plb.600.2023.08.04.13.44.09; Fri, 04 Aug 2023 13:44:21 -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=UtRNJsHx; 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 S229763AbjHDUTS (ORCPT + 99 others); Fri, 4 Aug 2023 16:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjHDUTR (ORCPT ); Fri, 4 Aug 2023 16:19:17 -0400 Received: from mail-pl1-x662.google.com (mail-pl1-x662.google.com [IPv6:2607:f8b0:4864:20::662]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0BD4C28 for ; Fri, 4 Aug 2023 13:19:15 -0700 (PDT) Received: by mail-pl1-x662.google.com with SMTP id d9443c01a7336-1bc3bec2c95so17531995ad.0 for ; Fri, 04 Aug 2023 13:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691180354; x=1691785154; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LQFjBf7YtxXmJlSdHAu4ArmD+GnCH3KaGA7nl8cwkTs=; b=UtRNJsHxz1UB+ekhwkbt9C6Dtk5h5XbMoumFtaOzkQEv7IxKftbaDFQN+lTKl/AbZq bbotrbh+PtwAHlsbd7VATsfzrz4K1LmfvsCb3eTyJ03K6PP/cWp9eLArYWEztxFf9mZu qakKdMsiXit6f/0Nrst3iazklcxEc0oshWrHoAkQBb9D9X+VIECWWFqTVMAfKzLyijTz HQaJGrX0+fu0JdVokc6FczhJrI7skr833dGmXo9fTWsYTy7aaCN3wihbZeuCJfUgouab kiyKrKRSQ5MPhOmof8V8SGYdOb1EbVdrzpXF7MfbtyK1eh6+GIxlxUO2eZm3Kc5enz2s HEfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691180354; x=1691785154; 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=LQFjBf7YtxXmJlSdHAu4ArmD+GnCH3KaGA7nl8cwkTs=; b=lKzvCYyzR3IfNglQjZn1PTwxw6IZKeGlOVoLtgRQN79KvBHBwDfLLUJt9Dy5qOzSFj cvoXtWPd2hwc89rKCp4gfXdDszxGGWzq07chY167GB7Bbi52f7aWCWYzS4NY3KwiIuDV udGzk2Jb3SbbPob9tRorF/VhUu3aaA5mjoYn/awIkkvHcbOS+Mht1Cw3irUUECcgEuoy 3nXFnblq5L6VLUSEP65ivqs9SYDRBuaIP8oFWAfCGzgj/oeSLRoIihG9H0/+FwFGE+tS LNinOUnkRMZt6iR1+nBcOI8LgEKvOwwTS3KAiI/ojeWzVPRNYUdzDI2ToP1JeVivfeCP XqTw== X-Gm-Message-State: AOJu0YxVFil/kyTwAggbWYpA8X9GJfbVdCGmL7dMPPdOg+89404EsTU5 7YG8e+Q2dJB+kdO1Y11nDl2Dk4rKYBnqrZt//RirsfQ6t9cT X-Received: by 2002:a17:902:f551:b0:1bb:c7bc:ceb8 with SMTP id h17-20020a170902f55100b001bbc7bcceb8mr768160plf.22.1691180354378; Fri, 04 Aug 2023 13:19:14 -0700 (PDT) Received: from dxue-amd-5700g.libretech.co ([72.76.64.93]) by smtp-relay.gmail.com with ESMTPS id q7-20020a170902a3c700b001b9dbb0e802sm377270plb.137.2023.08.04.13.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 13:19:14 -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] [PATCH v2] net: phy: meson-gxl: implement meson_gxl_phy_resume() Date: Fri, 4 Aug 2023 16:19:02 -0400 Message-Id: <20230804201903.1303713-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 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..2df516ed4 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(); + 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