linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems with USB
@ 2003-01-12 20:44 Petr.Titera
  2003-01-13  5:55 ` Greg KH
       [not found] ` <mailman.1042437481.27105.linux-kernel2news@redhat.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Petr.Titera @ 2003-01-12 20:44 UTC (permalink / raw)
  To: linux-kernel

Hello all,

     I have problems with USB in recent kernels (tested on 2.5.56) and
RedHat 8.0. Right after end of script  '/etc/rc.d/rc.sysinit' and before
script '/etc/rc.d/rc' which runs after USB  daemon khubd gets some signal
and ends. From this point USB does not work as as system does not get any
plug events. If I disable USB at startup and load modules later, everything
works.
     Under 2.4.x kernel everithing works as expected.


Petr Titera
petr.titera@whitesoft.cz



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with USB
  2003-01-12 20:44 Problems with USB Petr.Titera
@ 2003-01-13  5:55 ` Greg KH
       [not found] ` <mailman.1042437481.27105.linux-kernel2news@redhat.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2003-01-13  5:55 UTC (permalink / raw)
  To: Petr.Titera; +Cc: linux-kernel

On Sun, Jan 12, 2003 at 09:44:42PM +0100, Petr.Titera@whitesoft.cz wrote:
> Hello all,
> 
>      I have problems with USB in recent kernels (tested on 2.5.56) and
> RedHat 8.0. Right after end of script  '/etc/rc.d/rc.sysinit' and before
> script '/etc/rc.d/rc' which runs after USB  daemon khubd gets some signal
> and ends. From this point USB does not work as as system does not get any
> plug events. If I disable USB at startup and load modules later, everything
> works.

Can you try this patch that I just added to the USB tree?  It seems to
work for me.

thanks,

greg k-h


# USB: Fix from Jeff and Pete to keep khubd from being able to be killed
#      by a signal

diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
+++ b/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
@@ -1085,6 +1085,12 @@
 
 	daemonize();
 
+	/* keep others from killing us */
+	spin_lock_irq(&current->sig->siglock);
+	sigemptyset(&current->blocked);
+	recalc_sigpending();
+	spin_unlock_irq(&current->sig->siglock);
+
 	/* Setup a nice name */
 	strcpy(current->comm, "khubd");
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with USB
       [not found] ` <mailman.1042437481.27105.linux-kernel2news@redhat.com>
@ 2003-01-13 18:59   ` Pete Zaitcev
  2003-01-13 19:09     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Pete Zaitcev @ 2003-01-13 18:59 UTC (permalink / raw)
  To: Greg KH, torvalds; +Cc: linux-kernel, zaitcev

> On Sun, Jan 12, 2003 at 09:44:42PM +0100, Petr.Titera@whitesoft.cz wrote:
>>      I have problems with USB in recent kernels (tested on 2.5.56) and
>> RedHat 8.0. Right after end of script  '/etc/rc.d/rc.sysinit' and before
>> script '/etc/rc.d/rc' which runs after USB  daemon khubd gets some signal
>> and ends.

> greg k-h
> 
> # USB: Fix from Jeff and Pete to keep khubd from being able to be killed
> #      by a signal
> 
> diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> --- a/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
> +++ b/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
> @@ -1085,6 +1085,12 @@
>  
>  	daemonize();
>  
> +	/* keep others from killing us */
> +	spin_lock_irq(&current->sig->siglock);
> +	sigemptyset(&current->blocked);
> +	recalc_sigpending();
> +	spin_unlock_irq(&current->sig->siglock);
> +
>  	/* Setup a nice name */
>  	strcpy(current->comm, "khubd");
>  

For the record, I disagree with this strongly.

In khubd case, the existing code did it righ. It ran
daemonize(), which should have divorced it from the session
and process group. If daemonize is buggy, it is the place
to fix it. Ingo has the fix for 2.5, in fact, I think he
may have sent it to Linus already (it's __set_special_pids()).

My version of the patch above never was intended as anything
but a stop-gap solution which allowed us to ship a beta on
schedule, while I was investigating the cause.

Jeff told me on IRC that "every bit in 8139too.c thread was
added as a response to a particular problem", but he did not
remember what particular problem this kludge fixed there.

I stole the stop-gap from Stephen's kjournald. Note, that
I do not have any idea why he put it in there. Very likely,
for entirely different reason than working around bugs in
daemonize().

-- Pete

[P.S. Greg, if Jeff's P.O.V. prevails in the court of Linus,
change that sigemptyset() to siginitsetinv(...., sigmask(SIGKILL)).
Otherwise the whole signal checking path in khubd becomes utterly
meaningless.]

[P.P.S And take my name from the bk message. Yes, I wrote
the patch, but I do not want to endorse it, however indirectly]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with USB
  2003-01-13 18:59   ` Pete Zaitcev
@ 2003-01-13 19:09     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2003-01-13 19:09 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: torvalds, linux-kernel

On Mon, Jan 13, 2003 at 01:59:09PM -0500, Pete Zaitcev wrote:
> > On Sun, Jan 12, 2003 at 09:44:42PM +0100, Petr.Titera@whitesoft.cz wrote:
> >>      I have problems with USB in recent kernels (tested on 2.5.56) and
> >> RedHat 8.0. Right after end of script  '/etc/rc.d/rc.sysinit' and before
> >> script '/etc/rc.d/rc' which runs after USB  daemon khubd gets some signal
> >> and ends.
> 
> > greg k-h
> > 
> > # USB: Fix from Jeff and Pete to keep khubd from being able to be killed
> > #      by a signal
> > 
> > diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > --- a/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
> > +++ b/drivers/usb/core/hub.c	Sun Jan 12 22:03:13 2003
> > @@ -1085,6 +1085,12 @@
> >  
> >  	daemonize();
> >  
> > +	/* keep others from killing us */
> > +	spin_lock_irq(&current->sig->siglock);
> > +	sigemptyset(&current->blocked);
> > +	recalc_sigpending();
> > +	spin_unlock_irq(&current->sig->siglock);
> > +
> >  	/* Setup a nice name */
> >  	strcpy(current->comm, "khubd");
> >  
> 
> For the record, I disagree with this strongly.

Ok, Arjan also just convinced me to revert this patch, as Ingo's patch
is the correct fix.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with USB
  2003-01-13  8:13 Petr.Titera
@ 2003-01-13 17:20 ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2003-01-13 17:20 UTC (permalink / raw)
  To: Petr.Titera; +Cc: linux-kernel

On Mon, Jan 13, 2003 at 09:13:44AM +0100, Petr.Titera@whitesoft.cz wrote:
> 
> Hello,
> 
>      yes it look that this patch can work.

Great, thanks for testing this.

> But who send that signal. I tried to hack kernel to print signal
> number and it looks, that khubd gets SIGHUP.

I think it's something in the NGTL code, but I'm not really sure.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with USB
@ 2003-01-13  8:13 Petr.Titera
  2003-01-13 17:20 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Petr.Titera @ 2003-01-13  8:13 UTC (permalink / raw)
  To: Greg KH, linux-kernel


Hello,

     yes it look that this patch can work. But who send that signal. I
tried to hack kernel to print signal number and it looks, that khubd gets
SIGHUP.

Petr Titera
petr.titera@whitesoft.cz



                                                                                            
                    Greg KH                                                                 
                    <greg@kroah.co       To:     Petr.Titera@whitesoft.cz                   
                    m>                   cc:     linux-kernel@vger.kernel.org               
                                         Fax to:                                            
                    13.01.2003           Subject:     Re: Problems with USB                 
                    06:55                                                                   
                                                                                            
                                                                                            




On Sun, Jan 12, 2003 at 09:44:42PM +0100, Petr.Titera@whitesoft.cz wrote:
> Hello all,
>
>      I have problems with USB in recent kernels (tested on 2.5.56) and
> RedHat 8.0. Right after end of script  '/etc/rc.d/rc.sysinit' and before
> script '/etc/rc.d/rc' which runs after USB  daemon khubd gets some signal
> and ends. From this point USB does not work as as system does not get any
> plug events. If I disable USB at startup and load modules later,
everything
> works.

Can you try this patch that I just added to the USB tree?  It seems to
work for me.

thanks,

greg k-h


# USB: Fix from Jeff and Pete to keep khubd from being able to be killed
#      by a signal

diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c  Sun Jan 12 22:03:13 2003
+++ b/drivers/usb/core/hub.c  Sun Jan 12 22:03:13 2003
@@ -1085,6 +1085,12 @@

     daemonize();

+    /* keep others from killing us */
+    spin_lock_irq(&current->sig->siglock);
+    sigemptyset(&current->blocked);
+    recalc_sigpending();
+    spin_unlock_irq(&current->sig->siglock);
+
     /* Setup a nice name */
     strcpy(current->comm, "khubd");





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-13 19:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-12 20:44 Problems with USB Petr.Titera
2003-01-13  5:55 ` Greg KH
     [not found] ` <mailman.1042437481.27105.linux-kernel2news@redhat.com>
2003-01-13 18:59   ` Pete Zaitcev
2003-01-13 19:09     ` Greg KH
2003-01-13  8:13 Petr.Titera
2003-01-13 17:20 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).