From: Russell King <rmk+lkml@arm.linux.org.uk>
To: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
Cc: Pete Zaitcev <zaitcev@redhat.com>,
gregkh@suse.de, alan@lxorguk.ukuu.org.uk,
linux-kernel@vger.kernel.org,
linux-usb-devel@lists.sourceforge.net
Subject: Re: Serial-Core: USB-Serial port current issues.
Date: Wed, 21 Jun 2006 17:43:36 +0100 [thread overview]
Message-ID: <20060621164336.GD24265@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060621133500.18e82511@doriath.conectiva>
On Wed, Jun 21, 2006 at 01:35:00PM -0300, Luiz Fernando N. Capitulino wrote:
> On Tue, 20 Jun 2006 19:32:33 -0700
> Pete Zaitcev <zaitcev@redhat.com> wrote:
>
> | On Tue, 20 Jun 2006 16:11:34 -0300, "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br> wrote:
> |
> | > Pete, was it your original idea to completely move from the spinlock
> | > to a mutex?
> |
> | I thought it was the cleanest solution. But perhaps I miss something.
> | I'll look at your reposted patch again, maybe it's all right as it is.
>
> Actually, that's the best solution from the USB-Serial's POV.
>
> The problem is that several serial drivers uses the uart_port's
> spinlock to implement their own locking, and some of them acquires the
> lock in its interrupt handler...
>
> Sh*t.
It all depends what you are locking.
In the uart_update_mctrl() case, the purpose of the locking is to
prevent two concurrent changes to the modem control state resulting
in an inconsistency between the hardware and the software state. If
it's provable that it is always called from process context (and
it isn't called from a lock_kernel()-section or the lock_kernel()
section doesn't mind a rescheduling point being introduced there),
there's no problem converting that to a mutex.
I suspect that it needed to be a spinlock back in the days when
the low latency mode directly called into the ldisc, which could
then call back into the driver again from interrupt mode.
With get_mctrl(), the situation is slightly more complicated, because
we need to atomically update tty->hw_stopped in some circumstances
(that may also be modified from irq context.) Therefore, to give
the driver a consistent locking picture, the spinlock is _always_
held.
--
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-06-21 16:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-13 22:28 Serial-Core: USB-Serial port current issues Luiz Fernando N. Capitulino
2006-06-14 15:28 ` Russell King
2006-06-14 20:38 ` Luiz Fernando N. Capitulino
2006-06-15 0:53 ` Pete Zaitcev
2006-06-15 13:29 ` Luiz Fernando N. Capitulino
2006-06-15 16:07 ` Greg KH
2006-06-15 16:21 ` Luiz Fernando N. Capitulino
2006-06-20 19:11 ` Luiz Fernando N. Capitulino
2006-06-21 2:32 ` Pete Zaitcev
2006-06-21 16:35 ` Luiz Fernando N. Capitulino
2006-06-21 16:43 ` Russell King [this message]
2006-06-21 21:15 ` Luiz Fernando N. Capitulino
2006-06-22 8:29 ` Russell King
2006-06-23 17:28 ` Luiz Fernando N. Capitulino
2006-06-26 22:26 ` Greg KH
2006-06-27 0:49 ` Paul Fulghum
2006-07-04 19:42 ` Luiz Fernando N. Capitulino
2006-07-04 19:50 ` Pete Zaitcev
2006-07-04 20:36 ` Luiz Fernando N. Capitulino
2006-07-05 13:40 ` [linux-usb-devel] " Paul Fulghum
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=20060621164336.GD24265@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=lcapitulino@mandriva.com.br \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=zaitcev@redhat.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