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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30577C10F1E for ; Tue, 20 Dec 2022 13:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233392AbiLTNdk (ORCPT ); Tue, 20 Dec 2022 08:33:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiLTNdh (ORCPT ); Tue, 20 Dec 2022 08:33:37 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613BF18B3E; Tue, 20 Dec 2022 05:33:36 -0800 (PST) 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=PBKohcfzjSqRdddPpAv4Rwpq7IkcN9J0lMnnbLlGi0M=; b=Z9cx2J1jhbD8p1DOS0Grff44Qn 5pp0l9vnMbZknZIlhVTaanZNAJrZ7hCXkOyvCGELpS/Pddu7B5x6tOAS9riIEDi2hDtZzwdRJM4pJ gEzkqbDNXRr6j86EJFL6H8M5eVvVWpqemh0+HsOYXB8NP0WWF3NHGTrDjlOd63wlPkMo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p7ckI-0005gG-Lp; Tue, 20 Dec 2022 14:33:26 +0100 Date: Tue, 20 Dec 2022 14:33:26 +0100 From: Andrew Lunn To: Michael Walle Cc: Xu Liang , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next v1 4/4] net: phy: mxl-gpy: disable interrupts on GPY215 by default Message-ID: References: <20221202151204.3318592-1-michael@walle.cc> <20221202151204.3318592-5-michael@walle.cc> <69e0468cf192455fd2dc7fc93194a8ff@walle.cc> <34dc81b01930e594ca4773ddb8c24160@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34dc81b01930e594ca4773ddb8c24160@walle.cc> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org > > Yes, it is a valid point to do this check, but on its own i don't > > think it is sufficient. > > Care to elaborate a bit? E.g. what is the difference to the case > the phy would have an interrupt described but no .config_intr() > op. > > > > > I think a better place for this test is in gpy_config_intr(), return > > > > -EOPNOTSUPP. phy_enable_interrupts() failing should then cause > > > > phy_request_interrupt() to use polling. > > > > > > Which will then print a warning, which might be misleading. > > > Or we disable the warning if -EOPNOTSUPP is returned? > > > > Disabling the warning is the right thing to do. > > There is more to this. .config_intr() is also used in > phy_init_hw() and phy_drv_supports_irq(). The latter would > still return true in our case. I'm not sure that is correct. > > After trying your suggestion, I'm still in favor of somehow > tell the phy core to force polling mode during probe() of the > driver. The problem is that the MAC can set the interrupt number after the PHY probe has been called. e.g. https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c#L524 The interrupt needs to be set by the time the PHY is connected to the MAC, which is often in the MAC open method, much later than the PHY probe. Andrew