public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	Pete Zaitcev <zaitcev@redhat.com>,
	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: Mon, 26 Jun 2006 15:26:28 -0700	[thread overview]
Message-ID: <20060626222628.GC29325@suse.de> (raw)
In-Reply-To: <20060623142842.2b35103b@home.brethil>

On Fri, Jun 23, 2006 at 02:28:42PM -0300, Luiz Fernando N. Capitulino wrote:
> On Thu, 22 Jun 2006 09:29:40 +0100
> Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> 
> | On Wed, Jun 21, 2006 at 06:15:13PM -0300, Luiz Fernando N. Capitulino wrote:
> |
> | > | 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.
> | > 
> | >  Is it too bad (wrong?) to only protect the tty->hw_stopped update
> | > by the spinlock? Then the call to get_mctrl() could be protected by
> | > a mutex, or is it messy?
> | 
> | Consider this scenario with what you're proposing:
> | 
> | 	thread				irq
> | 
> | 	take mutex
> | 	get_mctrl
> | 					cts changes state
> | 					take port lock
> | 					mctrl state read
> | 					tty->hw_stopped changed state
> | 					release port lock
> | 	releaes mutex
> | 	take port lock
> | 	update tty->hw_stopped
> | 	release port lock
> | 
> | Now, tty->hw_stopped does not reflect the hardware state, which will be
> | buggy and can cause a loss of transmission.
> | 
> | I'm not sure what to suggest on this one since for USB drivers you do
> | need to be able to sleep in this method... but for UARTs you must not.
> 
>  Neither do I. :((
> 
>  I thought we could move the 'tty->hw_stopped' update to a workqueue
> but it has the same problem you explained above...
> 
>  Greg, any suggestions?

Nope, sorry, I don't know what to suggest :(

greg k-h

  reply	other threads:[~2006-06-26 22:55 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
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 [this message]
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=20060626222628.GC29325@suse.de \
    --to=gregkh@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=lcapitulino@mandriva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=rmk+lkml@arm.linux.org.uk \
    --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