From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hyunjung Ko <hj351016@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>,
Kaixin Wang <kxwang23@m.fudan.edu.cn>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] HSI: ssi_protocol: don't cancel_work_sync() under ssi->lock in ssip_reset
Date: Wed, 11 Nov 2026 16:46:15 +0200 [thread overview]
Message-ID: <avR_tx9ze-eAa0_N@ashevche-desk.local> (raw)
In-Reply-To: <20261111090447.3047656-1-hj351016@gmail.com>
On Wed, Nov 11, 2026 at 06:04:47PM +0900, Hyunjung Ko wrote:
> ssip_reset() calls cancel_work_sync(&ssi->work) inside the
> spin_lock_bh(&ssi->lock) section. cancel_work_sync() calls might_sleep(),
> so running it under the bh spinlock triggers "BUG: sleeping function called
> from invalid context". In addition, the cancelled work ssip_xmit_work() ->
> ssip_xmit() takes ssi->lock itself, so waiting for it while holding the
> lock can deadlock.
>
> Move cancel_work_sync() out of the locked section. It still runs in
> ssip_reset() before teardown, so the use-after-free fix is preserved.
But is it okay to run before timers are gone?
...
> spin_unlock_bh(&ssi->lock);
> if (test_and_clear_bit(SSIP_WAKETEST_FLAG, &ssi->flags))
> ssi_waketest(cl, 0); /* FIXME: To be removed */
> + cancel_work_sync(&ssi->work);
> spin_lock_bh(&ssi->lock);
> timer_delete(&ssi->rx_wd);
> timer_delete(&ssi->tx_wd);
> timer_delete(&ssi->keep_alive);
> - cancel_work_sync(&ssi->work);
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-11 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 9:04 Hyunjung Ko
2026-11-11 14:46 ` Andy Shevchenko [this message]
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=avR_tx9ze-eAa0_N@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=hj351016@gmail.com \
--cc=kxwang23@m.fudan.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=sre@kernel.org \
--cc=stable@vger.kernel.org \
/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®