Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp351256ybl; Wed, 4 Dec 2019 03:58:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzxtRGoHqWn1RJnCx0ynYfN3XZLt+y100HGJgDI5eGlYm/qr0tsXn7RSM8vMZ9x1QxifDHm X-Received: by 2002:a05:6808:24e:: with SMTP id m14mr2218386oie.168.1575460689396; Wed, 04 Dec 2019 03:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575460689; cv=none; d=google.com; s=arc-20160816; b=L/bw1Xh9I/i7HKdjPMUny6ne0YhtJJFKkSZ1TY+5/tghX3plJ7tj2+JUD/biXx4kdv qMcE/7leV/LhrchlvX9/xSC6Tnm20H/MbdjN0EhrixVdHmpAalLfjuCT52evWkxqqRrZ XNqIEp4K5YHFL/WciM95+HkV9+Cu5dLxX6SFWpTHP7TOUF2oobmeuJ/lw+2j9m+lez94 Tcm+z+YMn7/NG21lTM69PYv15t96v7tTCIQ6Cxz1oJCAHEBk7QiiVFObzeFEZSzFt3ti 7BmysbodFedaZEKmyisFn9FBrmi8gMOsVIl9G1ecHPk1kJnWlniiAiYVWiX+IG1ne4f9 fHEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=U+synwjPGDupWSuCJ1vGWNsy0z5Pxz/d/9zVcWdxZ3E=; b=GIf+CLYcCO1rhFUAzr1Hrr/4oT4Xz7iaMYUf7aICNYRJE4vtQ/l1CHg+fJGDn9xbln QfWkZ34dT8qrPkLBYKYrlGBEQ8VJ/B4sPwpCYtdeC32zITpTbCNoXSjN/Y4W2yxee4r9 6LAAxWeukO2P7z4vSXSvRg84hsOBrZdSbiqRp9uZdqVZAUnHoMJR8j2t2FTLjbD7/BZO TW5lmw11yEDi63N0kq5GRW8Mf/eGLL8ghayHXyuK1ToL9da6k05xjsJjpkkpjAxcmkzy BTM2kwH5oG1mVlCU8gVyOs/NbRIvqQwctJSUeZ/Bk9BcJ/N/YvGTrI8M7FiYczUHUl4U wsjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b186si3064659oif.140.2019.12.04.03.57.56; Wed, 04 Dec 2019 03:58:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727552AbfLDL40 (ORCPT + 99 others); Wed, 4 Dec 2019 06:56:26 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:50226 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfLDL40 (ORCPT ); Wed, 4 Dec 2019 06:56:26 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id CC4261C2462; Wed, 4 Dec 2019 12:56:23 +0100 (CET) Date: Wed, 4 Dec 2019 12:56:23 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ahmed Zaki , Johannes Berg , Sasha Levin Subject: Re: [PATCH 4.19 044/321] mac80211: fix station inactive_time shortly after boot Message-ID: <20191204115623.GA25176@duo.ucw.cz> References: <20191203223427.103571230@linuxfoundation.org> <20191203223429.401517191@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20191203223429.401517191@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2019-12-03 23:31:50, Greg Kroah-Hartman wrote: > From: Ahmed Zaki >=20 > [ Upstream commit 285531f9e6774e3be71da6673d475ff1a088d675 ] >=20 > In the first 5 minutes after boot (time of INITIAL_JIFFIES), > ieee80211_sta_last_active() returns zero if last_ack is zero. This > leads to "inactive time" showing jiffies_to_msecs(jiffies). >=20 > # iw wlan0 station get fc:ec:da:64:a6:dd > Station fc:ec:da:64:a6:dd (on wlan0) > inactive time: 4294894049 ms > . > . > connected time: 70 seconds >=20 > Fix by returning last_rx if last_ack =3D=3D 0. I guess it fixes the message, but is it right fix? > diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c > index f34202242d24d..507409e3fd39c 100644 > --- a/net/mac80211/sta_info.c > +++ b/net/mac80211/sta_info.c > @@ -2356,7 +2356,8 @@ unsigned long ieee80211_sta_last_active(struct sta_= info *sta) > { > struct ieee80211_sta_rx_stats *stats =3D sta_get_last_rx_stats(sta); > =20 > - if (time_after(stats->last_rx, sta->status_stats.last_ack)) > + if (!sta->status_stats.last_ack || > + time_after(stats->last_rx, sta->status_stats.last_ack)) > return stats->last_rx; > return sta->status_stats.last_ack; > } I mean, jiffies do wrapraound periodically, so eventually we'll have sta->status_stats.last_ack =3D=3D 0 even through it is not short after boot, no? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXeee5wAKCRAw5/Bqldv6 8mVbAKCkAZf8HJ79qfd54n1ch2WztEMILACgv+jqioCPEnTJexWPWb5L/nE+2Sg= =fzGi -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--