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 C6C8AC352A1 for ; Sat, 3 Dec 2022 20:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbiLCUh6 (ORCPT ); Sat, 3 Dec 2022 15:37:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiLCUh5 (ORCPT ); Sat, 3 Dec 2022 15:37:57 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ABBEFD2A; Sat, 3 Dec 2022 12:37:54 -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=rPTn3eQfU4xquGlMEzeTTkP+ED6yH76zbYeY/hijclo=; b=ULBFlNX00q7GtyrusWgSAGgx/B 8I4+52OFIqQL4Q6VGdt/yffE0QToTqmAX7ZNUyLxXp6wbETr5yzbGrQ+vvbFqw9ceOyPP6x+VT6v1 JHi+nO9I3ToPhDr/mWMekf9k6CBJhKfv+tHckmfswn7v4WEidz8o2Wv4WPnu1dp2pd5k=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p1ZFh-004Ho9-Vo; Sat, 03 Dec 2022 21:36:49 +0100 Date: Sat, 3 Dec 2022 21:36:49 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69e0468cf192455fd2dc7fc93194a8ff@walle.cc> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > > @@ -290,6 +291,10 @@ static int gpy_probe(struct phy_device *phydev) > > > phydev->priv = priv; > > > mutex_init(&priv->mbox_lock); > > > > > > + if (gpy_has_broken_mdint(phydev) && > > > + !device_property_present(dev, > > > "maxlinear,use-broken-interrupts")) > > > + phydev->irq = PHY_POLL; > > > + > > > > I'm not sure of ordering here. It could be phydev->irq is set after > > probe. The IRQ is requested as part of phy_connect_direct(), which is > > much later. > > I've did it that way, because phy_probe() also sets phydev->irq = PHY_POLL > in some cases and the phy driver .probe() is called right after it. Yes, it is a valid point to do this check, but on its own i don't think it is sufficient. > > 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. Andrew