From patchwork Thu Feb 29 10:53:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ernberg X-Patchwork-Id: 21143 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp308930dyb; Thu, 29 Feb 2024 02:53:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUe1n30IJu3HohD2mgRoWQn/Q3skulFp6YG3XKW7edGEA2zcHAISrhOFvIb/IkF5NDGpZFu1VaXV6RGTAjjXTsgkl/cfw== X-Google-Smtp-Source: AGHT+IE1veBP+oMT89KXLqOHt6kKff6DtdREOkfo8nRGH0eQg3Io+I3LOywuWeJ6JvICTkoBa7R6 X-Received: by 2002:a17:90a:fc94:b0:299:d17:a558 with SMTP id ci20-20020a17090afc9400b002990d17a558mr1757580pjb.21.1709204038152; Thu, 29 Feb 2024 02:53:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709204038; cv=pass; d=google.com; s=arc-20160816; b=tjx2iBFD61KmnNoaEtXcO/w/atZTuP+BNhRVeKYmLMIcmJB8RjjRU1AW8DObH5yEZN usiIiL+8QNjkOuZytzTztyKn88nZ8GrPENwvfxnh+tU9PRt50uoudJjTEvWPIPtLeQqt 1ZYzLByJXmIofGK3OChsHKuaeVGKWuNFO6BdujyIqogkqGWleIi1HXiD5RbyVk9hAncr hoC5tA2nwIvhePEcfyDbKCTS9ZGA6c2CigIGX/NZbhgIW4TNNUg8Sy4XsNj6PPju5D3R E3Er+d9FPImba9oS4jO4uP4+4OKPH2geJT7dmLYYyzEOS7/UpFUqMn8FSX007izIRNna AIHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=0uibw2WCgfCnb18i+8RwvUUHMU+2xtcMcjP/xcb+j84=; fh=CrDPfPlgkeovG7op10fbcGzHGY6r1dnuK3p4aI6pv3Y=; b=o08Jj7FxKZpp0rNwIJH/e2+3rEAjtPcgXDP0ewkpp1bwvrzcvr/Fw76103r1QKjT7h v9FYE8b6emBG1JgNBmNh6qzLXq8J7V6rIxcP2J6NAfZIFHt1jtiS+eH/pJUnQKI279SK yJZSJAoRA2jiGw31a8f29IgqRkLiNt3QgHLksVOoreuM+C1Mj3D5zffOzzqIPzy/zfhy 7NbezymuxLgkd20xe8gsMFQExN9D907rGNJP5kybmJ2Libc+UgArTPNm+C41ruo9FJFK aBOu+e7SApDeWIwINzmdKzoKOEYEbTFY1qNyvWTGZmJrzs0aoT4LoCIPkadhGImlBSQ4 mpNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=actia.se); spf=pass (google.com: domain of linux-kernel+bounces-86582-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86582-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id sb4-20020a17090b50c400b0029606bc0b08si1260109pjb.171.2024.02.29.02.53.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:53:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86582-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=actia.se); spf=pass (google.com: domain of linux-kernel+bounces-86582-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86582-ouuuleilei=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF4A8288DCC for ; Thu, 29 Feb 2024 10:53:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 533A27AE6A; Thu, 29 Feb 2024 10:53:29 +0000 (UTC) Received: from mail.actia.se (mail.actia.se [212.181.117.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DE4F79DCF; Thu, 29 Feb 2024 10:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.181.117.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204007; cv=none; b=nI7ZAHuERxihbUKQ4gdMB2F2EImRvq6Ln7rjDYCOHvfkvFaIxPDdKMQDmimKkz+Vbcvg3nTTbi5mld9n3mAeS0jllGCFQarStTdzkAwBVGxWeguBVR2LSjjurwzHmbo4bMjeW65tWyquscH5oD8/XN8CKG55eWdj2wHODfAdoXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204007; c=relaxed/simple; bh=o7cbmOCpAyj2Lh1VjiptfXjVn33mIRYdRiUPQYlEcn8=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=MIsYusJujqmD5K6ob0r01Ms/A/ss/DKBRMiTo7rSx/kWd2Q0u9QuWYapb/Fnoj/N82DKYMgdHsGS96pSrbo9xOhsyiYIK4X3sROp6U+y+bk3OsQkqciP2PWrPrrXz8O9Fb9Zq4oRp7BSbwRHqrQhbSjVxpf2MvUIrWHHFEnDkfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=actia.se; spf=pass smtp.mailfrom=actia.se; arc=none smtp.client-ip=212.181.117.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=actia.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=actia.se Received: from S036ANL.actianordic.se (10.12.31.117) by S036ANL.actianordic.se (10.12.31.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 29 Feb 2024 11:53:15 +0100 Received: from S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69]) by S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69%4]) with mapi id 15.01.2507.035; Thu, 29 Feb 2024 11:53:15 +0100 From: John Ernberg To: Wei Fang CC: 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" , John Ernberg Subject: [PATCH net v2 0/2] net: fec: Fixes to suspend / resume with mac_managed_pm Thread-Topic: [PATCH net v2 0/2] net: fec: Fixes to suspend / resume with mac_managed_pm Thread-Index: AQHaav1+R0XAsBAPyEuuMQx/2+BDqQ== Date: Thu, 29 Feb 2024 10:53:14 +0000 Message-ID: <20240229105256.2903095-1-john.ernberg@actia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.43.0 x-esetresult: clean, is OK x-esetid: 37303A2958D72955637266 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792230333481422590 X-GMAIL-MSGID: 1792230333481422590 Since the introduction of mac_managed_pm in the FEC driver there were some discrepancies regarding power management of the PHY. This failed on our board that has a permanently powered Microchip LAN8700R attached to the FEC. Although the root cause of the failure can be traced back to f166f890c8f0 ("net: ethernet: fec: Replace interrupt driven MDIO with polled IO") and probably even before that, we only started noticing the problem going from 5.10 to 6.1. Since 557d5dc83f68 ("net: fec: use mac-managed PHY PM") is actually a fix to most of the power management sequencing problems that came with power managing the MDIO bus which for the FEC meant adding a race with FEC resume (and phy_start() if netif was running) and PHY resume. That it worked before for us was probably just luck... Thanks to Wei's response to my report at [1] I was able to pick up his patch and start honing in on the remaining missing details. [1]: https://lore.kernel.org/netdev/1f45bdbe-eab1-4e59-8f24-add177590d27@actia.se/ v2: - Completely different approach that should be much more correct (Wei Fang, Jakub Kucinski) - Re-target to net tree, because I have fixes tags now v1: https://lore.kernel.org/netdev/20240212105010.2258421-1-john.ernberg@actia.se/ John Ernberg (1): net: fec: Suspend and resume the PHY Wei Fang (1): net: fec: Set mac_managed_pm during probe drivers/net/ethernet/freescale/fec_main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)