From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Dave Jiang <djiang@mvista.com>
Cc: linux-kernel@vger.kernel.org, mgreer@mvista.com
Subject: Re: [PATCH] MPSC serial driver tx locking
Date: Wed, 10 May 2006 17:27:08 +0100 [thread overview]
Message-ID: <20060510162708.GD32632@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060510003552.GB22447@blade.az.mvista.com>
On Tue, May 09, 2006 at 05:35:52PM -0700, Dave Jiang wrote:
> @@ -1997,7 +2018,7 @@ mpsc_drv_probe(struct platform_device *d
> if (!(rc = mpsc_make_ready(pi)))
> if (!(rc = uart_add_one_port(&mpsc_reg,
> &pi->port)))
> - rc = 0;
> + spin_lock_init(&pi->tx_lock);
You publish the port to the uart layer and then do initialisation.
What if someone nips in and starts using the port between registering
it and initialising the spinlock? (that's a general principle - for
any device driver, never publish the device interfaces until you've
completed all initialisation.)
Why not do the spinlock initialisation first?
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-05-10 16:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-10 0:35 [PATCH] MPSC serial driver tx locking Dave Jiang
2006-05-10 16:27 ` Russell King [this message]
2006-05-10 18:08 ` Dave Jiang
-- strict thread matches above, loose matches on Subject: below --
2007-03-06 23:24 Dave Jiang
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=20060510162708.GD32632@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=djiang@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgreer@mvista.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.