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=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 A2408C388F9 for ; Wed, 4 Nov 2020 18:10:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61FCD206FA for ; Wed, 4 Nov 2020 18:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732300AbgKDSJ7 (ORCPT ); Wed, 4 Nov 2020 13:09:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbgKDSJ5 (ORCPT ); Wed, 4 Nov 2020 13:09:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B4EC0613D3 for ; Wed, 4 Nov 2020 10:09:57 -0800 (PST) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaNEE-0007Hl-Ee; Wed, 04 Nov 2020 19:09:50 +0100 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kaNEE-00049j-16; Wed, 04 Nov 2020 19:09:50 +0100 Date: Wed, 4 Nov 2020 19:09:50 +0100 From: Oleksij Rempel To: Ioana Ciornei Cc: Andrew Lunn , Heiner Kallweit , Russell King , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ioana Ciornei , Michael Walle Subject: Re: [PATCH net-next v2 05/19] net: phy: at803x: remove the use of .ack_interrupt() Message-ID: <20201104180950.p4bqar7v36aougcz@pengutronix.de> References: <20201101125114.1316879-1-ciorneiioana@gmail.com> <20201101125114.1316879-6-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201101125114.1316879-6-ciorneiioana@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 19:09:27 up 355 days, 9:28, 376 users, load average: 0.03, 0.05, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 01, 2020 at 02:51:00PM +0200, Ioana Ciornei wrote: > From: Ioana Ciornei > > In preparation of removing the .ack_interrupt() callback, we must replace > its occurrences (aka phy_clear_interrupt), from the 2 places where it is > called from (phy_enable_interrupts and phy_disable_interrupts), with > equivalent functionality. > > This means that clearing interrupts now becomes something that the PHY > driver is responsible of doing, before enabling interrupts and after > clearing them. Make this driver follow the new contract. > > Cc: Oleksij Rempel > Cc: Michael Walle > Signed-off-by: Ioana Ciornei Tested-by: Oleksij Rempel > --- > Changes in v2: > - none > > drivers/net/phy/at803x.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > index c7f91934cf82..d0b36fd6c265 100644 > --- a/drivers/net/phy/at803x.c > +++ b/drivers/net/phy/at803x.c > @@ -614,6 +614,11 @@ static int at803x_config_intr(struct phy_device *phydev) > value = phy_read(phydev, AT803X_INTR_ENABLE); > > if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { > + /* Clear any pending interrupts */ > + err = at803x_ack_interrupt(phydev); > + if (err) > + return err; > + > value |= AT803X_INTR_ENABLE_AUTONEG_ERR; > value |= AT803X_INTR_ENABLE_SPEED_CHANGED; > value |= AT803X_INTR_ENABLE_DUPLEX_CHANGED; > @@ -621,9 +626,14 @@ static int at803x_config_intr(struct phy_device *phydev) > value |= AT803X_INTR_ENABLE_LINK_SUCCESS; > > err = phy_write(phydev, AT803X_INTR_ENABLE, value); > - } > - else > + } else { > err = phy_write(phydev, AT803X_INTR_ENABLE, 0); > + if (err) > + return err; > + > + /* Clear any pending interrupts */ > + err = at803x_ack_interrupt(phydev); > + } > > return err; > } > @@ -1088,7 +1098,6 @@ static struct phy_driver at803x_driver[] = { > .resume = at803x_resume, > /* PHY_GBIT_FEATURES */ > .read_status = at803x_read_status, > - .ack_interrupt = at803x_ack_interrupt, > .config_intr = at803x_config_intr, > .handle_interrupt = at803x_handle_interrupt, > .get_tunable = at803x_get_tunable, > @@ -1109,7 +1118,6 @@ static struct phy_driver at803x_driver[] = { > .suspend = at803x_suspend, > .resume = at803x_resume, > /* PHY_BASIC_FEATURES */ > - .ack_interrupt = at803x_ack_interrupt, > .config_intr = at803x_config_intr, > .handle_interrupt = at803x_handle_interrupt, > }, { > @@ -1128,7 +1136,6 @@ static struct phy_driver at803x_driver[] = { > /* PHY_GBIT_FEATURES */ > .read_status = at803x_read_status, > .aneg_done = at803x_aneg_done, > - .ack_interrupt = &at803x_ack_interrupt, > .config_intr = &at803x_config_intr, > .handle_interrupt = at803x_handle_interrupt, > .get_tunable = at803x_get_tunable, > @@ -1149,7 +1156,6 @@ static struct phy_driver at803x_driver[] = { > .suspend = at803x_suspend, > .resume = at803x_resume, > /* PHY_BASIC_FEATURES */ > - .ack_interrupt = at803x_ack_interrupt, > .config_intr = at803x_config_intr, > .handle_interrupt = at803x_handle_interrupt, > .cable_test_start = at803x_cable_test_start, > @@ -1162,7 +1168,6 @@ static struct phy_driver at803x_driver[] = { > .resume = at803x_resume, > .flags = PHY_POLL_CABLE_TEST, > /* PHY_BASIC_FEATURES */ > - .ack_interrupt = &at803x_ack_interrupt, > .config_intr = &at803x_config_intr, > .handle_interrupt = at803x_handle_interrupt, > .cable_test_start = at803x_cable_test_start, > -- > 2.28.0 > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |