Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13971086pxu; Mon, 4 Jan 2021 09:18:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy//YHXI0XbhhRMhsOHh45p+renBfmmtamrLr+k5o8iIKiiz2JpNjvn8s1VtX9v3oE49+Dv X-Received: by 2002:a05:6402:b57:: with SMTP id bx23mr70629289edb.191.1609780682467; Mon, 04 Jan 2021 09:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609780682; cv=none; d=google.com; s=arc-20160816; b=NrR4aSerBbBGBL4RK7uSSCjvSCFodAgeS69Trijo1LMVhFQ8azD5zeiST6B0svP2tk 1V1Sx2KrW0OvHBtrkjxN3fr1B6yck+WfO3hRgwrzgeN8zHs+pTR4pYvgYWmwMaNq+zQc zFVP7fTuYMDnLMS1Bywu0jLX5GlYpxiqZc4IbSmeNhZe9WEscpcXXloSE/lww1tKBCZ1 HNNTg9suFh0CZyLstS9STKnrTgVfJEGziKM4SgIH2ILS+JKhbwE7M8JFc/vubL2xssP7 EJ8gQTfh/EF1FBH1iuramnZB5J1zXlM6lTZ+rExtXLRKL4GDab/g9Ki6Fjj+ti8HLebn S1/Q== 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; bh=JbU38rPvVg+j1G1eb6iKMs8Y0rbEu+EbALLw9lAyuFY=; b=FCHPJgWz2oUXJo5oqczPLk0u5HOyyHzN/1WTTrvb4DMYZur7a69yPd3j/kgv6fLwKv w8jUaZGlrOcXW4Uxv6FiPUrFPppScc0AJ4DuMcvdtqSSYoZb54xQj573mI8GcAmJu7Ib 4oN2BsX1k0tuFZnl5IqAJ0vp3gmZA3yYHxoPsErQFeNc711GrHn2t2N9FRiSrYn63hpD WQ+jMIjNrISOXs35S4K/7QdabBb04IQPDoBDnh5Zdq4eBz0otTkREU2q18ewR5icsZ94 aRyKL+NN3LD+lv8Ome59c588bMz5kLwIbOAiJa2lHT+C699+njbwqajJ7YHZ3CpR1Oxl O9RA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si30716553eju.355.2021.01.04.09.17.38; Mon, 04 Jan 2021 09:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbhADRQq (ORCPT + 99 others); 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-kernel@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