From patchwork Thu Jun 22 10:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13288976 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 BB87C1DDD8 for ; Thu, 22 Jun 2023 10:31:26 +0000 (UTC) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C1CDD for ; Thu, 22 Jun 2023 03:31:25 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-62ff6cf5af0so61544636d6.0 for ; Thu, 22 Jun 2023 03:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1687429884; x=1690021884; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=2WwZvskzszM94kPPJ2VwvQaYwPeNbrtdo40BlBksq5A=; b=fSYkmbaAk/BURnMiqDo9M7xxAG+3n02b/ly6+eD6KBJ433EXTqVjpHmlmOLdNLM8ma RMnr5O7zTX4a5fNYXgVgeyQXUZIylZ3EM65mRjWfHMvkB130txehUdtdGxPJp/2IcQnm YFspktl9kGnH/GHKxkO7IPxHlvvKxRgApAyPg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687429884; x=1690021884; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2WwZvskzszM94kPPJ2VwvQaYwPeNbrtdo40BlBksq5A=; b=NZH41NysN9U/77JoyrW5SD49mxZAsB+RupOKZg994BTxleCrx7ufPqN/PFILWUvgax 3XeFK5E33BQG8BWIXub7cATO+dImggew1YZBHnoodYgWFmSekA2fnHdjiuE7qM9XiwVD /pAs/BnFaD7tSRGiVbRurieca/E/b4UdzEFUsf/U5lCwSWBpdksfiCAuVthnTst62/7n PwVSUc8K+41LGoe0H3aiW33T+d9LWVX2MjtvsA6/kaoQ0yIdbQb2Tnj4xsESB9wG+5Ul lCh/cxkqbce8o7kcGaewFlyRScY8NZwkr9kHR4TAtiwdiMcArgQ9BsZZxcEaBd1hGSb0 s5vQ== X-Gm-Message-State: AC+VfDwszDph+Bf2E9McybMysVpUmHf2LaQW0qD+zCKPvJj62Fk+XHgR mwNIaz6R9KEuswFUtGjYef74Iz1Eq3sMKbneDPj0j+JRUpdHT4uc3SnRCIM/Mvd7pwsiZezcgI1 mDrKGhN+Ag4j7fhLFmU+LUS3zK3gsMAqBY3p7onrZxCzuBCiopFi+1ca0yRYgEfOIuSSTspqhex h6J0xYi0/uwC89 X-Google-Smtp-Source: ACHHUZ56ffB6zYKu8ckGo7BS94w/z2e1VoYo6aH59bRYiHrnjyXl2rGZZvaCQZnPhBafTfsfxW4xyQ== X-Received: by 2002:a05:6214:1c85:b0:623:8494:9946 with SMTP id ib5-20020a0562141c8500b0062384949946mr18779649qvb.45.1687429883773; Thu, 22 Jun 2023 03:31:23 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id g13-20020a0ce4cd000000b00631f40503cbsm3660627qvm.12.2023.06.22.03.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 03:31:22 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, ansuelsmth@gmail.com, rmk+kernel@armlinux.org.uk, Florian Fainelli , Doug Berger , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net] net: bcmgenet: Ensure MDIO unregistration has clocks enabled Date: Thu, 22 Jun 2023 03:31:07 -0700 Message-Id: <20230622103107.1760280-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_NO_TEXT, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org With support for Ethernet PHY LEDs having been added, while unregistering a MDIO bus and its child device liks PHYs there may be "late" accesses to the MDIO bus. One typical use case is setting the PHY LEDs brightness to OFF for instance. We need to ensure that the MDIO bus controller remains entirely functional since it runs off the main GENET adapter clock. Link: https://lore.kernel.org/all/20230617155500.4005881-1-andrew@lunn.ch/ Fixes: 9a4e79697009 ("net: bcmgenet: utilize generic Broadcom UniMAC MDIO controller driver") Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index be042905ada2..c1d670c92958 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -668,5 +668,7 @@ void bcmgenet_mii_exit(struct net_device *dev) if (of_phy_is_fixed_link(dn)) of_phy_deregister_fixed_link(dn); of_node_put(priv->phy_dn); + clk_prepare_enable(priv->clk); platform_device_unregister(priv->mii_pdev); + clk_disable_unprepare(priv->clk); }