public inbox for linux-rtc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "Mateusz Jończyk" <mat.jonczyk@o2.pl>,
	linux-rtc@vger.kernel.org,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Xiaofei Tan" <tanxiaofei@huawei.com>
Subject: Re: [PATCH 7/7] Revert "rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ"
Date: Tue, 14 Sep 2021 10:22:39 +0200	[thread overview]
Message-ID: <YUBbzzHfmxiafJUs@piout.net> (raw)
In-Reply-To: <YUBXL7hnd42GwBn9@intel.com>

On 14/09/2021 11:02:55+0300, Ville Syrjälä wrote:
> On Sun, Sep 12, 2021 at 02:42:14PM +0200, Mateusz Jończyk wrote:
> > Revert
> > commit 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ")
> > and add a comment.
> > 
> > As described in a previous
> > commit 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()")
> > from February 2020:
> > 
> >         cmos_interrupt() isn't always called from hardirq context, so
> >         we must use spin_lock_irqsave() & co.
> > 
> > Indeed, cmos_interrupt() is called from cmos_check_wkalrm(), which is
> > called from cmos_resume() - apparently not in an interrupt context.
> > 
> > A later
> > commit 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ")
> > did not take account of this and changed spin_lock_irqsave() to spin_lock().
> > This may cause a deadlock as quoted in the body of
> > commit 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()")
> > mentioned earlier.
> 
> This regression was supposed to be fixed by
> https://lore.kernel.org/linux-rtc/20210305122140.28774-1-chris@chris-wilson.co.uk/
> 
> What happened to that one? I don't see it in Linus's tree...
> 

Yes, that's exactly what I was wondering when seeing that patch and it
still sits in my rtc-fixes branch that I forgot to send to Linus...

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2021-09-14  8:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 12:42 rtc,x86: CMOS RTC fixes Mateusz Jończyk
2021-09-12 12:42 ` [PATCH RESEND 1/7] rtc-cmos: take rtc_lock while reading from CMOS Mateusz Jończyk
2021-09-12 12:42 ` [PATCH 2/7] rtc-cmos: dont touch alarm registers during update Mateusz Jończyk
2021-09-12 12:44   ` [TEST PATCH] rtc-cmos: cmos_read_alarm bug demonstration Mateusz Jończyk
2021-09-12 12:42 ` [PATCH v2 3/7] rtc-mc146818-lib: fix RTC presence check Mateusz Jończyk
2021-09-12 12:42 ` [PATCH 4/7] rtc-mc146818-lib: reduce RTC_UIP polling period Mateusz Jończyk
2021-09-12 12:42 ` [PATCH 5/7] x86/rtc: mach_get_cmos_time - rm duplicated code Mateusz Jończyk
2021-09-12 12:42 ` [PATCH 6/7] x86/rtc: rename mach_set_rtc_mmss Mateusz Jończyk
2021-09-12 12:42 ` [PATCH 7/7] Revert "rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ" Mateusz Jończyk
2021-09-14  8:02   ` Ville Syrjälä
2021-09-14  8:22     ` Alexandre Belloni [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=YUBbzzHfmxiafJUs@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mat.jonczyk@o2.pl \
    --cc=tanxiaofei@huawei.com \
    --cc=ville.syrjala@linux.intel.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