Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp454894pxu; Thu, 26 Nov 2020 03:07:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyn0qlQTx+fZp0QP66vQH97E0dhnHFw23LSY+hMHd8LKF2yAInaOROxBgW+FNZHeiLRnpXy X-Received: by 2002:a17:906:fa13:: with SMTP id lo19mr77724ejb.455.1606388843752; Thu, 26 Nov 2020 03:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606388843; cv=none; d=google.com; s=arc-20160816; b=GsWmzvHsSbGHPzKFNQ9RAgY0GV22wlnrVBZEJOYvalOB+vrnJEORmoj3sgij036tam Cjg1o+52AU98fnX8xUqsK7r8bjlrKMK4dtLSLWx1vrO/sgUdzBKooZqZ1VxJOd0V8W3p r2QgBAB9vQ6WB7eDAcnbS/YEZwrvvbo0tMQAtUqhhRbnIZBLMOsucWDb7SkTfW5phFUf EGOFpTx+O7Wxs/jyuLqMeAgC6cIVijmRF9sS6qR6sxPNTBiEdKM9x3cFXOu+fS7/imu3 0ccAgzukwMprWgmS9zzkkdIfjPqrWY8/voifmAGjRQ0d8HjHkrOtkvIVLkMJ666BQ3LH XVtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:date:message-id:in-reply-to:subject :cc:to:from:user-agent:references:dkim-signature; bh=GFyCHi/uBU1dtOcUSYpx65nLIeE0S+Y9gUbYQTFljb0=; b=Dsy2N1rgz5W6ugFtj0Ib5VWNRcH7434IYx/ucwpVABFflDHPJILXBBRAPNY14/6V+n R03iSAbrxbfxLUjFzFkUh6sZixC1w9+CMwGzq4IspWfI2WbE8xZmU/+vPPBvmNuRr3JX SS7qGYfHcombt8EbCeDC393+zQYZvqqTFCo5gyxlyym1IVYhjX/ydw6p5V26kNDABcKx aJ0hFDSkyOnYir3o06vmV7qfak3dhqFoCXhp1hC9nNKApIKtFzSJ/EPvbrglo5V+lrg4 XYGHMjOYqufwqyHdJ0ycL0DfB/J+5sVxVYtOm9G5acTzcndbarueMpejZj40N5U+7tRB qoBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=j9d9YS49; 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 y23si2847080eju.563.2020.11.26.03.06.55; Thu, 26 Nov 2020 03:07:23 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=j9d9YS49; 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 S2389113AbgKZJCu (ORCPT + 99 others); Thu, 26 Nov 2020 04:02:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbgKZJCs (ORCPT ); Thu, 26 Nov 2020 04:02:48 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A17C0613D4 for ; Thu, 26 Nov 2020 01:02:48 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id r3so1294172wrt.2 for ; Thu, 26 Nov 2020 01:02:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=GFyCHi/uBU1dtOcUSYpx65nLIeE0S+Y9gUbYQTFljb0=; b=j9d9YS49slF6glftrGUPhNlLNKLxwo0LbWOgMai+Dj2szvu3yv1dneZpHyyZnCPnI9 TEb4Ua8IM28iztZzrGLOKgglT40/xDKvF28qKzvcDIlkEgaSzfdowuYX60/PQxaMXGS2 qKjDGJ6TuOtoU9BIYAcXRmmDTQ1nu12VOT0No3UYQ0wA2t+DxoZrpKj6mQe75GT67qNN oM0kIIEgqujWcDrNl75vc751AQa8EDzJGpIPxn0AIv6EbzF+xpY7tQ9x3TJXKQOcbBSz 0UyG3aTzA57/UG9bgSLc76DgnGWc0PowTtkHsA4CtFIIjBuwP/P0fCqxieL0zuWvuR2p 8Nww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=GFyCHi/uBU1dtOcUSYpx65nLIeE0S+Y9gUbYQTFljb0=; b=AfH3ZDQoCZdwr9ELbWbF8iHCwOu8RxKbJ8NLt1vs4DCCnF7Tbn+T8MC0zR86I9Qb4j iIQYeU2ISU0dKQXJa6WaYRz/DAVP/RWFSARMb62m/khalYhX/W35eNxSK9VaE907dTFJ bzEFrCuJs0X4+r6nSrdLC6XcfAarliRLx+yzmVzJ+FGJc1rzsYIqDp+DEvNxU3FVgSRN aVM6RSI98vyykhjd3u3jX3PG+Qt3mwAFK+HbkJGci1I0fOAEdp+htORMP5kTzEOj6QLL E4ZrtB4hdqAogdQ3X1OwuDJVdaBVvjjyfWVU/3U+NfFY1YCgufX6DpS1jGb9XvX5HnTI OcTA== X-Gm-Message-State: AOAM532LQGTs+loNnsOZFy3XYzCRAxijIwhecf5a0bNFhw1E48rkHnCt bgSWddhBXzOeMCHDC9tfC1speg== X-Received: by 2002:a5d:6250:: with SMTP id m16mr2597470wrv.400.1606381366987; Thu, 26 Nov 2020 01:02:46 -0800 (PST) Received: from localhost (253.35.17.109.rev.sfr.net. [109.17.35.253]) by smtp.gmail.com with ESMTPSA id e1sm8912528wra.22.2020.11.26.01.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 01:02:46 -0800 (PST) References: <20201123153817.1616814-1-ciorneiioana@gmail.com> <20201123153817.1616814-7-ciorneiioana@gmail.com> User-agent: mu4e 1.4.10; emacs 27.1 From: Jerome Brunet To: Ioana Ciornei , Andrew Lunn , Heiner Kallweit , Russell King , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ioana Ciornei , Neil Armstrong Subject: Re: [PATCH net-next 06/15] net: phy: meson-gxl: remove the use of .ack_callback() In-reply-to: <20201123153817.1616814-7-ciorneiioana@gmail.com> Message-ID: <1jim9s8p8r.fsf@starbuckisacylon.baylibre.com> Date: Thu, 26 Nov 2020 10:02:44 +0100 MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 23 Nov 2020 at 16:38, 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: Jerome Brunet > Cc: Neil Armstrong > Signed-off-by: Ioana Ciornei > --- > drivers/net/phy/meson-gxl.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c > index b16b1cc89165..7e7904fee1d9 100644 > --- a/drivers/net/phy/meson-gxl.c > +++ b/drivers/net/phy/meson-gxl.c > @@ -204,22 +204,27 @@ static int meson_gxl_config_intr(struct phy_device *phydev) > int ret; > > if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { > + /* Ack any pending IRQ */ > + ret = meson_gxl_ack_interrupt(phydev); > + if (ret) > + return ret; > + > val = INTSRC_ANEG_PR > | INTSRC_PARALLEL_FAULT > | INTSRC_ANEG_LP_ACK > | INTSRC_LINK_DOWN > | INTSRC_REMOTE_FAULT > | INTSRC_ANEG_COMPLETE; > + ret = phy_write(phydev, INTSRC_MASK, val); > } else { > val = 0; > - } > + ret = phy_write(phydev, INTSRC_MASK, val); > > - /* Ack any pending IRQ */ > - ret = meson_gxl_ack_interrupt(phydev); > - if (ret) > - return ret; > + /* Ack any pending IRQ */ > + ret = meson_gxl_ack_interrupt(phydev); > + } > > - return phy_write(phydev, INTSRC_MASK, val); > + return ret; The only thing the above does is clear the irq *after* writing INTSRC_MASK *only* when the interrupts are not enabled. If that was not the intent, please let me know. As it stands, I don't think this hunk is necessary and I would prefer if it was not included. > } > > static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev) > @@ -249,7 +254,6 @@ static struct phy_driver meson_gxl_phy[] = { > .soft_reset = genphy_soft_reset, > .config_init = meson_gxl_config_init, > .read_status = meson_gxl_read_status, > - .ack_interrupt = meson_gxl_ack_interrupt, > .config_intr = meson_gxl_config_intr, > .handle_interrupt = meson_gxl_handle_interrupt, > .suspend = genphy_suspend, > @@ -260,7 +264,6 @@ static struct phy_driver meson_gxl_phy[] = { > /* PHY_BASIC_FEATURES */ > .flags = PHY_IS_INTERNAL, > .soft_reset = genphy_soft_reset, > - .ack_interrupt = meson_gxl_ack_interrupt, > .config_intr = meson_gxl_config_intr, > .handle_interrupt = meson_gxl_handle_interrupt, > .suspend = genphy_suspend,