mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corey Minyard <corey@minyard.net>
To: Jian Zhang <zhangjian.3032@bytedance.com>
Cc: Quan Nguyen <quan@os.amperecomputing.com>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] ipmi: ssif_bmc: cancel response timer on remove
Date: Fri, 3 Apr 2026 08:12:03 -0500	[thread overview]
Message-ID: <ac-8o46MmMzJJcS3@mail.minyard.net> (raw)
In-Reply-To: <20260403090603.3988423-1-zhangjian.3032@bytedance.com>

On Fri, Apr 03, 2026 at 05:05:58PM +0800, Jian Zhang wrote:
> The response timer can stay armed across device teardown. If it fires after
> remove, the callback dereferences the SSIF context and the i2c client after
> teardown has started.
> 
> Cancel the timer in remove so the callback cannot run after the device is
> unregistered.

Thanks for the updates on this.  I have the new version in my tree.  I
have one question on the kunit patch, I'll ask it there.

-corey

> 
> Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
> ---
> v2: use timer_delete_sync() to cancel the timer
> 
>  drivers/char/ipmi/ssif_bmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
> index 7a52e3ea49ed..dc1d5bb4a460 100644
> --- a/drivers/char/ipmi/ssif_bmc.c
> +++ b/drivers/char/ipmi/ssif_bmc.c
> @@ -843,6 +843,7 @@ static void ssif_bmc_remove(struct i2c_client *client)
>  {
>  	struct ssif_bmc_ctx *ssif_bmc = i2c_get_clientdata(client);
>  
> +	timer_delete_sync(&ssif_bmc->response_timer);
>  	i2c_slave_unregister(client);
>  	misc_deregister(&ssif_bmc->miscdev);
>  }
> -- 
> 2.20.1

      parent reply	other threads:[~2026-04-03 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  9:05 Jian Zhang
2026-04-03  9:05 ` [PATCH v2 2/5] ipmi: ssif_bmc: fix missing check for copy_to_user() partial failure Jian Zhang
2026-04-03  9:06 ` [PATCH v2 3/5] ipmi: ssif_bmc: fix message desynchronization after truncated response Jian Zhang
2026-04-03  9:06 ` [PATCH v2 4/5] ipmi: ssif_bmc: change log level to dbg in irq callback Jian Zhang
2026-04-03  9:06 ` [PATCH v2 5/5] ipmi: ssif_bmc: add unit test for state machine Jian Zhang
2026-04-03 13:14   ` Corey Minyard
2026-04-03 14:12     ` Jian Zhang
2026-04-03 14:31       ` Corey Minyard
2026-04-03 13:12 ` Corey Minyard [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=ac-8o46MmMzJJcS3@mail.minyard.net \
    --to=corey@minyard.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=quan@os.amperecomputing.com \
    --cc=zhangjian.3032@bytedance.com \
    /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®