Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1572988pxb; Wed, 4 Nov 2020 12:36:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcYJcNxJa6LHE/wXD1iYaAnmM+XZb5SpGMdiByOyAIVj1MhcBdJCV0LvxmxbkxlT33RbCj X-Received: by 2002:a17:907:10d9:: with SMTP id rv25mr20990892ejb.437.1604522193131; Wed, 04 Nov 2020 12:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604522193; cv=none; d=google.com; s=arc-20160816; b=W9bARowf6MiS8/vlCucgqEbv2+Kt57nsyJgpXp0gZBhOhH2JQrA0efEez5sMztYLkw gywx5NYfE73LGDEusREHExydhaGxtZUq5vZbm5lqqowDH3Wx1wNtJo418f15qp+NYnNC lKqhftzVBpz6RI/+KJz+nge7uxH0EBgpkBKXmrWCHUWwUQvAnlMQw4uor016hpnp17e5 DOrHHt+je4/avpOD2EUouTGqFAkVACGETadcR5+ztrZ/4HM/BFiSPB7ZZheDpOvv0O8J 4cnPIrHEPUtXofA3XpnpKvuJarhCT9E8yJhDUUJBx1dKTtcM1AH6xNVQ2olRU01NdvUi peYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BT3MZuFzpdHjUvNguaC37UdrmKG8o+VYymO00fuhN3c=; b=dqhA1OYFb8Veg9ksT1SvkInrC/nuVk8Kt2Cth6l/1csm6clbJdPy2Z/QoV9i56aTW1 zDVwePHO6nk2vH09G0ziQT+ofpmKft2L0sSCkxp6fVVIyl1C2gePhn49FtLKye4IgN9o Ru4WFTD532zbwcXyHBG7GX3o4VQppF6qiNA5wqRldxE47WvQylevRSD37Kc1Ug+fDfZW RdsW+jHBiRj2RCHu7Sm/LLDUD2fVxqPid/gpo3Rtr2z9MyKqUv3sG8ZqQMVL+DqV49wt QCdUOnWyObIeVfBQCpX3hxWGfeKa36UImrB9dxcvCvS8OQ8VW2jHzs/YwVRB2DEc/j2l TQnA== 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 t12si2735263edc.298.2020.11.04.12.36.10; Wed, 04 Nov 2020 12:36:33 -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 S1732233AbgKDSJ6 (ORCPT + 99 others); Wed, 4 Nov 2020 13:09:58 -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 |