All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	syzbot <syzbot+6fb78d577e89e69602f9@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, pbonzini@redhat.com,
	syzkaller-bugs@googlegroups.com,
	Steven Rostedt <rosted@goodmis.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [syzbot] WARNING in call_timer_fn
Date: Fri, 18 Nov 2022 12:01:29 -0800	[thread overview]
Message-ID: <CABBYNZLEjEtwbr+5W4nt=7HhNLBG9_J9xj_rJC=cbA-1pBgRHQ@mail.gmail.com> (raw)
In-Reply-To: <20221118012805.3862-1-hdanton@sina.com>

Hi Hillf,

On Thu, Nov 17, 2022 at 5:28 PM Hillf Danton <hdanton@sina.com> wrote:
>
> On Thu, Nov 17, 2022 at 1:04 PM Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote:
> > >
> > > I thought we would have something similar to shutdown_timer (e.g.
> > > shutdown_delayed_work) so we can safely free its object/struct, at
> > > least that was the impression I got when discussing with Steven.
>
> Because of the cough in Bluetooth's throat does not mean it makes sense
> to ask workqueue to take a flu jab. Why not cure it directly locally,
> given the cases of workqueue under the drivers dir. And timer?

Like Thomas said we can only resolve this partially with the likes of
cancel_workqueue(_sync), though we can use HCI_UNREGISTER to stop
rescheduling cmd_timer, so imo having something similar to
shutdown_timer makes things simpler for subsystems/drivers, anyway I'm
fine fixing it directly since it is probably going to be simpler to
backport, perhaps something like the following is all we need:

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0540555b3704..977684f5fb57 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -4090,6 +4090,7 @@ static void hci_cmd_work(struct work_struct *work)

                        rcu_read_lock();
                        if (test_bit(HCI_RESET, &hdev->flags) ||
+                           test_bit(HCI_UNREGISTER, &hdev->flags) ||
                            hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE))
                                cancel_delayed_work(&hdev->cmd_timer);
                        else

-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2022-11-18 20:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 15:25 [syzbot] WARNING in call_timer_fn syzbot
2022-11-16 18:29 ` Thomas Gleixner
     [not found] ` <20221117024511.3606-1-hdanton@sina.com>
2022-11-17 11:54   ` Thomas Gleixner
     [not found]   ` <20221117125523.3783-1-hdanton@sina.com>
2022-11-17 16:06     ` Thomas Gleixner
2022-11-17 21:04       ` Luiz Augusto von Dentz
2022-11-17 21:16         ` Luiz Augusto von Dentz
2022-11-18  0:53           ` Tetsuo Handa
2022-11-18  1:17             ` Thomas Gleixner
     [not found]           ` <20221118012805.3862-1-hdanton@sina.com>
2022-11-18 20:01             ` Luiz Augusto von Dentz [this message]
     [not found] <20221117010835.3474-1-hdanton@sina.com>
2022-11-17  1:35 ` syzbot

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='CABBYNZLEjEtwbr+5W4nt=7HhNLBG9_J9xj_rJC=cbA-1pBgRHQ@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=pbonzini@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rosted@goodmis.org \
    --cc=syzbot+6fb78d577e89e69602f9@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.