Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1624754rdb; Thu, 25 Jan 2024 00:53:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVjRJrxE2vUhfM955MKV2BNMYEInynTNUmPukEMTOTdlFwRl8qoEETyM2zUSMdzSs7PvVQ X-Received: by 2002:a05:6830:60e:b0:6d9:ddc3:e941 with SMTP id w14-20020a056830060e00b006d9ddc3e941mr412100oti.59.1706172830731; Thu, 25 Jan 2024 00:53:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706172830; cv=pass; d=google.com; s=arc-20160816; b=hjmnkxnRv9ZQmoHk7Io8I8F+oQPYakgS7Uk0/DfATDS3O0HEsLzO27CXMaZ6l2PBIt H0ixQtUoI4mnVEdxjPlwjr+yhCCowrAGit/EjeKmKIw1Fv5gvPtUFvzOyrEqUB8Gg096 sO5MTvLwp9uKyJ0hZNfAiM/R7L/m+8xhkWJIKiSnBRmG2PNgGquxPjyXhlGQ8DwSPlcx UIgizIiUyhHycFXHTy291jp5nzDK2wSaPljFW050jH7x+7JcQRHL8NQhTjDcic0LBp53 w4emHOkeAT5c6i/ilYsevUS2ourmGpZzjrWP8Kwaa28rleXPfmo4xLikC91kqvs3zx91 XoFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=JD9SLA41zLmXEitLPQ1L3S0RBoSKdOW+bAptf63pn0c=; fh=Se0Z3iwns+NGLLDfqrLFIpGqmYxI5bVsa93X9Ma4Psg=; b=pt4Rb1rUpRu+maf0OCrAfgV9n+hwj6ZVDibR9d9mog0oWfTFU37UCJEP2lNDJFpO5n ahHpa8cnDHMsCjE3wNmTOydIyw83dcBOV1iSBS7CoIvmvFHnTywaOLNSlABx9iqusZAR Lg5uZMME5ITVihwdYRkfsZpUo0pwSquN8tKVMesETGwJLDvbLnb7p1+hQdY7RsNbCcB8 Nw+uDgEsCiSLnDUzbNuUsbasjbrdcTwLfNmXN/LonWWmFG/X4KWrf+BDy35pEzQ5SmvI hywRPTmRjBFrRdHd+7zsR0f5gAHQDB+UIQ/aXIJC8uJfkiawQ47Ha/r9LlaPMTOZd/TB rH+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=TzrJfaTZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a34-20020a631a22000000b005c6607044easi13274332pga.738.2024.01.25.00.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 00:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=TzrJfaTZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 71A392816A1 for ; Thu, 25 Jan 2024 08:51:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 816F818638; Thu, 25 Jan 2024 08:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="TzrJfaTZ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 4BDC61B943; Thu, 25 Jan 2024 08:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172714; cv=none; b=OIYrkwtuTJmsZ3eCoisU3vxhBRwdAObLjH3H/rX+7fj3bx5lHkCCO/69R+nKMd60NM0X8WldVMqYtTm7mhrjM0z3o1vvvrrMfQbB5hANb3A0+/IOkcfGQ7k2sIvMwGlBJvCZUAL9AidqJKSz2bu98jAIZ5i1vCynrqEj3qv5H58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172714; c=relaxed/simple; bh=7PCQSSn9qQi0UDs0EZ6lPNb92aGeRUr/+gsVqO3dGHg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MWSQ3isRpHFRjOpjSvS09Z+WNHyNZc4S/V+k80l1e8khw4OdThMLse21Q0fZHej3A9eHz1DDfVIzWE96UWzX/30mqJ4e2jfIQedhF7WxCb3Em0XIAxl+jk3RT+RUW8d/vUnRSS2AVuJ25aWpFVu6oRZlgJxrUHQWWwLfZh8v/wI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=TzrJfaTZ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=JD9SLA41zLmXEitLPQ1L3S0RBoSKdOW+bAptf63pn0c=; t=1706172711; x=1707382311; b=TzrJfaTZwI/NwJopZCcMTtn3xcTbWpafCr23X/v2Ng07G5ypcnZAUF9dRE7bofi4c9GQY+Y00cC 68JrFqG4pbmWelzfU1PewJEKw+hPDHYgfKxMxNc2cex+P43FiI1uc3Ewy3O44lZpIIcKji0RR6ZWf Ag07DpQz+rffRCttKL2nSOwJ5542cwhUadCWskqJn1PbkrMkLsSsu4P0iggxkvH7jnTAyWhku9j+u aootUI1GVOkjP/JPCg6tapYL+5+GwtkXjAd1cBnzHMduJEyO0YLK2+4Dzwjx1PJ7DdalVc/Gsz1yV Z/9QnQfwJjGFvBzcKC6su14JSdoPVTIPC3Bg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rSvSY-0000000HKuJ-0xOq; Thu, 25 Jan 2024 09:51:42 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Jouni Malinen , stable@vger.kernel.org Subject: [PATCH] wifi: cfg80211: fix wiphy delayed work queueing Date: Thu, 25 Jan 2024 09:51:09 +0100 Message-ID: <20240125095108.2feb0eaaa446.I4617f3210ed0e7f252290d5970dac6a876aa595b@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg When a wiphy work is queued with timer, and then again without a delay, it's started immediately but *also* started again after the timer expires. This can lead, for example, to warnings in mac80211's offchannel code as reported by Jouni. Running the same work twice isn't expected, of course. Fix this by deleting the timer at this point, when queuing immediately due to delay=0. Reported-by: Jouni Malinen Cc: stable@vger.kernel.org Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics") Signed-off-by: Johannes Berg --- net/wireless/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index 409d74c57ca0..3fb1b637352a 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -5,7 +5,7 @@ * Copyright 2006-2010 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -1661,6 +1661,7 @@ void wiphy_delayed_work_queue(struct wiphy *wiphy, unsigned long delay) { if (!delay) { + del_timer(&dwork->timer); wiphy_work_queue(wiphy, &dwork->work); return; } -- 2.43.0