From: Nam Cao <namcao@linutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Andreas Hindborg <a.hindborg@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
Miguel Ojeda <ojeda@kernel.org>, Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH 05/21] can: bcm: Don't initialized an unused hrtimer
Date: Wed, 30 Oct 2024 13:15:33 +0100 [thread overview]
Message-ID: <20241030121533.ioTNvYpX@linutronix.de> (raw)
In-Reply-To: <203a1560-76c9-4c47-b1b8-b44ddf40cd16@hartkopp.net>
On Wed, Oct 30, 2024 at 11:49:49AM +0100, Oliver Hartkopp wrote:
> On 28.10.24 08:29, Nam Cao wrote:
> > The hrtimer "thrtimer" is not used for TX. But this timer is initialized
> > regardless.
> >
> > Remove the hrtimer_init() for the unused hrtimer and change bcm_remove_op()
> > to make sure hrtimer_cancel() is not called with the uninitialized hrtimer.
>
> NAK.
>
> There are several other occurrences of thrtimer that are not covered by
> RX/TX distinction, where the second timer is canceled.
>
> This one-time init and cancel of an unused hrtimer costs nearly nothing and
> is not even in any hot path.
>
> So this incomplete patch only adds complexity and potential error cases in
> some 20 y/o code for nothing.
The "real" motivation is preparing to use hrtimer_setup() instead of
hrtimer_init() [1] and deleting hrtimer_init() [2]. The new function
mandates a callback function, and since the TX thrtimer doesn't have a
callback function, hrtimer_setup() cannot be used.
Your concerns are also valid. So I can drop this patch, and use a dummy
function to make hrtimer_setup() happy, like how it's done for the rt2x00
driver [3]. It will make the driver a bit ugly, but it's obvious that it
won't cause any regression.
Best regards,
Nam
[1] https://lore.kernel.org/lkml/e4ce3a3a28625d54ef93e47bfb02f7ffb741758a.1729865232.git.namcao@linutronix.de/
[2] https://lore.kernel.org/lkml/7bde2762d82d30dab184c7a747e76afc41208da0.1729865740.git.namcao@linutronix.de/
[3] https://lore.kernel.org/lkml/49f2bce487f56eb2a3ff572ea6d7de0a43560c0f.1729865232.git.namcao@linutronix.de/
next prev parent reply other threads:[~2024-10-30 12:15 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 7:29 [PATCH 00/21] hrtimers: Switch to new hrtimer interface functions (1/5) Nam Cao
2024-10-28 7:29 ` [PATCH 01/21] hrtimers: Add missing hrtimer_init event trace points Nam Cao
2024-10-28 7:29 ` [PATCH 02/21] hrtimers: Remove unused hrtimer_init_sleeper() Nam Cao
2024-10-28 7:29 ` [PATCH 03/21] drm/i915/request: Remove unnecessary abuse of hrtimer::function Nam Cao
2024-10-28 7:29 ` [PATCH 04/21] KVM: x86/xen: Initialize hrtimer in kvm_xen_init_vcpu() Nam Cao
2024-10-28 16:01 ` Sean Christopherson
2024-10-28 22:19 ` Thomas Gleixner
2024-10-30 18:05 ` Sean Christopherson
2024-10-28 7:29 ` [PATCH 05/21] can: bcm: Don't initialized an unused hrtimer Nam Cao
2024-10-30 10:49 ` Oliver Hartkopp
2024-10-30 12:15 ` Nam Cao [this message]
2024-10-30 14:51 ` Oliver Hartkopp
2024-10-30 15:01 ` Oliver Hartkopp
2024-10-30 15:18 ` Thomas Gleixner
2024-10-28 7:29 ` [PATCH 06/21] wifi: rt2x00: Remove redundant hrtimer_init() Nam Cao
2024-10-31 14:13 ` Kalle Valo
2024-10-28 7:29 ` [PATCH 07/21] io_uring: Remove redundant hrtimer's callback function setup Nam Cao
2024-10-28 7:29 ` [PATCH 08/21] hrtimers: Introduce hrtimer_setup() to replace hrtimer_init() Nam Cao
2024-10-28 7:29 ` [PATCH 09/21] hrtimers: Introduce hrtimer_setup_on_stack() Nam Cao
2024-10-28 7:29 ` [PATCH 10/21] hrtimers: Introduce hrtimer_setup_sleeper_on_stack() Nam Cao
2024-10-28 7:29 ` [PATCH 11/21] hrtimers: Introduce hrtimer_update_function() Nam Cao
2024-10-28 7:29 ` [PATCH 12/21] fs/aio: Switch to use hrtimer_setup_sleeper_on_stack() Nam Cao
2024-10-28 7:29 ` [PATCH 13/21] futex: " Nam Cao
2024-10-28 7:29 ` [PATCH 14/21] net: pktgen: " Nam Cao
2024-10-28 7:29 ` [PATCH 15/21] timers: " Nam Cao
2024-10-28 7:29 ` [PATCH 16/21] wait: " Nam Cao
2024-10-28 7:29 ` [PATCH 17/21] hrtimers: Delete hrtimer_init_sleeper_on_stack() Nam Cao
2024-10-28 7:29 ` [PATCH 18/21] sched/idle: Switch to use hrtimer_setup_on_stack() Nam Cao
2024-10-28 9:09 ` Peter Zijlstra
2024-10-28 10:50 ` Thomas Gleixner
2024-10-28 10:58 ` Peter Zijlstra
2024-10-28 22:33 ` Thomas Gleixner
2024-10-28 7:29 ` [PATCH 19/21] io_uring: " Nam Cao
2024-10-28 7:29 ` [PATCH 20/21] alarmtimer: Switch to use hrtimer_setup() and hrtimer_setup_on_stack() Nam Cao
2024-10-28 7:29 ` [PATCH 21/21] hrtimers: Delete hrtimer_init_on_stack() Nam Cao
2024-10-28 16:05 ` [PATCH 00/21] hrtimers: Switch to new hrtimer interface functions (1/5) Sean Christopherson
2024-10-29 8:15 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241030121533.ioTNvYpX@linutronix.de \
--to=namcao@linutronix.de \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=socketcan@hartkopp.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®