public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Jes Sorensen <jes.sorensen@gmail.com>
Cc: openipmi-developer@lists.sourceforge.net, kernel-team@fb.com,
	linux-kernel@vger.kernel.org
Subject: Re: [Openipmi-developer] [PATCH 0/1] Fix race in ipmi timer cleanup
Date: Sat, 14 Sep 2019 20:08:52 -0500	[thread overview]
Message-ID: <20190915010852.GG13407@t560> (raw)
In-Reply-To: <20190829181536.GC3294@t560>

> 
> > 
> > {disable,enable}_si_irq() themselves are racy:
> > 
> > static inline bool disable_si_irq(struct smi_info *smi_info)
> > {
> >         if ((smi_info->io.irq) && (!smi_info->interrupt_disabled)) {
> >                 smi_info->interrupt_disabled = true;
> > 
> > Basically interrupt_disabled need to be atomic here to have any value,
> > unless you ensure to have a spin lock around every access to it.
> 
> It needs to be atomic, yes, but I think just adding the spinlock like
> I suggested will work.  You are right, the check for timer_running is
> not necessary here, and I'm fine with removing it, but there are other
> issues with interrupt_disabled (as you said) and with memory ordering
> in the timer case.  So even if you remove the timer running check, the
> lock is still required here.

It turns out you were right, all that really needs to be done is the
del_timer_sync().  I've added your patch to my queue.

Sorry for the trouble.

Thanks,

-corey

  reply	other threads:[~2019-09-15  1:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 20:36 [PATCH 0/1] Fix race in ipmi timer cleanup Jes Sorensen
2019-08-28 20:36 ` [PATCH 1/1] ipmi_si_intf: Fix race in timer shutdown handling Jes Sorensen
2019-08-28 22:32 ` [PATCH 0/1] Fix race in ipmi timer cleanup Corey Minyard
2019-08-29  0:53   ` Jes Sorensen
2019-08-29 18:15     ` Corey Minyard
2019-09-15  1:08       ` Corey Minyard [this message]
2019-09-16 14:01         ` [Openipmi-developer] " Jes Sorensen

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=20190915010852.GG13407@t560 \
    --to=minyard@acm.org \
    --cc=jes.sorensen@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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