Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7164500rwb; Wed, 23 Nov 2022 03:07:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7lZRy4FMXu9Ws1I5TBg8hd3otvWxxHCBsXwTBeLZYh/90rgUW7KaWgRNZIgA0GMn3L8RMd X-Received: by 2002:a17:906:ce55:b0:7ad:b45c:dd7a with SMTP id se21-20020a170906ce5500b007adb45cdd7amr23845797ejb.292.1669201669031; Wed, 23 Nov 2022 03:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669201669; cv=none; d=google.com; s=arc-20160816; b=zw4tzEtQw5PoGxKGXIH3jUNiq6HZn9gnnQ2x/b7Bdd0rYWW5pHYKPxlfzz+NLb08wt MZF9plY72bMHKx527I128OI3xp0TU+MH4XSFtfUgufj9oQPGpsUn5fSx3/e2Ek3sJm+Q 20X0u3nsbdXHcy/AKkFkLVLg01qSMhyo1mJqd4zku9t2M9YnKNjkTs1ZdYXxsc4VoztD Q7PQ/gv2ojyPns0OV3PhMLiEOeS7RSZQPYf/bp7fQRs6wCdJDJvkZp6nzRe4p8+tscmd CPuVm9n+QWsQs5WrA1LF7e0jiCOH2CHngzd/aMUjXUf69aR0iFNnx3+anK52IhS1lJLh TZzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:dkim-signature:dkim-signature:date; bh=0+upg52BtLT9oHrczBXFvaIQMySCLIal3hm8l0NDLnQ=; b=QckEiZD9Sm9y0JBK5gtBBwF3AjvIAxao3qiXjR20pe37kZ4RIUD8WIMa0XeDvTze6p 0yAQ2kiV9JUAQx9qcT0cUfTyOde+fp4qZ18sErU/OkHJV8AFKx81ie5cTeSrkWK5ZbmA n0KRcpDZffz6oy6LdDKrRszZs8hLH0C/WFjG1C6kiytdMdLtefKw1nas41bTh514+v3p 3PMtR3asEh/zK3/L7LJ1uX+F3gBIENtQcC5jGmxK3gZ7daSGrZLSpjD+xBfKMkYG1Yks j0gxo60e+CsuB83/F+cfSfSyZze43xRb2tbs4+wznDTP6ivDTMLf34XygOglhuwMfJd4 DCkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=l6P32vFF; dkim=neutral (no key) header.i=@linutronix.de header.b=SxPe9D9B; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a056402440e00b0046382109edbsi15269246eda.395.2022.11.23.03.07.20; Wed, 23 Nov 2022 03:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=l6P32vFF; dkim=neutral (no key) header.i=@linutronix.de header.b=SxPe9D9B; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235464AbiKWLHO (ORCPT + 99 others); Wed, 23 Nov 2022 06:07:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237133AbiKWLGk (ORCPT ); Wed, 23 Nov 2022 06:06:40 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29FEFD7A; Wed, 23 Nov 2022 03:06:15 -0800 (PST) Date: Wed, 23 Nov 2022 12:06:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669201574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0+upg52BtLT9oHrczBXFvaIQMySCLIal3hm8l0NDLnQ=; b=l6P32vFF870ypZx6vCoBcNNgylnWvrBUmEtcYRcXy0kC4LhfNZoPFwgNttx+vj4z5wSKMs vn0R0rCHUKYgVmCz92vdsSe961Z3VtAs7dzNEsbFtTOO8XqYz4W8PAMnYdRRVSJ4AFv1Wa ft7/SCUlKy2Jmg2zEGahbi/Vxb9wOE1B1ouYh1jYSbFG/bIN3M24g8kmbQXEIxFzWZA8I9 AUncV4boGStW+ocIgtThmc2wweNnOlhxDOGwTfw6KkdaXTbMt0pQfqBCyBuvSaou/mE4Pe JP34yBeyRtHZe8ual+wzjM9X206u7+vlPqIllWbycEFVneffF9kaG4Bi9JrbzQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669201574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0+upg52BtLT9oHrczBXFvaIQMySCLIal3hm8l0NDLnQ=; b=SxPe9D9BGzUbhvSxqQS4b3uIXz2O6cBpEgHoPX1lNKZsBn8VsZihEBpiNn1TJIoH4DHOj/ 3ujtJx8+O88t8zAQ== From: Anna-Maria Behnsen To: Thomas Gleixner cc: LKML , Linus Torvalds , Steven Rostedt , Peter Zijlstra , Stephen Boyd , Guenter Roeck , Andrew Morton , Julia Lawall , Arnd Bergmann , Viresh Kumar , Marc Zyngier , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: Re: [patch V2 12/17] timers: Silently ignore timers with a NULL function In-Reply-To: <20221122173648.793640919@linutronix.de> Message-ID: <165dcea1-2713-218b-fecf-5bf80452229@linutronix.de> References: <20221122171312.191765396@linutronix.de> <20221122173648.793640919@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Tue, 22 Nov 2022, Thomas Gleixner wrote: > Tearing down timers which have circular dependencies to other > functionality, e.g. workqueues, where the timer can schedule work and work > can arm timers is not trivial. > > In those cases it is desired to shutdown the timer in a way which prevents > rearming of the timer. The mechanism to do so it to set timer->function to > NULL and use this as an indicator for the timer arming functions to ignore > the (re)arm request. > > In preparation for that replace the warnings in the relevant code pathes > with checks for timer->function == NULL and discard the rearm request > silently. > > Add debug_assert_init() instead of the WARN_ON_ONCE(!timer->function) > checks so that debug objects can warn about non-initialized timers. Could you expand this paragraph, so that is is not missleading when a reader is not aware of the details of debug objects? Otherwise it seems to the reader that debug objects will warn when timer->function == NULL. The warning of debug objects does not cover the original WARN_ON_ONCE(!timer->function). It warns when timer was not initialized using timer_setup[_on_stack]() or via DEFINE_TIMER(). > If developers fail to enable debug objects and then waste lots of time to > figure out why their non-initialized timer is not firing, they deserve it. Thanks, Anna-Maria