From: Jiri Slaby <jslaby@suse•cz>
To: Paul Mackerras <paulus@samba•org>
Cc: linuxppc-dev@ozlabs•org, alan@linux•intel.com, anton@samba•org,
gregkh@linuxfoundation•org
Subject: Re: [PATCH] TTY: hvc_console, fix port reference count going to zero prematurely
Date: Wed, 14 Nov 2012 10:45:40 +0100 [thread overview]
Message-ID: <50A36844.7080207@suse.cz> (raw)
In-Reply-To: <20121114081547.GA573@bloggs.ozlabs.ibm.com>
On 11/14/2012 09:15 AM, Paul Mackerras wrote:
> Commit bdb498c20040 "TTY: hvc_console, add tty install" took the port
> refcounting out of hvc_open()/hvc_close(), but failed to remove the
> kref_put() and tty_kref_put() calls in hvc_hangup() that were there to
> remove the extra references that hvc_open() had taken.
>
> The result was that doing a vhangup() when the current terminal was
> a hvc_console, then closing the current terminal, would end up calling
> destroy_hvc_struct() and making the port disappear entirely. This
> meant that Fedora 17 systems would boot up but then not display the
> login prompt on the console, and attempts to open /dev/hvc0 would
> give a "No such device" error.
>
> This fixes it by removing the extra kref_put() and tty_kref_put() calls.
Oh yeah. Thanks.
Acked-by: Jiri Slaby <jslaby@suse•cz>
> Signed-off-by: Paul Mackerras <paulus@samba•org>
> Cc: stable@vger•kernel.org
> ---
> drivers/tty/hvc/hvc_console.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
> index a5dec1c..13ee53b 100644
> --- a/drivers/tty/hvc/hvc_console.c
> +++ b/drivers/tty/hvc/hvc_console.c
> @@ -424,7 +424,6 @@ static void hvc_hangup(struct tty_struct *tty)
> {
> struct hvc_struct *hp = tty->driver_data;
> unsigned long flags;
> - int temp_open_count;
>
> if (!hp)
> return;
> @@ -444,7 +443,6 @@ static void hvc_hangup(struct tty_struct *tty)
> return;
> }
>
> - temp_open_count = hp->port.count;
> hp->port.count = 0;
> spin_unlock_irqrestore(&hp->port.lock, flags);
> tty_port_tty_set(&hp->port, NULL);
> @@ -453,11 +451,6 @@ static void hvc_hangup(struct tty_struct *tty)
>
> if (hp->ops->notifier_hangup)
> hp->ops->notifier_hangup(hp, hp->data);
> -
> - while(temp_open_count) {
> - --temp_open_count;
> - tty_port_put(&hp->port);
> - }
> }
>
> /*
>
--
js
suse labs
next prev parent reply other threads:[~2012-11-14 9:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 8:15 [PATCH] TTY: hvc_console, fix port reference count going to zero prematurely Paul Mackerras
2012-11-14 9:45 ` Jiri Slaby [this message]
2012-11-14 12:47 ` Benjamin Herrenschmidt
2012-11-14 15:09 ` Greg KH
2012-11-14 20:48 ` Benjamin Herrenschmidt
2012-11-14 20:54 ` Greg KH
2012-11-14 20:57 ` Benjamin Herrenschmidt
2012-11-14 23:02 ` Paul Mackerras
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=50A36844.7080207@suse.cz \
--to=jslaby@suse$(echo .)cz \
--cc=alan@linux$(echo .)intel.com \
--cc=anton@samba$(echo .)org \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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