From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CDFFC433DB for ; Mon, 4 Jan 2021 17:17:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B305224D4 for ; Mon, 4 Jan 2021 17:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbhADRQq (ORCPT ); Mon, 4 Jan 2021 12:16:46 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:48868 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbhADRQq (ORCPT ); Mon, 4 Jan 2021 12:16:46 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kwTSV-00Fzlp-99; Mon, 04 Jan 2021 18:15:55 +0100 Date: Mon, 4 Jan 2021 18:15:55 +0100 From: Andrew Lunn To: Ioana Ciornei Cc: Geert Uytterhoeven , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , Russell King , Wolfram Sang , "netdev@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] [RFC] net: phy: Fix reboot crash if CONFIG_IP_PNP is not set Message-ID: References: <20210104122415.1263541-1-geert+renesas@glider.be> <20210104145331.tlwjwbzey5i4vgvp@skbuf> <20210104170112.hn6t3kojhifyuaf6@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104170112.hn6t3kojhifyuaf6@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org > Ok, so this does not have anything to do with interrupts explicitly but > rather with the fact that any PHY access will cause a crash when the > sh_eth device is powered down. > > If the device is powered-down before the actual .ndo_open() how is the > probe actually setting up the device? Or is the device returned to the > powered-down state after the probe and only powered-up at a subsequent > .ndo_open()? > > Instead of the phy_is_started() call we could check if we had previously > enabled the interrupts on the PHY but this would mean that a basic > assumption of the PHY library is violated in that a registered PHY > device cannot access its regiters because the MDIO controller just > decided so. > > Can't the MDIO bitbang driver callbacks just check if the device is > powered-down and if it is just power it back up temporarily? Is this runtime PM? I had problems with the FEC driver and its runtime PM. After probe, it would runtime power off its clocks, making the MDIO bus unusable. For a plain boring setup, this is not too much of a problem, but when you have a DSA switch on the bus, the DSA driver expects to be able to access the switch, and this failed. I had to make the MDIO bus driver in the FEC runtime PM aware, and turn the clocks back on again when an MDIO transaction occurred. The basic rules here should be, if the MDIO bus is registered, it is usable. There are things like PHY statistics, HWMON temperature sensors, etc, DSA switches, all which have a life cycle separate to the interface being up. Andrew