Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp67998lqi; Wed, 6 Mar 2024 10:12:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVD4OP3xtrKoSQFhqDZAgExaI9CuWQfyjPL7M7+CkeOCmBh7KZV4oHhruD0cWca4SvyhOalMl9qhdoSjask1R5HYiXdqrN2VJGjp0gkHA== X-Google-Smtp-Source: AGHT+IFqWULSM+ccECGnqWuz44F6tLlRlgWh0AI11RpSp6FPwr4rHFvJSP2I1VjCv6BA5jLLs4ZV X-Received: by 2002:a05:6102:c93:b0:472:8dbc:b26b with SMTP id f19-20020a0561020c9300b004728dbcb26bmr6988693vst.8.1709748746778; Wed, 06 Mar 2024 10:12:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709748746; cv=pass; d=google.com; s=arc-20160816; b=Z2Jf5FXabkE8gpDrcsVuL0varf/xvI2irxEy5J2PmtF0crCMBbhQls+bAK37qy6dpt POixJ3kEk7/xThp9j3mzc0zPOR+786X54l3QLMd9sg9KPanZ8pQDKDArhVwo/XU8aR5L BorOqGxsaGDmkLdKfWSex7iEnLaJwW5V6xfUQeeExOqUvWVO4wXAsUqTvgU6uBKf0rCJ H4bYQv/UeGwLRQ6dd5htfe559S/u9IhgyYtmnyxsC3/vbe5ZnhTKfAbHtKJ50qMKuWaH 1KR83X9qs2s9KlNtMwpvFs66jXYGTf3G8nlvIfj3dqNXo+IMIMobKvgwSpdHuCaL2/p2 j8bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=K7V4qbK+9Vqy45G8cyaay+aCmjgPiYkcXrXzLVeNz6w=; fh=9LPfXliNQYWKOBVnzHlfZVy6mCY4AnMThlJCyk8DzEk=; b=Q8+6dt3YE5IgolWnMrpcPYr3HswFVKuQ6/FnctEw7jYN0gKVy8Roqejndu5DzsBbVa w+xhTeC0xkfLn/inQgYM4+KIHCO8W0x/Y6hmBbkvUe1idAYn8/xQyPq7tcEseN+hSUlH NPVoKRMHaEjd/584dRYeWLmc8X0YDZV9N5qjLUAhvuQDNxSiTOyPKG87326Xa53RyQqC sDoE2Zlmx2KZy86N3achsIkN5qu9BTd/k/hpCP4GH1tk1CfFK2Cxvr8DEzbWKhZbVJI8 ni8WMGgCwNID66jPcSqrtSYwTS7U32hOLAAPsL6Ya8v3BP4b0XWdTLZ4UZ5/PTaPm8+h XQNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cS+M8Tc7; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-94374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94374-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id df37-20020a056102442500b0046ee5699f4csi114266vsb.48.2024.03.06.10.12.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 10:12:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cS+M8Tc7; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-94374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94374-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7CAA21C213D3 for ; Wed, 6 Mar 2024 18:12:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D57E14404E; Wed, 6 Mar 2024 18:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cS+M8Tc7" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52B9D135401; Wed, 6 Mar 2024 18:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709748346; cv=none; b=CqFTRQPG5kkRlua1EAJz/yAfjB7ZrqcJPD/vjRrYU38yW/heeTHSB7oPmAFnvLLFAFzsMwHixtIg6Ja/rdldjbIHn6OTucV+8z/VHDotFBuzPbyieTZQl/DjECS7xcBZm1LZ9KHls2/VQZOHLOZBqX3/FZd7HYYCjlCE8ap2yAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709748346; c=relaxed/simple; bh=fWOah0GcpAzkndjnpPl33ZP1z9GHtzVEvCqBK+JKfYQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tkBohVrLSrmp8vRQ+px7UCAGf3Pl0XUw5GHyUm6iMq5xML7cHtqeQvS4wdbyD8C6IHp8tV+YCD6WlaAALzZD8qX6MSzkDNZxOQaZarpH2Z23KUP7lNYbwyNim+zxGkwppgs6XI8F1y2/hdI1DOajLfZl6ndl7w+HyLRlMOUneR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cS+M8Tc7; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 8B18D60005; Wed, 6 Mar 2024 18:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709748342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K7V4qbK+9Vqy45G8cyaay+aCmjgPiYkcXrXzLVeNz6w=; b=cS+M8Tc7OOoISdmknCuzeydsnemFUlj4RLRLCYfUD84udWbpRyf32iiA8m0eC1Phl0Y07m 8yiIbBmC9AMLt6KJmm/zHDPCYStyprxWIWLQPRMfRdWCffErLbQLCrLtKJoFNcRdCvgKPc EiKXFgO8bKaf8EsTsnAHf14XIJwvGbuscQZexRbAia0Vt9f7j5Y9dRWOkOPTX4XQl/TkUM b8ifkGb6yMn6xx6vis3LzEft3/tGuDPhgNqDLxUP/6DpcNpixWbkdo1ovVI8vrIjzZfJMq 2rAEm2LhcxE9IEHRAVZl2WDoH3LPPgviatE8b0JljooaRPqogGdqzZSXaMv1/g== Date: Wed, 6 Mar 2024 19:05:39 +0100 From: Maxime Chevallier To: John Ernberg Cc: Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Heiner Kallweit , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Andrew Lunn , Russell King Subject: Re: [PATCH net v3 2/2] net: fec: Suspend the PHY on probe Message-ID: <20240306190539.4ab9f369@device-28.home> In-Reply-To: <20240306133734.4144808-3-john.ernberg@actia.se> References: <20240306133734.4144808-1-john.ernberg@actia.se> <20240306133734.4144808-3-john.ernberg@actia.se> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com Hello John, I'm adding Andrew and Russell to the thread as PHY maintainers and reviewers. On Wed, 6 Mar 2024 13:37:45 +0000 John Ernberg wrote: > Since the power management is now performed by the FEC instead of generic > pm the PHY will not suspend until the link has been up. > > Therefor suspend it on probe. It will be resumed by {of_,}phy_connect() > when the link is brought up. > > Since {of_,}phy_connect() and phy_disconnect() will resume and suspend the > PHY when the link is brought up and down respectively, and phy_stop() and > phy_start() will resume and suspend the PHY in the suspend-resume paths > there is no need for any additional calls anywhere. > > Signed-off-by: John Ernberg [...] > @@ -2539,8 +2539,10 @@ static int fec_enet_mii_init(struct platform_device *pdev) > /* find all the PHY devices on the bus and set mac_managed_pm to true */ > for (addr = 0; addr < PHY_MAX_ADDR; addr++) { > phydev = mdiobus_get_phy(fep->mii_bus, addr); > - if (phydev) > + if (phydev) { > phydev->mac_managed_pm = true; > + phy_suspend(phydev); > + } I don't think that's correct. here phy_suspend() is being called before the PHY got attached, so the PHY wasn't initialized at all at that point (which I guess is your issue as the PHY is still in the state it was configured into by the bootloader) Following the code paths, it looks like this works for you because the PHY you're using has a .suspend callback populated, but for any PHY that uses the genphy driver, this will do nothing at all (the PHY isn't yet attached to the genphy ops, therefore genphy_suspend won't be called). Best regards, Maxime