Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-15 Thread Oliver Neukum
 
> The patches which really seem to fix the underlying problem can be found
> in this thread:
> 
> http://thread.gmane.org/gmane.linux.usb.devel/32977
> 
> (see "[PATCH] N/3 cdc acm errors").
> 
> You also need this driver core fix:
> 
> http://thread.gmane.org/gmane.linux.usb.devel/33132

Has the fix been applied?

Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-15 Thread Oliver Neukum
 
 The patches which really seem to fix the underlying problem can be found
 in this thread:
 
 http://thread.gmane.org/gmane.linux.usb.devel/32977
 
 (see [PATCH] N/3 cdc acm errors).
 
 You also need this driver core fix:
 
 http://thread.gmane.org/gmane.linux.usb.devel/33132

Has the fix been applied?

Regards
Oliver
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread Sergey Vlasov
On Thu, 14 Apr 2005 14:40:36 +0200 Grzegorz Piotr Jaskiewicz wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Works great, I would like to ask everyone here on lkml to consider
> adding this patch to mainline.
> This ain't naughty solution, checking for object/pointer/whatever if
> exists before doing anything with it, is good.

No, this patch is broken.  It just avoids the problem in 99% of cases,
but it is not reliable.  The real problem is that refcounting in cdc-acm
is broken, and the kernel is accessing freed memory.

The patches which really seem to fix the underlying problem can be found
in this thread:

http://thread.gmane.org/gmane.linux.usb.devel/32977

(see "[PATCH] N/3 cdc acm errors").

You also need this driver core fix:

http://thread.gmane.org/gmane.linux.usb.devel/33132


> Anyone?
> 
> Buy the way, I am also looking for usblan for 2.6, can I use usbnet
> instead ? Anyone ported usblan to 2.6 (it's on GPL).
> 
> JustMan wrote:
> >>So,
> >>
> >>I plugged in e680 motorola phone, played a bit with minicom on
> >>/dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
> >>got to reboot computer to use it again!
> >>it's vanilla 2.6.11.7
> >>
> >>oops attached.
> >>
> > 
> > 
> > Try attached patch... (nasty solution, but it work for my C350  motorola 
> > phone)
> > 
> > 
> >>
> > 
> > 
> > 
> > 
> > diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
> > --- linux/drivers/base/class.orig.c 2005-03-10 12:19:00.0 +0300
> > +++ linux/drivers/base/class.c  2005-03-10 13:59:27.0 +0300
> > @@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
> > if (class_dev->dev) {
> > /* add physical device, backing this device  */
> > struct device *dev = class_dev->dev;
> > -   char *path = kobject_get_path(>kobj, GFP_KERNEL);
> >  
> > -   add_hotplug_env_var(envp, num_envp, , buffer, buffer_size,
> > -   , "PHYSDEVPATH=%s", path);
> > -   kfree(path);
> > +   if(kobject_name(>kobj)) {
> > +   char *path = kobject_get_path(>kobj, GFP_KERNEL);
> >  
> > +   add_hotplug_env_var(envp, num_envp, , buffer, 
> > buffer_size,
> > +   , "PHYSDEVPATH=%s", path);
> > +   kfree(path);
> > +   }
> > /* add bus name of physical device */
> > if (dev->bus)
> > add_hotplug_env_var(envp, num_envp, ,
> 
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.0 (GNU/Linux)
> 
> iD8DBQFCXmTEi0HtPCVkDAURAvIMAJ4+8tKj6jt/ErTtCrsmNYtM2aDfNACgigLA
> 4GbLbHStQJBq+Ez1lFe+lPo=
> =UWvD
> -END PGP SIGNATURE-


pgpUenWk4qHrf.pgp
Description: PGP signature


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread Grzegorz Piotr Jaskiewicz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Works great, I would like to ask everyone here on lkml to consider
adding this patch to mainline.
This ain't naughty solution, checking for object/pointer/whatever if
exists before doing anything with it, is good.

Anyone?

Buy the way, I am also looking for usblan for 2.6, can I use usbnet
instead ? Anyone ported usblan to 2.6 (it's on GPL).

JustMan wrote:
>>So,
>>
>>I plugged in e680 motorola phone, played a bit with minicom on
>>/dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
>>got to reboot computer to use it again!
>>it's vanilla 2.6.11.7
>>
>>oops attached.
>>
> 
> 
> Try attached patch... (nasty solution, but it work for my C350  motorola 
> phone)
> 
> 
>>
> 
> 
> 
> 
> diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
> --- linux/drivers/base/class.orig.c   2005-03-10 12:19:00.0 +0300
> +++ linux/drivers/base/class.c2005-03-10 13:59:27.0 +0300
> @@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
>   if (class_dev->dev) {
>   /* add physical device, backing this device  */
>   struct device *dev = class_dev->dev;
> - char *path = kobject_get_path(>kobj, GFP_KERNEL);
>  
> - add_hotplug_env_var(envp, num_envp, , buffer, buffer_size,
> - , "PHYSDEVPATH=%s", path);
> - kfree(path);
> + if(kobject_name(>kobj)) {
> + char *path = kobject_get_path(>kobj, GFP_KERNEL);
>  
> + add_hotplug_env_var(envp, num_envp, , buffer, 
> buffer_size,
> + , "PHYSDEVPATH=%s", path);
> + kfree(path);
> + }
>   /* add bus name of physical device */
>   if (dev->bus)
>   add_hotplug_env_var(envp, num_envp, ,

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCXmTEi0HtPCVkDAURAvIMAJ4+8tKj6jt/ErTtCrsmNYtM2aDfNACgigLA
4GbLbHStQJBq+Ez1lFe+lPo=
=UWvD
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread JustMan
> So,
> 
> I plugged in e680 motorola phone, played a bit with minicom on
> /dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
> got to reboot computer to use it again!
> it's vanilla 2.6.11.7
> 
> oops attached.
> 

Try attached patch... (nasty solution, but it work for my C350  motorola phone)

> 
> 

-- 
Regards, JustMan.
diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
--- linux/drivers/base/class.orig.c	2005-03-10 12:19:00.0 +0300
+++ linux/drivers/base/class.c	2005-03-10 13:59:27.0 +0300
@@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
 	if (class_dev->dev) {
 		/* add physical device, backing this device  */
 		struct device *dev = class_dev->dev;
-		char *path = kobject_get_path(>kobj, GFP_KERNEL);
 
-		add_hotplug_env_var(envp, num_envp, , buffer, buffer_size,
-, "PHYSDEVPATH=%s", path);
-		kfree(path);
+		if(kobject_name(>kobj)) {
+			char *path = kobject_get_path(>kobj, GFP_KERNEL);
 
+			add_hotplug_env_var(envp, num_envp, , buffer, buffer_size,
+, "PHYSDEVPATH=%s", path);
+			kfree(path);
+		}
 		/* add bus name of physical device */
 		if (dev->bus)
 			add_hotplug_env_var(envp, num_envp, ,


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread JustMan
 So,
 
 I plugged in e680 motorola phone, played a bit with minicom on
 /dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
 got to reboot computer to use it again!
 it's vanilla 2.6.11.7
 
 oops attached.
 

Try attached patch... (nasty solution, but it work for my C350  motorola phone)

 
 

-- 
Regards, JustMan.
diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
--- linux/drivers/base/class.orig.c	2005-03-10 12:19:00.0 +0300
+++ linux/drivers/base/class.c	2005-03-10 13:59:27.0 +0300
@@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
 	if (class_dev-dev) {
 		/* add physical device, backing this device  */
 		struct device *dev = class_dev-dev;
-		char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
 
-		add_hotplug_env_var(envp, num_envp, i, buffer, buffer_size,
-length, PHYSDEVPATH=%s, path);
-		kfree(path);
+		if(kobject_name(dev-kobj)) {
+			char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
 
+			add_hotplug_env_var(envp, num_envp, i, buffer, buffer_size,
+length, PHYSDEVPATH=%s, path);
+			kfree(path);
+		}
 		/* add bus name of physical device */
 		if (dev-bus)
 			add_hotplug_env_var(envp, num_envp, i,


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread Grzegorz Piotr Jaskiewicz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Works great, I would like to ask everyone here on lkml to consider
adding this patch to mainline.
This ain't naughty solution, checking for object/pointer/whatever if
exists before doing anything with it, is good.

Anyone?

Buy the way, I am also looking for usblan for 2.6, can I use usbnet
instead ? Anyone ported usblan to 2.6 (it's on GPL).

JustMan wrote:
So,

I plugged in e680 motorola phone, played a bit with minicom on
/dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
got to reboot computer to use it again!
it's vanilla 2.6.11.7

oops attached.

 
 
 Try attached patch... (nasty solution, but it work for my C350  motorola 
 phone)
 
 

 
 
 
 
 diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
 --- linux/drivers/base/class.orig.c   2005-03-10 12:19:00.0 +0300
 +++ linux/drivers/base/class.c2005-03-10 13:59:27.0 +0300
 @@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
   if (class_dev-dev) {
   /* add physical device, backing this device  */
   struct device *dev = class_dev-dev;
 - char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
  
 - add_hotplug_env_var(envp, num_envp, i, buffer, buffer_size,
 - length, PHYSDEVPATH=%s, path);
 - kfree(path);
 + if(kobject_name(dev-kobj)) {
 + char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
  
 + add_hotplug_env_var(envp, num_envp, i, buffer, 
 buffer_size,
 + length, PHYSDEVPATH=%s, path);
 + kfree(path);
 + }
   /* add bus name of physical device */
   if (dev-bus)
   add_hotplug_env_var(envp, num_envp, i,

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCXmTEi0HtPCVkDAURAvIMAJ4+8tKj6jt/ErTtCrsmNYtM2aDfNACgigLA
4GbLbHStQJBq+Ez1lFe+lPo=
=UWvD
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [OOPS] on usb removal, and minicom closing 2.6.11.7

2005-04-14 Thread Sergey Vlasov
On Thu, 14 Apr 2005 14:40:36 +0200 Grzegorz Piotr Jaskiewicz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Works great, I would like to ask everyone here on lkml to consider
 adding this patch to mainline.
 This ain't naughty solution, checking for object/pointer/whatever if
 exists before doing anything with it, is good.

No, this patch is broken.  It just avoids the problem in 99% of cases,
but it is not reliable.  The real problem is that refcounting in cdc-acm
is broken, and the kernel is accessing freed memory.

The patches which really seem to fix the underlying problem can be found
in this thread:

http://thread.gmane.org/gmane.linux.usb.devel/32977

(see [PATCH] N/3 cdc acm errors).

You also need this driver core fix:

http://thread.gmane.org/gmane.linux.usb.devel/33132


 Anyone?
 
 Buy the way, I am also looking for usblan for 2.6, can I use usbnet
 instead ? Anyone ported usblan to 2.6 (it's on GPL).
 
 JustMan wrote:
 So,
 
 I plugged in e680 motorola phone, played a bit with minicom on
 /dev/ttyACM0, and when I closed minicom, got this oops. USB is useless,
 got to reboot computer to use it again!
 it's vanilla 2.6.11.7
 
 oops attached.
 
  
  
  Try attached patch... (nasty solution, but it work for my C350  motorola 
  phone)
  
  
 
  
  
  
  
  diff -uNrp linux/drivers/base/class.orig.c  linux/drivers/base/class.c
  --- linux/drivers/base/class.orig.c 2005-03-10 12:19:00.0 +0300
  +++ linux/drivers/base/class.c  2005-03-10 13:59:27.0 +0300
  @@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
  if (class_dev-dev) {
  /* add physical device, backing this device  */
  struct device *dev = class_dev-dev;
  -   char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
   
  -   add_hotplug_env_var(envp, num_envp, i, buffer, buffer_size,
  -   length, PHYSDEVPATH=%s, path);
  -   kfree(path);
  +   if(kobject_name(dev-kobj)) {
  +   char *path = kobject_get_path(dev-kobj, GFP_KERNEL);
   
  +   add_hotplug_env_var(envp, num_envp, i, buffer, 
  buffer_size,
  +   length, PHYSDEVPATH=%s, path);
  +   kfree(path);
  +   }
  /* add bus name of physical device */
  if (dev-bus)
  add_hotplug_env_var(envp, num_envp, i,
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.0 (GNU/Linux)
 
 iD8DBQFCXmTEi0HtPCVkDAURAvIMAJ4+8tKj6jt/ErTtCrsmNYtM2aDfNACgigLA
 4GbLbHStQJBq+Ez1lFe+lPo=
 =UWvD
 -END PGP SIGNATURE-


pgpUenWk4qHrf.pgp
Description: PGP signature