public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@suse.de, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] usb console,usb-serial: fix regression use of serial->console
Date: Wed, 16 Sep 2009 22:32:29 -0500	[thread overview]
Message-ID: <4AB1ADCD.9070407@windriver.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0909162326270.24041-100000@netrider.rowland.org>

Alan Stern wrote:
> On Wed, 16 Sep 2009, Jason Wessel wrote:
>
>   
>> During the 2.6.32 development usb serial tty interface was changed.
>> This change caused the usb serial driver to crash when used as a
>> system console.
>>
>> The open and close of the raw hardware has to be protected by the
>> serial->console variable so either the console code does the open and
>> close or the higher level tty based driver executes the open and
>> close.
>>
>> * In serial_open() the raw open must be protected by serial->console
>> * In serial_down() the test_and_clear_bit must be executed before
>>   leaving the function if the device is a serial console
>> * serial_release() should no longer protect for the console condition
>>   due to the 2.6.32 interface changes.  The actual low level close
>>   protection is accounted for in serial_down()
>>
>> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
>> Cc: Greg KH <gregkh@suse.de>
>> Cc: Alan Stern <stern@rowland.harvard.edu>
>>
>> ---
>>  drivers/usb/serial/usb-serial.c |   28 +++++++++++++---------------
>>  1 files changed, 13 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
>> index ff75a35..3d35ed2 100644
>> --- a/drivers/usb/serial/usb-serial.c
>> +++ b/drivers/usb/serial/usb-serial.c
>> @@ -267,10 +267,14 @@ static int serial_open(struct tty_struct *tty, struct file *filp)
>>  		if (mutex_lock_interruptible(&port->mutex))
>>  			return -ERESTARTSYS;
>>  		mutex_lock(&serial->disc_mutex);
>> -		if (serial->disconnected)
>> +		if (serial->disconnected) {
>>  			retval = -ENODEV;
>> -		else
>> -			retval = port->serial->type->open(tty, port);
>> +		} else {
>> +			if (port->console)
>> +				retval = 0;
>> +			else
>> +				retval = port->serial->type->open(tty, port);
>> +		}
>>  		mutex_unlock(&serial->disc_mutex);
>>  		mutex_unlock(&port->mutex);
>>  		if (retval)
>>     
>
> This part of the patch shouldn't be necessary.  The console device
> should always be open.
>
>   

With your other patch you just mentioned, I absolutely agree.  This does
not need to be tracked in this manner and I don't believe this patch is
needed either.



  reply	other threads:[~2009-09-17  3:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17  3:08 [PATCH 0/3] usb console: 2.6.32 regression fixes Jason Wessel
2009-09-17  3:08 ` [PATCH 1/3] usb console: fix mutex lock regression Jason Wessel
2009-09-17  3:08   ` [PATCH 2/3] usb console,usb-serial: fix regression use of serial->console Jason Wessel
2009-09-17  3:08     ` [PATCH 3/3] usb console,usb-serial: pass initial console baud on to first tty open Jason Wessel
2009-09-17  3:32       ` Alan Stern
2009-09-17  3:40         ` Jason Wessel
2009-09-17  3:46           ` Alan Stern
2009-09-17  4:17             ` Jason Wessel
2009-09-17  9:14               ` Alan Cox
2009-09-17 12:16                 ` Jason Wessel
2009-09-17 13:08                   ` Alan Cox
2009-09-17 13:19                     ` Alan Cox
2009-09-17 14:17                       ` Jason Wessel
2009-09-17 16:02                         ` Alan Cox
2009-09-22 20:54                           ` Jason Wessel
2009-09-29 17:24                             ` How to handle console devices Alan Stern
2009-09-29 22:47                               ` Alan Cox
2009-09-17  3:30     ` [PATCH 2/3] usb console,usb-serial: fix regression use of serial->console Alan Stern
2009-09-17  3:32       ` Jason Wessel [this message]
2009-09-17  3:25   ` [PATCH 1/3] usb console: fix mutex lock regression Alan Stern
2009-09-17  3:32     ` Jason Wessel
2009-09-18 17:16     ` Greg KH

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=4AB1ADCD.9070407@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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