Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-04-07 Thread Rusty Russell
On Tue, 6 Apr 2010 09:12:38 pm Anton Blanchard wrote: The patch below changes things to call tty_kref_put once for every hvc_close call, and with that my machine boots fine. Thanks, applied. Cheers, Rusty. ___ Linuxppc-dev mailing list

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-04-06 Thread Anton Blanchard
Hi, Looking at the commit e74d098c66543d0731de62eb747ccd5b636a6f4c, i see that for every tty_kref_get() there is a corresponding tty_kref_put() except maybe for the one in the following patch snippet spin_lock_irqsave(hp-lock, flags); /* Check and then increment for

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-04-06 Thread Amit Shah
On (Tue) Apr 06 2010 [21:42:38], Anton Blanchard wrote: Hi, Looking at the commit e74d098c66543d0731de62eb747ccd5b636a6f4c, i see that for every tty_kref_get() there is a corresponding tty_kref_put() except maybe for the one in the following patch snippet

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-04-06 Thread Sachin Sant
Anton Blanchard wrote: The patch below changes things to call tty_kref_put once for every hvc_close call, and with that my machine boots fine. Signed-off-by: Anton Blanchard an...@samba.org --- Works for me. Thanks Anton. Regards -Sachin diff --git a/drivers/char/hvc_console.c

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-04-06 Thread Alan Cox
I don't claim to understand the tty layer, but it seems like hvc_open and hvc_close should be balanced in their kref reference counting. They should yes. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Sachin Sant
Amit Shah wrote: On (Sun) Mar 21 2010 [10:07:25], Amit Shah wrote: On (Sun) Mar 21 2010 [08:04:39], Benjamin Herrenschmidt wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Amit Shah
On (Fri) Mar 26 2010 [14:43:56], Sachin Sant wrote: And this suggests that hvc_kick() is called before hvc_task is initialised, ie, before hvc_init() is called. Does this help? Hi Amit, I too ran into this issue as reported by Anton. Unfortunately in my case the following suggested

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Stephen Rothwell
Hi Amit, On Fri, 26 Mar 2010 15:28:21 +0530 Amit Shah amit.s...@redhat.com wrote: On (Fri) Mar 26 2010 [14:43:56], Sachin Sant wrote: I too ran into this issue as reported by Anton. Unfortunately in my case the following suggested patch does not help boot the powerpc box successfully.

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Sachin Sant
Amit Shah wrote: On (Fri) Mar 26 2010 [14:43:56], Sachin Sant wrote: And this suggests that hvc_kick() is called before hvc_task is initialised, ie, before hvc_init() is called. Does this help? Hi Amit, I too ran into this issue as reported by Anton. Unfortunately in my case the

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Alan Cox
mount: can't find /root/proc in /etc/fstab or /etc/mtab /sbin/smart_agetty: can not determine 'console' speed OK, this gets even murkier. I don't know why taking a few krefs modifies hvc_console behaviour to such an extent. Can you see if the agetty is getting a hangup or open

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Amit Shah
On (Fri) Mar 26 2010 [17:12:22], Sachin Sant wrote: Amit Shah wrote: On (Fri) Mar 26 2010 [14:43:56], Sachin Sant wrote: And this suggests that hvc_kick() is called before hvc_task is initialised, ie, before hvc_init() is called. Does this help? Hi Amit, I too ran into this

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-26 Thread Amit Shah
On (Fri) Mar 26 2010 [11:52:33], Alan Cox wrote: mount: can't find /root/proc in /etc/fstab or /etc/mtab /sbin/smart_agetty: can not determine 'console' speed OK, this gets even murkier. I don't know why taking a few krefs modifies hvc_console behaviour to such an extent.

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-25 Thread Anton Blanchard
Hi, And this suggests that hvc_kick() is called before hvc_task is initialised, ie, before hvc_init() is called. Does this help? Looks good, tests OK on my POWER5 box. Thanks! Tested-by: Anton Blanchard an...@samba.org diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-25 Thread Amit Shah
On (Fri) Mar 26 2010 [10:30:31], Anton Blanchard wrote: Hi, And this suggests that hvc_kick() is called before hvc_task is initialised, ie, before hvc_init() is called. Does this help? Looks good, tests OK on my POWER5 box. Thanks! Tested-by: Anton Blanchard an...@samba.org

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-24 Thread Benjamin Herrenschmidt
On Sun, 2010-03-21 at 08:04 +1100, Benjamin Herrenschmidt wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is invoked. The recent virtio_console work is the first user of

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-24 Thread Amit Shah
On (Wed) Mar 24 2010 [21:45:44], Benjamin Herrenschmidt wrote: On Sun, 2010-03-21 at 08:04 +1100, Benjamin Herrenschmidt wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-24 Thread Alan Cox
On Sun, 21 Mar 2010 08:04:39 +1100 Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is invoked. The recent virtio_console work is

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-24 Thread Amit Shah
On (Sun) Mar 21 2010 [10:07:25], Amit Shah wrote: On (Sun) Mar 21 2010 [08:04:39], Benjamin Herrenschmidt wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is invoked. The

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-24 Thread Amit Shah
On (Wed) Mar 24 2010 [11:37:21], Alan Cox wrote: On Sun, 21 Mar 2010 08:04:39 +1100 Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-20 Thread Benjamin Herrenschmidt
On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is invoked. The recent virtio_console work is the first user of hvc_remove(). This causes hangs during boot on pseries machines. Haven't had

Re: [PATCH 4/7] hvc_console: Fix race between hvc_close and hvc_remove

2010-03-20 Thread Amit Shah
On (Sun) Mar 21 2010 [08:04:39], Benjamin Herrenschmidt wrote: On Fri, 2010-03-19 at 08:18 -0700, Greg Kroah-Hartman wrote: From: Amit Shah amit.s...@redhat.com Alan pointed out a race in the code where hvc_remove is invoked. The recent virtio_console work is the first user of