From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C15223451A7; Fri, 17 Apr 2026 18:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776449064; cv=none; b=U0cj4JItP9/jvchg3efP/Fws65nDwL1gW0sleHEscK1lavWVxhL0PNKWdogWpds+6SxdcDWL/i/BYYUhV2ImwR00P2gl1Mkcgco445/2IvCAkZkcg5grbsUzG6BWD+Z+WwfMBh1ChugURVVrmB0d2oypcbj5ThG5+klITcfBDTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776449064; c=relaxed/simple; bh=Nr15fqSECyaVyLrYV54mTHvCpSpPQm7NQ/ksujh8my4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r3PZ5WIDxJPM6PqrY0dIGc9YVPWGcxCIjVG7xLQm4wbeAQlG+oBll4YmOhr1LB7XRkBXi5hwf+2jsHQD2MOUYl4QfHHIUr3fBHwqxfCGQhK1fvshxMZCrwg93Ir4AfRmGwEC+kh0WPIifPIo/NflXkbyMHcCZ0+0BilLkBKgjvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wDnXv-000000007HL-0Cuh; Fri, 17 Apr 2026 18:04:03 +0000 Date: Fri, 17 Apr 2026 19:03:58 +0100 From: Daniel Golle To: Breno Leitao Cc: "Chester A. Unal" , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Christian Marangi , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , John Crispin Subject: Re: [PATCH net] net: dsa: mt7530: fix .get_stats64 sleeping in atomic context Message-ID: References: <79dc0ec5b6be698b14cb66339d6f63033ca2934a.1776397542.git.daniel@makrotopia.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 17, 2026 at 10:46:29AM -0700, Breno Leitao wrote: > On Fri, Apr 17, 2026 at 04:55:57AM +0100, Daniel Golle wrote: > > @@ -3404,6 +3449,9 @@ EXPORT_SYMBOL_GPL(mt7530_probe_common); > > void > > mt7530_remove_common(struct mt7530_priv *priv) > > { > > + if (priv->bus) > > + cancel_delayed_work_sync(&priv->stats_work); > > + > > Shouldn't you cancel the work later, after dsa_unregister_switch()? > > I am wondering if the following race cannot happen: > > mt7530_remove_common() someone reading /proc/net/dev > cancel_delayed_work_sync() > /* returns: work neither pending > nor executing - true at this > instant */ > mt7530_get_stats64() > mod_delayed_work(...) > /* work is queued again */ > dsa_unregister_switch() > return Thanks you for pointing this out. cancel_delayed_work_sync() should be moved after dsa_unregister_switch() to avoid this kind of race.