From patchwork Tue Mar 14 13:14:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 69647 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1782406wrd; Tue, 14 Mar 2023 07:12:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8l5QJPV3HC/9+0IKTUKMmr8ENbf6G74/WmwN9czF4ASoseNiSWhVWcCBn29E5iKfMQ/1EG X-Received: by 2002:a17:902:ab97:b0:19a:e96a:58b3 with SMTP id f23-20020a170902ab9700b0019ae96a58b3mr31635830plr.22.1678803139484; Tue, 14 Mar 2023 07:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678803139; cv=none; d=google.com; s=arc-20160816; b=qYAyty3a36JYcPD/brAhw87K1w5BaBJ5RDNDHrwKuo+YCe19M1t2AaE+ixCA734cMW 59eFY44DN5cZCAsh0MT0urAVxCQFy2gcJADvPp3daF4O+a5TjFQTQ9a3VHAzNjZoT8FW nDC+AytGSJVwaLDq+SK44AjtfK3nk2effWzYRFaN3mLQFkkDJHCBy/kR+PQQN+ziWTGP oEyGOd4FT9J0sZlpvsIM2m6BSyt+HbUQvgVKS1DUC+I/4kgicIiXEY3fEBXTqtrqvR5c /j2LKs/u9xxJxcS0nKK+oPiolLdVHzWnaMbW6cFoel/DdjinNhkVJM3S5ApAaeKRaSwi YDeg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q8ZMw2KD5v3fCHjrS9Jk+uMrQDI3g1q9092LC222Wak=; b=WBraim9uFFmLytnl0rmPDUd+ZtQAOCGYOxZxdfizvptYvdWMl7Y+ynaO6olTWWtc/O cNSR26j0e/OvPkXfce3WAypLnaJYULkhZfvWrBoKJV3ResgUO8JvWCoeY0QTODPd9+IX AiDMRlatAY1vdOfVW3zvVkCsrxYsrhM5xtG6nsPboD27OGaeGf3phswZqaG5V1m+bRu+ 7dqyTFEI4Jqp50HHlPgCHZVGlFRstAmZNwOAUykw7TpI7MHylsTgKHjAnrWHLveVUxlG mmUrcqNpKTDrICkeAWJn90Bp/upwtIDvyDiJSwnRN0CxwsxvBN+sdUdG4OVvOOv/MjVd mbXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=G4U+u0yQ; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kc15-20020a17090333cf00b0019f269f06fbsi2471013plb.3.2023.03.14.07.12.02; Tue, 14 Mar 2023 07:12:19 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=G4U+u0yQ; 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 S232124AbjCNNTX (ORCPT + 99 others); Tue, 14 Mar 2023 09:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232008AbjCNNSp (ORCPT ); Tue, 14 Mar 2023 09:18:45 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C5CAB8A8 for ; Tue, 14 Mar 2023 06:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=5TX7Vu8A/Hblqz ptlgcq+EvT8rUB/Nkipsy3xPzbH9s=; b=G4U+u0yQCQSeXTUMeBLWkC3GwCba8V DIL81KqVgCbn8j9Wh09ol42vqzA90q0DCgeGWCMNXnHD9ryvB5c5XjxQPiRwXhca gJqVdSQl+rGuBQklmyQHBTWcWyk0W2QPmGtkON0jWKv3WhxxESNIRzEe1ezby1/U M/pyyUKzvaZQc= Received: (qmail 3111568 invoked from network); 14 Mar 2023 14:14:56 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 14 Mar 2023 14:14:56 +0100 X-UD-Smtp-Session: l3s3148p1@yjiKA9z2js0ujnvb From: Wolfram Sang To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Heiner Kallweit , Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geert Uytterhoeven , Florian Fainelli , linux-kernel@vger.kernel.org Subject: [PATCH net 1/4] ravb: avoid PHY being resumed when interface is not up Date: Tue, 14 Mar 2023 14:14:39 +0100 Message-Id: <20230314131443.46342-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> References: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760352680859942460?= X-GMAIL-MSGID: =?utf-8?q?1760352680859942460?= RAVB doesn't need mdiobus suspend/resume, that's why it sets 'mac_managed_pm'. However, setting it needs to be moved from init to probe, so mdiobus PM functions will really never be called (e.g. when the interface is not up yet during suspend/resume). Fixes: 4924c0cdce75 ("net: ravb: Fix PHY state warning splat during system resume") Suggested-by: Heiner Kallweit Signed-off-by: Wolfram Sang --- drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 0f54849a3823..894e2690c643 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1455,8 +1455,6 @@ static int ravb_phy_init(struct net_device *ndev) phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); } - /* Indicate that the MAC is responsible for managing PHY PM */ - phydev->mac_managed_pm = true; phy_attached_info(phydev); return 0; @@ -2379,6 +2377,8 @@ static int ravb_mdio_init(struct ravb_private *priv) { struct platform_device *pdev = priv->pdev; struct device *dev = &pdev->dev; + struct phy_device *phydev; + struct device_node *pn; int error; /* Bitbang init */ @@ -2400,6 +2400,14 @@ static int ravb_mdio_init(struct ravb_private *priv) if (error) goto out_free_bus; + pn = of_parse_phandle(dev->of_node, "phy-handle", 0); + phydev = of_phy_find_device(pn); + if (phydev) { + phydev->mac_managed_pm = true; + put_device(&phydev->mdio.dev); + } + of_node_put(pn); + return 0; out_free_bus: From patchwork Tue Mar 14 13:14:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 69626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1762424wrd; Tue, 14 Mar 2023 06:36:53 -0700 (PDT) X-Google-Smtp-Source: AK7set83lhoUtsoymbXjgyeCZz5OXEoKVQ5t79m1RM+00q0iXwx9pCiqrZXC+RvEyEmRZYb7ALy1 X-Received: by 2002:a17:90b:4d83:b0:237:b702:499f with SMTP id oj3-20020a17090b4d8300b00237b702499fmr38704252pjb.22.1678801012885; Tue, 14 Mar 2023 06:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678801012; cv=none; d=google.com; s=arc-20160816; b=LJZWFNNtg8zDmRVaesir6fUlEvL3D7XulP6Ca2r4Xh/pobxMOCXxVqkQZ/DwC4Kda6 Ph6MsNtetBzDeNldNf/NHmhw/EEhvAR22xwOHyIGabQyXuz+PkqIeoQdVCrejgy9S19N GyXvFJL7tJWfIxltZ0wxIc3591TMkjEtwiZAJZJGd3XLI2th6O6Acf4zcJYr94k4D/eg MRIsLuaj61ufumJ+zZAf0p6RHGDrZ1hbXdcXwoo3a7r4f+/Lj4K/Cq9R+9LCa/4obH/z 8qs8LvCMvKvTU7Wc0pY1TyttO+LpHE5gLcfCWJKzpZ6YhAoXO0s0tOsE45MTBejNXE6f VUCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w/RivlZ2yulGqu1VNHNJ3JcwBN7RwtUlOr9fHKec7K4=; b=P03PkHnDXuAX4HewYxG7VHaXbYdfvUA/GzavG7O0C9932IfTI0zHtfF4hpxmvte6uH brLQuFbi+8Va2n/4NTKnaJiSA886Tmv37nYZeGgyqRRp/6TLz+je6w/PjxTbjQAVFjag s0K1jO2py22nHA6VnyYM8sqeDb+ihMG7p7swn3PacII21vDIVXCi3DBusboraILT19vH d6mw9nUax9ypL3IHoXN11K/hHIgy+N+ZW7YydIU2P8dL076BllKVn1FlAbR9k9u9+5rl 19JvHKrlACuZ0bGH6IDbP9JIq28KBY1yd5/fsYQzUiUatQ8pyGCZHb+eukNOHTnTFc2A Q6bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=F2zKgF21; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a636b09000000b00507226411dbsi2338024pgc.224.2023.03.14.06.36.34; Tue, 14 Mar 2023 06:36:52 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=F2zKgF21; 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 S231309AbjCNNTo (ORCPT + 99 others); Tue, 14 Mar 2023 09:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbjCNNTL (ORCPT ); Tue, 14 Mar 2023 09:19:11 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 545131814B for ; Tue, 14 Mar 2023 06:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=tavda8UXLKrs9l ANFo8U4RN/BFpi0fs4WuVKPhmPVs0=; b=F2zKgF211WIEEAdGUWvHapL/d26hH9 GHKORGNixFd0+NOffB0rFLhuyGFsgRO9sRCrV3EEVZrA++DhZY6vzBNx3xh+u33w lBWL4ElLJYCoTcwNLafQpi/9fmN/7lJAenIg0eNIdAUd9Ezr2wpYcaTa7c5IBhSS g/ycwkUlajY+M= Received: (qmail 3111634 invoked from network); 14 Mar 2023 14:14:57 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 14 Mar 2023 14:14:57 +0100 X-UD-Smtp-Session: l3s3148p1@uxuWA9z2ms0ujnvb From: Wolfram Sang To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Heiner Kallweit , Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: [PATCH net 2/4] sh_eth: avoid PHY being resumed when interface is not up Date: Tue, 14 Mar 2023 14:14:40 +0100 Message-Id: <20230314131443.46342-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> References: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760350451132246846?= X-GMAIL-MSGID: =?utf-8?q?1760350451132246846?= SH_ETH doesn't need mdiobus suspend/resume, that's why it sets 'mac_managed_pm'. However, setting it needs to be moved from init to probe, so mdiobus PM functions will really never be called (e.g. when the interface is not up yet during suspend/resume). Fixes: 6a1dbfefdae4 ("net: sh_eth: Fix PHY state warning splat during system resume") Suggested-by: Heiner Kallweit Signed-off-by: Wolfram Sang --- drivers/net/ethernet/renesas/sh_eth.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index ed17163d7811..d8ec729825be 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2029,8 +2029,6 @@ static int sh_eth_phy_init(struct net_device *ndev) if (mdp->cd->register_type != SH_ETH_REG_GIGABIT) phy_set_max_speed(phydev, SPEED_100); - /* Indicate that the MAC is responsible for managing PHY PM */ - phydev->mac_managed_pm = true; phy_attached_info(phydev); return 0; @@ -3097,6 +3095,8 @@ static int sh_mdio_init(struct sh_eth_private *mdp, struct bb_info *bitbang; struct platform_device *pdev = mdp->pdev; struct device *dev = &mdp->pdev->dev; + struct phy_device *phydev; + struct device_node *pn; /* create bit control struct for PHY */ bitbang = devm_kzalloc(dev, sizeof(struct bb_info), GFP_KERNEL); @@ -3133,6 +3133,14 @@ static int sh_mdio_init(struct sh_eth_private *mdp, if (ret) goto out_free_bus; + pn = of_parse_phandle(dev->of_node, "phy-handle", 0); + phydev = of_phy_find_device(pn); + if (phydev) { + phydev->mac_managed_pm = true; + put_device(&phydev->mdio.dev); + } + of_node_put(pn); + return 0; out_free_bus: From patchwork Tue Mar 14 13:14:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 69646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1782404wrd; Tue, 14 Mar 2023 07:12:19 -0700 (PDT) X-Google-Smtp-Source: AK7set9VaafFK//i4K66qh6pFs1/m6PTdlGg4Fd5uXAcM6epgxJ4Z8+Y5pbpkOES9W4RXD9Yx+wv X-Received: by 2002:a17:90a:1b68:b0:23d:3549:82a8 with SMTP id q95-20020a17090a1b6800b0023d354982a8mr2822391pjq.27.1678803139411; Tue, 14 Mar 2023 07:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678803139; cv=none; d=google.com; s=arc-20160816; b=W+kp92mL2iXV6BhR/5d2fd3AIPEEUAhuXrw6h10lwnwVPO5DPIKrUfq3Lubd2pdlac 4ZmKOCUyN4im9gtL8UW8iV2L+0xKpj2AfBKa53aJt+6P/0lXxjuGkV02YkK4mLd6b8z/ Tnl7Q1okKJTLRhUN0Kx9E3Q748K9C3Na2d7Sz3aWrvRv9fNfTLKwBalT2Wo9yJ8ovqBa 70ELmXZJzCdERkVqiFc9eapNIBV+cJei+/d/Q++MCfPZrCEqmEjcCxlY72uGQ6f5c6Si nFke7bWhUxgDyuJi/2xwzmqxUXj2jV+3S3sjia+Sc7GpSE9Hv78jDgk2txf7PEXSgNiv tWMA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RiSanwVAUkwJArZ3vlmtfj9lZPx38Q9DUkTqqNZAtKg=; b=M97MqNCLQ55m3q7FW+ncTD3iK0K2udyYqOcZmra0/FU8+QgEALJUDY2L95uoXus14E baPVBkayxUzgmC12G0wRWmsrg1eRI/NHEsgnfQQV2dBsmZaeGds1WW9zdAxX63H5LYOg jVeJkW8Z0mfwHAz4RyI6FVZOU1PA8j1R5PbdLlBPDSVpjCSJh09pQkrXOdztQf+daCxj Yf9SnBTyf25MnSDcTTyUEaTxUFJ2UtXgai7o9vjGFAuKg3/tkyFgoLapqCurCdfV3ASZ 8mtt/101QMKsB/1p5V/CQw+b4qj21sY7xQdIm6eOyE67OWOaQqoCoPNJ+Muyux23TRMZ F4Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=EQCfCw6p; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a17090aca0700b00233cea2dab8si2541222pjt.121.2023.03.14.07.12.01; Tue, 14 Mar 2023 07:12:19 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=EQCfCw6p; 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 S232415AbjCNNTh (ORCPT + 99 others); Tue, 14 Mar 2023 09:19:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230316AbjCNNTG (ORCPT ); Tue, 14 Mar 2023 09:19:06 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C95279B3 for ; Tue, 14 Mar 2023 06:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=VjTn3E20TaRsaW HsM1MQTWl0oPBdqH1Fh0HrLM/sBLQ=; b=EQCfCw6pYRkDgljCsJYRNtEbYyyLTu go8Oyi1uENTxLGwzL8K5CG5Jl+he9MDhaqZsFZB78NH8WB6/Kn3YzIFuVdktfoqG 3WVDlFSuzWysobydUzl2tABDGnX05VuRwysFwLgGQKCk8YHpomsGfkx807wSDVK9 1QH62rX1QU9FM= Received: (qmail 3111673 invoked from network); 14 Mar 2023 14:14:57 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 14 Mar 2023 14:14:57 +0100 X-UD-Smtp-Session: l3s3148p1@5b2gA9z2ps0ujnvb From: Wolfram Sang To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/4] fec: add FIXME to move 'mac_managed_pm' to probe Date: Tue, 14 Mar 2023 14:14:41 +0100 Message-Id: <20230314131443.46342-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> References: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760352680702411972?= X-GMAIL-MSGID: =?utf-8?q?1760352680702411972?= On Renesas hardware, we had issues because the above flag was set during 'open'. It was concluded that it needs to be set during 'probe'. It looks like FEC needs the same fix but I can't test it because I don't have the hardware. At least, leave a note about the issue. Signed-off-by: Wolfram Sang --- drivers/net/ethernet/freescale/fec_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c73e25f8995e..b16f56208d66 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2318,6 +2318,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) fep->link = 0; fep->full_duplex = 0; + /* FIXME: should be set right after mdiobus is registered */ phy_dev->mac_managed_pm = true; phy_attached_info(phy_dev); From patchwork Tue Mar 14 13:14:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 69621 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1758333wrd; Tue, 14 Mar 2023 06:29:45 -0700 (PDT) X-Google-Smtp-Source: AK7set/bAl67uMsh5keKeUyYIChGT3CZPc32d0WenyKRa56gkvvn37lH44ZxxptC5LbD5cxiM2Zm X-Received: by 2002:a05:6a20:4c95:b0:d3:f5e4:f3bd with SMTP id fq21-20020a056a204c9500b000d3f5e4f3bdmr7371012pzb.14.1678800585425; Tue, 14 Mar 2023 06:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678800585; cv=none; d=google.com; s=arc-20160816; b=x2+U9Wk3STcHGKNMWmv0OzOHOa87Cv6SJeSSOwXgcQ/0HfA7X3e0rSN/gBG+vQBGzb ng3xyrYO/ZsxvqPWPGWJ+lQ3RXhCZGhs5hbX8BRw6Uw8ctLN0lM2X+iUXPvleyUKpUXF R2bic0PTP/XYUhW0sUCWQkt2VHL/XQSGSNSXLSNOxEBOV2H/y5ZMzCP0YUJjMJZgiIZk 1mDCoyA4g8DYCkhA/bdWJN5WhxektvmgKkaXqBUYl8swH0V8IpBcEDj0U4IhRTMHj7RA Wszy4h1CXn8aeB3oKaSFJu4442wqJeL/XVhGtCPsAKEH2ic/eg3oCYspr7as/vWsBI0E SFQA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/g5U2nBWFLu4oD4eRCa7XyeCkfe3WqX8PWsTADoukaw=; b=usanehJG2TtI2MBg25XrJ/YQJAiYN8Mn9DkMdLf/v5cohxeYcEtgVkoCCQWRPZXhvs vGK0U+phU2eG2PEZLzNKzHlze8MEGK1etAlSmcCqhdyxU8DFOI0x8TmffwwNEx7FhHvI wDYcS7y2Dt8QkouYEMQJ0PdfPNvgQlpWLQd3GKDl6Em4z7X7YSLpS9k2FbG5EJR0gMuL QAIfKFH0Q676sNvcEGDK25yyl3+Uyc7AG4txJsyxLK2L4P7itCPBG5e3p/hz7yT4wOHq gM9NoXyKWuqEPFXvirL5QEQiuthaaGIwA7uMz8DRwORQ++DbnTZpf0eKqGTVcRkK/d9g e6qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=ZvcXfLKA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a63230c000000b00502f3d1a058si2173890pgj.479.2023.03.14.06.29.28; Tue, 14 Mar 2023 06:29:45 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=ZvcXfLKA; 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 S232336AbjCNNT3 (ORCPT + 99 others); Tue, 14 Mar 2023 09:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbjCNNSr (ORCPT ); Tue, 14 Mar 2023 09:18:47 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755B1618B for ; Tue, 14 Mar 2023 06:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=SsTC9UU9wdPdSI 0PbPhntycZBlShn3e/V5pFPLMU5/8=; b=ZvcXfLKABiDC9npZb4SVa4ELduNGUH JYWlTOq5gC2b1Av3MwV0fQnLvYANm1jrF0pT40lXXp0CxRsKZsy3vYQ9Tq9h8aJr 28EY9RgVIc3Y//DR8263wPxS2Mdmzx+kTMLxVu0VBVJZZG9mv8UlX+qnZXcuzzXG m9CExX8bF7Wg4= Received: (qmail 3111703 invoked from network); 14 Mar 2023 14:14:58 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 14 Mar 2023 14:14:58 +0100 X-UD-Smtp-Session: l3s3148p1@fFKrA9z2ts0ujnvb From: Wolfram Sang To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Steve Glendinning , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/4] smsc911x: add FIXME to move 'mac_managed_pm' to probe Date: Tue, 14 Mar 2023 14:14:42 +0100 Message-Id: <20230314131443.46342-5-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> References: <20230314131443.46342-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760350002865069968?= X-GMAIL-MSGID: =?utf-8?q?1760350002865069968?= On Renesas hardware, we had issues because the above flag was set during 'open'. It was concluded that it needs to be set during 'probe'. It looks like SMS911x needs the same fix but I can't test it because I don't have the hardware. At least, leave a note about the issue. Signed-off-by: Wolfram Sang --- drivers/net/ethernet/smsc/smsc911x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index a2e511912e6a..745e0180eb34 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -1038,6 +1038,7 @@ static int smsc911x_mii_probe(struct net_device *dev) } /* Indicate that the MAC is responsible for managing PHY PM */ + /* FIXME: should be set right after mdiobus is registered */ phydev->mac_managed_pm = true; phy_attached_info(phydev);