Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp943670pxu; Wed, 2 Dec 2020 07:16:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5sof+ibZDg1Z/8w9BPv7abhLFA7VSNadTWTF9dP5XzwIw4sAA0CMBlM+NC7igoQNZoQ9W X-Received: by 2002:a50:9b58:: with SMTP id a24mr388942edj.22.1606922201756; Wed, 02 Dec 2020 07:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606922201; cv=none; d=google.com; s=arc-20160816; b=tslsMdPAPFavr4xHHIrC/sq1dGDXVlDboNfAJIveeHC2NvAeCQVRMqhThpxfECECA0 0BzPPoFTjU9hEruAop0mFMaWL9FRuDk+lHfSK4/KvilgaudgjWjZl7LxURGyt1WeUyMZ cqCY43QZXyEl/j5QyVjna6lRq5lHv4DzU0McISs7qz8V9BBdoe7RnZrcyn96KJwMfY4C 2yiTsdAtAGowzgcMC9KP/DOjXme1OtxpBUtQJU2dSnUwilgElTLJyuAFOmKE45ESF/gF hBq316ll9dsLCXvw9yXwI8urtI94E4BxyTbTFCL+dpDTF/ErWRgp4p35xaQhlG7tgstu 4r3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JYYFuGcYVEwmHMbobSEQx3q1lGubZxi5y/JWfomWtdE=; b=uMeDEvdeEjW3DPSEwZSTUY+S07hsX46r8w/GNb3z7W1DIW+/XAvXprr6mwOSgee3De 4kUmIvnO1+aLFmG3S3F3ixEXb57PQrQE0GhsEtuBD47FJ0irqOVi/ss5ug16gdAONSMw OIxYrgtDlE0ZJo79ZvB7zwTMoP75P95eU3t4pP/AJn+qSpBLG09Ed4qL4RGURjptKMyS +cnD9qQnziVga07XRRJnBZZOpBug5jvMbcRAsINJ+Fx8vY6b56Cv0+io2it2NLsWBTL4 pxclF14FYMwF6BNNbasoLEpXbLM4of70CUSUZQ5b1TGC/ujDiYKrwF0oxwWOkOtw0G3U gxDw== 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 of22si105442ejb.321.2020.12.02.07.16.18; Wed, 02 Dec 2020 07:16:41 -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 S1730444AbgLBPML (ORCPT + 99 others); Wed, 2 Dec 2020 10:12:11 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:34246 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728295AbgLBPMK (ORCPT ); Wed, 2 Dec 2020 10:12:10 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kkTmu-009st9-P7; Wed, 02 Dec 2020 16:11:24 +0100 Date: Wed, 2 Dec 2020 16:11:24 +0100 From: Andrew Lunn To: Oleksij Rempel Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Russell King , Pengutronix Kernel Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v2 2/2] net: dsa: qca: ar9331: export stats64 Message-ID: <20201202151124.GE2324545@lunn.ch> References: <20201202120712.6212-1-o.rempel@pengutronix.de> <20201202120712.6212-3-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202120712.6212-3-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -422,6 +527,7 @@ static void ar9331_sw_phylink_mac_link_down(struct dsa_switch *ds, int port, > phy_interface_t interface) > { > struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv; > + struct ar9331_sw_port *p = &priv->port[port]; > struct regmap *regmap = priv->regmap; > int ret; > > @@ -429,6 +535,8 @@ static void ar9331_sw_phylink_mac_link_down(struct dsa_switch *ds, int port, > AR9331_SW_PORT_STATUS_MAC_MASK, 0); > if (ret) > dev_err_ratelimited(priv->dev, "%s: %i\n", __func__, ret); > + > + cancel_delayed_work_sync(&p->mib_read); > } You could update the stats here, after the interface is down. You then know the stats are actually up to date and correct! Andrew