From: Arnd Bergmann <arnd@arndb.de>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Cc: Atul Sowani <sowani@gmail.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, alan@linux.intel.com,
ralf@linux-mips.org
Subject: Re: [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED()
Date: Mon, 15 Nov 2010 10:44:36 +0100 [thread overview]
Message-ID: <201011151044.36213.arnd@arndb.de> (raw)
In-Reply-To: <20101115092404.GA24194@n2100.arm.linux.org.uk>
On Monday 15 November 2010 10:24:04 Russell King - ARM Linux wrote:
> > diff -uprN a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> > --- a/arch/arm/kernel/smp.c 2010-10-21 02:00:22.000000000 +0530
> > +++ b/arch/arm/kernel/smp.c 2010-11-07 00:47:32.000000000 +0530
> > @@ -56,7 +56,7 @@ struct ipi_data {
> > };
> >
> > static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
> > - .lock = SPIN_LOCK_UNLOCKED,
> > + .lock = __SPIN_LOCK_UNLOCKED(ipi_data.lock),
> > };
>
> This lock is in the percpu data area. This means that when other CPUs
> are brought online, and therefore other percpu areas are instantiated,
> this lock will be mis-initialized (the pointers et.al. will be pointing
> at the original percpu instance.)
>
> So NAK, this will break.
I believe right now we only use the argument of __SPIN_LOCK_UNLOCKED
as an identifier string for lockdep, but not for any pointers, so the
patch would actually do what was intended, but break if we ever start
relying on the pointer.
Maybe we can mangle the argument in some way to make sure it will break
at build time when that happens, e.g.
.lock = __SPIN_LOCK_UNLOCKED(ipi_data.__lock)
This would at least let us remove SPIN_LOCK_UNLOCKED.
Arnd
next prev parent reply other threads:[~2010-11-15 9:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-13 18:31 [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED() Atul Sowani
2010-11-15 8:54 ` Uwe Kleine-König
2010-11-15 9:24 ` Russell King - ARM Linux
2010-11-15 9:44 ` Arnd Bergmann [this message]
2010-11-15 10:06 ` Russell King - ARM Linux
-- strict thread matches above, loose matches on Subject: below --
2010-11-15 14:46 Atul Sowani
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=201011151044.36213.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alan@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ralf@linux-mips.org \
--cc=sowani@gmail.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