Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11141864rwd; Thu, 22 Jun 2023 09:12:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rVKrRxDyQC2gQ6IWRxN/CPtiUk79s+TRiWufhOl2+781c+vaqhXcRnJAsqwu3I01D+1ui X-Received: by 2002:a17:902:e88b:b0:1b5:5052:5af7 with SMTP id w11-20020a170902e88b00b001b550525af7mr17970641plg.8.1687450361220; Thu, 22 Jun 2023 09:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687450361; cv=none; d=google.com; s=arc-20160816; b=WO5kD4BAi65i8xMe82aoJNKcY8Q+ECgOg0Zp9j1zJix4TGiFmyDZgEQ37Y7bvB7Vgz RMePWxrlJBy9l9rAl/5c/s0SVcf1v6HiozE7+diowsVR/Ior2TMM3Rcgtvj8X/MbqXFi zTQFaBNtJW/m2fKDPuSz5PzaRYu1nuzEovuI+un6jTTs0ZzRRiRf12+C9Rwt5b4BVTc6 Bg3CmDroy4T4KDP/fI6425/qxdI92t3zX5pUiBDgqqPloHJ/p0d3VwKbj6jMUI4coyQb PAuozmqGwvJGn/CLzhBP977U2QgkpBAkfKhhONCUc/Rx1deaS+1OH2fIrLrbrpSQwBlS dJkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4lUNPdzeGRfvUv6WjT+IRwoZNLTeUVrgSIo14geZN8U=; b=KD3LlU2spDxM8m00Icvi4m3IohlH7IoI2ou85r9AQ8/hTCtrOYbspOnX5SO7k2/ugJ YfJ50ui4wt1BVH16ZT25Or8CsfHEzsPslY/sk1tNDPVfiqO2ScNtN73kuJmFkdSW5nuD XBCdzCgz6OkPPzSVa4CJuZRofnwKP5skLwNy6KMtD4qwKx732ZqcpoVdz1f4uzAMVQPI dblfsKDA875zsm76jgqLL43CgXO6m5gekxRUFou+GYI1+LzhOdHR51FxELytNIDqEYQD 9G+uXKivyVVbcTL3HaM8kCkgByAyfkxlldLv76Jwo3bWNhG/Wuh2uNORCpf/MYq5Siji XHuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="rT+/pP0B"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902d2c200b001b3a21fbb59si6111308plc.635.2023.06.22.09.12.28; Thu, 22 Jun 2023 09:12:41 -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=@lunn.ch header.s=20171124 header.b="rT+/pP0B"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbjFVPhI (ORCPT + 99 others); Thu, 22 Jun 2023 11:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbjFVPhG (ORCPT ); Thu, 22 Jun 2023 11:37:06 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173AF118; Thu, 22 Jun 2023 08:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=4lUNPdzeGRfvUv6WjT+IRwoZNLTeUVrgSIo14geZN8U=; b=rT+/pP0BC4mmt62uwzA4v1uCpj w3HdtFaJRe54kWXL6Dqf/7+4PgtV7oTVZg7JJ8Zp7KxuXEc1ikzrkm89gMzgObPTgJX5HdBueDsr2 sdRmqmTvEWW3U2L7l9u3nKQIJys+wFMkCUOU6eIidiVgFILQxwxTwcrmwKA9hSo1PKFI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qCMMS-00HHKJ-Mz; Thu, 22 Jun 2023 17:36:40 +0200 Date: Thu, 22 Jun 2023 17:36:40 +0200 From: Andrew Lunn To: Florian Fainelli Cc: netdev@vger.kernel.org, hkallweit1@gmail.com, ansuelsmth@gmail.com, rmk+kernel@armlinux.org.uk, Doug Berger , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: Re: [PATCH net] net: bcmgenet: Ensure MDIO unregistration has clocks enabled Message-ID: <533872e1-b323-4bca-aacc-4d3cfbed53bd@lunn.ch> References: <20230622103107.1760280-1-florian.fainelli@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230622103107.1760280-1-florian.fainelli@broadcom.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Thu, Jun 22, 2023 at 03:31:07AM -0700, Florian Fainelli wrote: > 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. So this clock is enabled in bcmgenet_open() and disabled in bcmgenet_close(). The assumption being, the MDIO bus is only used when the interface is up. How does this work when there is an MDIO based switch attached? I had similar problems with the FEC and mv88e6xxx. DSA would try to talk to the switch with the master interface down, and MDIO would time out. I needed to add runtime PM support to the MDIO bus ops. Andrew