All of lore.kernel.org
 help / color / mirror / Atom feed
* lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 14:41 ` Sasikanth babu
  0 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-10 14:41 UTC (permalink / raw)
  To: lm-sensors, linux-i2c; +Cc: frodol


[-- Attachment #1.1: Type: text/plain, Size: 1697 bytes --]

Hi all,

  when I'm trying to delete lm75 device using sysfs delete_device attribute
(echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
  It hangs at lm75_remove function. I started the device using sysfs
attribute new_device.


  Kernel verion : 2.6.34.12

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
 ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
 ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
 0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
Call Trace:
 [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
 [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
 [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
 [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
 [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
 [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
 [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
 [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
 [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
 [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
 [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
 [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
 [<ffffffff8129d7a8>] ? device_del+0x118/0x190
 [<ffffffff8129d829>] ? device_unregister+0x9/0x20
 [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
 [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
 [<ffffffff810d5323>] ? vfs_write+0x103/0x200
 [<ffffffff810d550e>] ? sys_write+0x4e/0x90
 [<ffffffff814884e4>] ? page_fault+0x24/0x30
 [<ffffffff810024ab>] ? system_call_done+0x0/0x5

Thanks in advance for your help.

Thanks
Sasi

[-- Attachment #1.2: Type: text/html, Size: 1993 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 14:41 ` Sasikanth babu
  0 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-10 14:41 UTC (permalink / raw)
  To: lm-sensors, linux-i2c; +Cc: frodol


[-- Attachment #1.1: Type: text/plain, Size: 1697 bytes --]

Hi all,

  when I'm trying to delete lm75 device using sysfs delete_device attribute
(echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
  It hangs at lm75_remove function. I started the device using sysfs
attribute new_device.


  Kernel verion : 2.6.34.12

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
 ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
 ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
 0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
Call Trace:
 [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
 [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
 [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
 [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
 [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
 [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
 [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
 [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
 [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
 [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
 [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
 [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
 [<ffffffff8129d7a8>] ? device_del+0x118/0x190
 [<ffffffff8129d829>] ? device_unregister+0x9/0x20
 [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
 [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
 [<ffffffff810d5323>] ? vfs_write+0x103/0x200
 [<ffffffff810d550e>] ? sys_write+0x4e/0x90
 [<ffffffff814884e4>] ? page_fault+0x24/0x30
 [<ffffffff810024ab>] ? system_call_done+0x0/0x5

Thanks in advance for your help.

Thanks
Sasi

[-- Attachment #1.2: Type: text/html, Size: 1993 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
       [not found] ` <CAOJFanUqFZPih6puAy2DWPWPQMs6ZZz_DFgO9wnRttnP5mCPZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-06-10 15:28     ` Guenter Roeck
  2012-06-10 15:36     ` [lm-sensors] " Jean Delvare
  1 sibling, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-10 15:28 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, frodol-B0qZmFHriGg

On Sun, Jun 10, 2012 at 10:41:03AM -0400, Sasikanth babu wrote:
> Hi all,
> 
>   when I'm trying to delete lm75 device using sysfs delete_device attribute
> (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>   It hangs at lm75_remove function. I started the device using sysfs attribute
> new_device.
> 
> 
>   Kernel verion : 2.6.34.12
> 
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> Call Trace:
>  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
>  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 

Hi,

I don't see anything wrong in the lm75 driver. The problem seems to be related
to the I2C bus master driver, or possibly to another device access pending on the
same I2C bus which does not complete.

What is the I2C bus master driver, and do you have anything else happening on the same bus ?

Guenter

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 15:28     ` Guenter Roeck
  0 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-10 15:28 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, frodol-B0qZmFHriGg

On Sun, Jun 10, 2012 at 10:41:03AM -0400, Sasikanth babu wrote:
> Hi all,
> 
>   when I'm trying to delete lm75 device using sysfs delete_device attribute
> (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>   It hangs at lm75_remove function. I started the device using sysfs attribute
> new_device.
> 
> 
>   Kernel verion : 2.6.34.12
> 
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> Call Trace:
>  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
>  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 

Hi,

I don't see anything wrong in the lm75 driver. The problem seems to be related
to the I2C bus master driver, or possibly to another device access pending on the
same I2C bus which does not complete.

What is the I2C bus master driver, and do you have anything else happening on the same bus ?

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: lm75_remove: LM75 Device remove using sysfs  delete_device
       [not found] ` <CAOJFanUqFZPih6puAy2DWPWPQMs6ZZz_DFgO9wnRttnP5mCPZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-06-10 15:36     ` Jean Delvare
  2012-06-10 15:36     ` [lm-sensors] " Jean Delvare
  1 sibling, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-10 15:36 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA

(Note: Frodo is out of the lm-sensors project for years, no need to Cc
him.)

On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
>   when I'm trying to delete lm75 device using sysfs delete_device attribute
> (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>   It hangs at lm75_remove function. I started the device using sysfs
> attribute new_device.
> 
> 
>   Kernel verion : 2.6.34.12

I can't reproduce this with kernel 3.4.2.

Did you try reproducing this with a more recent kernel? 2.6.34 is
getting old.

Is there anything you can think of which makes your system special? I2C
bus multiplexing ? Some unusual kernel option maybe?

> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> Call Trace:
>  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40

This looks odd, sysfs_remove_group() doesn't call
i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
touch dev_sysfs_ops... So this stack trace is approximate.

>  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>  [<ffffffff810024ab>] ? system_call_done+0x0/0x5

-- 
Jean Delvare

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 15:36     ` Jean Delvare
  0 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-10 15:36 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA

(Note: Frodo is out of the lm-sensors project for years, no need to Cc
him.)

On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
>   when I'm trying to delete lm75 device using sysfs delete_device attribute
> (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>   It hangs at lm75_remove function. I started the device using sysfs
> attribute new_device.
> 
> 
>   Kernel verion : 2.6.34.12

I can't reproduce this with kernel 3.4.2.

Did you try reproducing this with a more recent kernel? 2.6.34 is
getting old.

Is there anything you can think of which makes your system special? I2C
bus multiplexing ? Some unusual kernel option maybe?

> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> Call Trace:
>  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40

This looks odd, sysfs_remove_group() doesn't call
i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
touch dev_sysfs_ops... So this stack trace is approximate.

>  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>  [<ffffffff810024ab>] ? system_call_done+0x0/0x5

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
       [not found]     ` <20120610173640.3b21759c-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-06-10 15:46         ` Guenter Roeck
  0 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-10 15:46 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Sasikanth babu, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On Sun, Jun 10, 2012 at 11:36:40AM -0400, Jean Delvare wrote:
> (Note: Frodo is out of the lm-sensors project for years, no need to Cc
> him.)
> 
> On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
> >   when I'm trying to delete lm75 device using sysfs delete_device attribute
> > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> >   It hangs at lm75_remove function. I started the device using sysfs
> > attribute new_device.
> > 
> > 
> >   Kernel verion : 2.6.34.12
> 
> I can't reproduce this with kernel 3.4.2.
> 
> Did you try reproducing this with a more recent kernel? 2.6.34 is
> getting old.
> 
> Is there anything you can think of which makes your system special? I2C
> bus multiplexing ? Some unusual kernel option maybe?
> 
> > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > Call Trace:
> >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> 
> This looks odd, sysfs_remove_group() doesn't call
> i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> touch dev_sysfs_ops... So this stack trace is approximate.
> 
I thought it was probably the call to lm75_write_value() in lm75_remove()
after sysfs_remove_group() returned.

Guenter 

> >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
> >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
> >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
> >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
> >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
> >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
> >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
> >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
> >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
> >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
> >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
> >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
> >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
> >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 
> -- 
> Jean Delvare
> 
> _______________________________________________
> lm-sensors mailing list
> lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 15:46         ` Guenter Roeck
  0 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-10 15:46 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Sasikanth babu, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On Sun, Jun 10, 2012 at 11:36:40AM -0400, Jean Delvare wrote:
> (Note: Frodo is out of the lm-sensors project for years, no need to Cc
> him.)
> 
> On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
> >   when I'm trying to delete lm75 device using sysfs delete_device attribute
> > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> >   It hangs at lm75_remove function. I started the device using sysfs
> > attribute new_device.
> > 
> > 
> >   Kernel verion : 2.6.34.12
> 
> I can't reproduce this with kernel 3.4.2.
> 
> Did you try reproducing this with a more recent kernel? 2.6.34 is
> getting old.
> 
> Is there anything you can think of which makes your system special? I2C
> bus multiplexing ? Some unusual kernel option maybe?
> 
> > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > Call Trace:
> >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> 
> This looks odd, sysfs_remove_group() doesn't call
> i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> touch dev_sysfs_ops... So this stack trace is approximate.
> 
I thought it was probably the call to lm75_write_value() in lm75_remove()
after sysfs_remove_group() returned.

Guenter 

> >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
> >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
> >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
> >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
> >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
> >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
> >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
> >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
> >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
> >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
> >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
> >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
> >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
> >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 
> -- 
> Jean Delvare
> 
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: lm75_remove: LM75 Device remove using sysfs  delete_device
       [not found]         ` <20120610154629.GD10367-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org>
@ 2012-06-10 15:52             ` Jean Delvare
  0 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-10 15:52 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Sasikanth babu, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On Sun, 10 Jun 2012 08:46:29 -0700, Guenter Roeck wrote:
> On Sun, Jun 10, 2012 at 11:36:40AM -0400, Jean Delvare wrote:
> > > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> > >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> > >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> > >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > > Call Trace:
> > >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> > >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> > >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> > >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> > >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> > >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> > 
> > This looks odd, sysfs_remove_group() doesn't call
> > i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> > touch dev_sysfs_ops... So this stack trace is approximate.
> > 
> I thought it was probably the call to lm75_write_value() in lm75_remove()
> after sysfs_remove_group() returned.

Certainly. We see a mix of the function calls in lm75_remove().
lm75_write_value() is definitely the one causing the deadlock. And your
analysis is correct... there's nothing special about this byte write,
so there must be something wrong with the underlying I2C bus even
before that.

-- 
Jean Delvare

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-10 15:52             ` Jean Delvare
  0 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-10 15:52 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Sasikanth babu, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On Sun, 10 Jun 2012 08:46:29 -0700, Guenter Roeck wrote:
> On Sun, Jun 10, 2012 at 11:36:40AM -0400, Jean Delvare wrote:
> > > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> > >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> > >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> > >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > > Call Trace:
> > >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> > >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> > >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> > >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> > >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> > >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> > 
> > This looks odd, sysfs_remove_group() doesn't call
> > i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> > touch dev_sysfs_ops... So this stack trace is approximate.
> > 
> I thought it was probably the call to lm75_write_value() in lm75_remove()
> after sysfs_remove_group() returned.

Certainly. We see a mix of the function calls in lm75_remove().
lm75_write_value() is definitely the one causing the deadlock. And your
analysis is correct... there's nothing special about this byte write,
so there must be something wrong with the underlying I2C bus even
before that.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 15:36     ` [lm-sensors] " Jean Delvare
@ 2012-06-13  3:58       ` Sasikanth babu
  -1 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-13  3:51 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-i2c, lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 2838 bytes --]

On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali@linux-fr.org> wrote:

> (Note: Frodo is out of the lm-sensors project for years, no need to Cc
> him.)
>
> On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
> >   when I'm trying to delete lm75 device using sysfs delete_device
> attribute
> > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> >   It hangs at lm75_remove function. I started the device using sysfs
> > attribute new_device.
> >
> >
> >   Kernel verion : 2.6.34.12
>
> I can't reproduce this with kernel 3.4.2.
>
> Did you try reproducing this with a more recent kernel? 2.6.34 is
> getting old.
>
> Is there anything you can think of which makes your system special? I2C
> bus multiplexing ? Some unusual kernel option maybe?
>

      Yes, I have PCA9545 Mux device. LM75 device was connected to PCA9545
Mux devices (Mux device
      is connected to SMBUS). At first I unloaded PCA954x module, It hanged
at lm75_remove. Later I had
      to tried remove the lm75 device using sysfs, again it hanged at same
location. Both PCA Mux device and
      lm75 devvice instantiated using sysfs new_device.

>
> > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > Call Trace:
> >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
>
> This looks odd, sysfs_remove_group() doesn't call
> i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> touch dev_sysfs_ops... So this stack trace is approximate.
>
> >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
> >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
> >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
> >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
> >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
> >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
> >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
> >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
> >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
> >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
> >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
> >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
> >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
> >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
>
> --
> Jean Delvare
>

[-- Attachment #1.2: Type: text/html, Size: 3832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-13  3:58       ` Sasikanth babu
  0 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-13  3:58 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-i2c, lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 2838 bytes --]

On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali@linux-fr.org> wrote:

> (Note: Frodo is out of the lm-sensors project for years, no need to Cc
> him.)
>
> On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
> >   when I'm trying to delete lm75 device using sysfs delete_device
> attribute
> > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> >   It hangs at lm75_remove function. I started the device using sysfs
> > attribute new_device.
> >
> >
> >   Kernel verion : 2.6.34.12
>
> I can't reproduce this with kernel 3.4.2.
>
> Did you try reproducing this with a more recent kernel? 2.6.34 is
> getting old.
>
> Is there anything you can think of which makes your system special? I2C
> bus multiplexing ? Some unusual kernel option maybe?
>

      Yes, I have PCA9545 Mux device. LM75 device was connected to PCA9545
Mux devices (Mux device
      is connected to SMBUS). At first I unloaded PCA954x module, It hanged
at lm75_remove. Later I had
      to tried remove the lm75 device using sysfs, again it hanged at same
location. Both PCA Mux device and
      lm75 devvice instantiated using sysfs new_device.

>
> > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
> >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
> >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
> > Call Trace:
> >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
>
> This looks odd, sysfs_remove_group() doesn't call
> i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> touch dev_sysfs_ops... So this stack trace is approximate.
>
> >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
> >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
> >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
> >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
> >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
> >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
> >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
> >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
> >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
> >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
> >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
> >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
> >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
> >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
>
> --
> Jean Delvare
>

[-- Attachment #1.2: Type: text/html, Size: 3832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: lm75_remove: LM75 Device remove using sysfs delete_device
       [not found]       ` <CAOJFanUqEPUGm-7M2HEP8U+uwhg4zQS5ww5dFu0gYAU-exs_Sg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-06-13  4:23           ` Guenter Roeck
  0 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-13  4:23 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: Jean Delvare, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Tue, Jun 12, 2012 at 11:51:51PM -0400, Sasikanth babu wrote:
> 
> On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> 
>     (Note: Frodo is out of the lm-sensors project for years, no need to Cc
>     him.)
> 
>     On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
>     >   when I'm trying to delete lm75 device using sysfs delete_device
>     attribute
>     > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>     >   It hangs at lm75_remove function. I started the device using sysfs
>     > attribute new_device.
>     >
>     >
>     >   Kernel verion : 2.6.34.12
> 
>     I can't reproduce this with kernel 3.4.2.
> 
>     Did you try reproducing this with a more recent kernel? 2.6.34 is
>     getting old.
> 
>     Is there anything you can think of which makes your system special? I2C
>     bus multiplexing ? Some unusual kernel option maybe?
> 
>    
>       Yes, I have PCA9545 Mux device. LM75 device was connected to PCA9545 Mux
> devices (Mux device
>       is connected to SMBUS). At first I unloaded PCA954x module, It hanged at
> lm75_remove. Later I had
>       to tried remove the lm75 device using sysfs, again it hanged at same
> location. Both PCA Mux device and
>       lm75 devvice instantiated using sysfs new_device.
> 
> 
>     > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>     > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>     >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>     >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>     >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
>     > Call Trace:
>     >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>     >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>     >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>     >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>     >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>     >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> 
>     This looks odd, sysfs_remove_group() doesn't call
>     i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
>     touch dev_sysfs_ops... So this stack trace is approximate.
> 
>     >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>     >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>     >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>     >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>     >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>     >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>     >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>     >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>     >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>     >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>     >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>     >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>     >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>     >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 
Jean,

in 2.6.34, i2c_sysfs_delete_device calls i2c_lock_adapter, then i2c_unregister_device.
This in turn calls lm75_remove which through i2c_smbus_xfer tries to acquire the lock again.

The current code is different - i2c_sysfs_delete_device no longer calls i2c_lock_adapter.
Commit ID is dafc50d141c27959dbd3a1cfe9857a86d23402a7, which specifically mentions deadlock
issues with multiplexed busses.

Guenter

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
@ 2012-06-13  4:23           ` Guenter Roeck
  0 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-13  4:23 UTC (permalink / raw)
  To: Sasikanth babu
  Cc: Jean Delvare, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Tue, Jun 12, 2012 at 11:51:51PM -0400, Sasikanth babu wrote:
> 
> On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali@linux-fr.org> wrote:
> 
>     (Note: Frodo is out of the lm-sensors project for years, no need to Cc
>     him.)
> 
>     On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
>     >   when I'm trying to delete lm75 device using sysfs delete_device
>     attribute
>     > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>     >   It hangs at lm75_remove function. I started the device using sysfs
>     > attribute new_device.
>     >
>     >
>     >   Kernel verion : 2.6.34.12
> 
>     I can't reproduce this with kernel 3.4.2.
> 
>     Did you try reproducing this with a more recent kernel? 2.6.34 is
>     getting old.
> 
>     Is there anything you can think of which makes your system special? I2C
>     bus multiplexing ? Some unusual kernel option maybe?
> 
>    
>       Yes, I have PCA9545 Mux device. LM75 device was connected to PCA9545 Mux
> devices (Mux device
>       is connected to SMBUS). At first I unloaded PCA954x module, It hanged at
> lm75_remove. Later I had
>       to tried remove the lm75 device using sysfs, again it hanged at same
> location. Both PCA Mux device and
>       lm75 devvice instantiated using sysfs new_device.
> 
> 
>     > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>     > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>     >  ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48
>     >  ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8
>     >  0000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8
>     > Call Trace:
>     >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>     >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>     >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>     >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>     >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>     >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> 
>     This looks odd, sysfs_remove_group() doesn't call
>     i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
>     touch dev_sysfs_ops... So this stack trace is approximate.
> 
>     >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>     >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>     >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>     >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>     >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>     >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>     >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>     >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>     >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>     >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>     >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>     >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>     >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>     >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> 
Jean,

in 2.6.34, i2c_sysfs_delete_device calls i2c_lock_adapter, then i2c_unregister_device.
This in turn calls lm75_remove which through i2c_smbus_xfer tries to acquire the lock again.

The current code is different - i2c_sysfs_delete_device no longer calls i2c_lock_adapter.
Commit ID is dafc50d141c27959dbd3a1cfe9857a86d23402a7, which specifically mentions deadlock
issues with multiplexed busses.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
  (?)
  (?)
@ 2012-06-13 13:51 ` Guenter Roeck
  -1 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-13 13:51 UTC (permalink / raw)
  To: lm-sensors

On Wed, Jun 13, 2012 at 09:41:38AM -0400, Sasikanth babu wrote:
> 
> 
> On Wed, Jun 13, 2012 at 9:53 AM, Guenter Roeck <guenter.roeck@ericsson.com>
> wrote:
> 
>     On Tue, Jun 12, 2012 at 11:51:51PM -0400, Sasikanth babu wrote:
>     >
>     > On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali@linux-fr.org> wrote:
>     >
>     >     (Note: Frodo is out of the lm-sensors project for years, no need to
>     Cc
>     >     him.)
>     >
>     >     On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
>     >     >   when I'm trying to delete lm75 device using sysfs delete_device
>     >     attribute
>     >     > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
>     >     >   It hangs at lm75_remove function. I started the device using
>     sysfs
>     >     > attribute new_device.
>     >     >
>     >     >
>     >     >   Kernel verion : 2.6.34.12
>     >
>     >     I can't reproduce this with kernel 3.4.2.
>     >
>     >     Did you try reproducing this with a more recent kernel? 2.6.34 is
>     >     getting old.
>     >
>     >     Is there anything you can think of which makes your system special?
>     I2C
>     >     bus multiplexing ? Some unusual kernel option maybe?
>     >
>     >
>     >       Yes, I have PCA9545 Mux device. LM75 device was connected to
>     PCA9545 Mux
>     > devices (Mux device
>     >       is connected to SMBUS). At first I unloaded PCA954x module, It
>     hanged at
>     > lm75_remove. Later I had
>     >       to tried remove the lm75 device using sysfs, again it hanged at
>     same
>     > location. Both PCA Mux device and
>     >       lm75 devvice instantiated using sysfs new_device.
>     >
>     >
>     >     > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
>     message.
>     >     > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
>     >     >  ffff880271928a70 0000000000000086 0000000000000096
>     ffff880273215b48
>     >     >  ffff8802ffffffff ffff880477306a70 0000000000010140
>     ffff880273215fd8
>     >     >  0000000000010140 ffff880271928a70 ffff880273215fd8
>     ffff880273215fd8
>     >     > Call Trace:
>     >     >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
>     >     >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
>     >     >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
>     >     >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
>     >     >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>     >     >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
>     >
>     >     This looks odd, sysfs_remove_group() doesn't call
>     >     i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
>     >     touch dev_sysfs_ops... So this stack trace is approximate.
>     >
>     >     >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
>     >     >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
>     >     >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
>     >     >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
>     >     >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
>     >     >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
>     >     >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
>     >     >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
>     >     >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
>     >     >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>     >     >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>     >     >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>     >     >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
>     >     >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
>     >
>     Jean,
> 
>     in 2.6.34, i2c_sysfs_delete_device calls i2c_lock_adapter, then
>     i2c_unregister_device.
>     This in turn calls lm75_remove which through i2c_smbus_xfer tries to
>     acquire the lock again.
> 
>     The current code is different - i2c_sysfs_delete_device no longer calls
>     i2c_lock_adapter.
>     Commit ID is dafc50d141c27959dbd3a1cfe9857a86d23402a7, which specifically
>     mentions deadlock
>     issues with multiplexed busses.
>    
>     Guenter
> 
> 
>  
> After patching dafc50d141c27959dbd3a1cfe9857a86d23402a7 lm75_probe is getting
> crashed.
> 
> i2c i2c-1: adapter [i2c-0-mux (chan_id 0)] registered
> i2c-dev: adapter [i2c-0-mux (chan_id 0)] registered as minor 1
> i2c i2c-0: Added multiplexed i2c bus 1
> i2c i2c-2: adapter [i2c-0-mux (chan_id 1)] registered
> i2c-dev: adapter [i2c-0-mux (chan_id 1)] registered as minor 2
> i2c i2c-0: Added multiplexed i2c bus 2
> i2c i2c-3: adapter [i2c-0-mux (chan_id 2)] registered
> i2c-dev: adapter [i2c-0-mux (chan_id 2)] registered as minor 3
> i2c i2c-0: Added multiplexed i2c bus 3
> i2c i2c-4: adapter [i2c-0-mux (chan_id 3)] registered
> i2c-dev: adapter [i2c-0-mux (chan_id 3)] registered as minor 4
> i2c i2c-0: Added multiplexed i2c bus 4
> pca954x 0-0073: registered 4 multiplexed busses for I2C switch pca9545
> i2c i2c-0: client [pca9545] registered with bus id 0-0073
> i2c i2c-0: new_device: Instantiated device pca9545 at 0x73
> i2c i2c-3: The new_device interface is still experimental and may change in a
> near future
> i2c 3-004c: uevent
> lm75 3-004c: probe
> kernel tried to execute NX-protected page - exploit attempt? (uid: 0, task:
> S0i2cinit, pid: 1774)
> lm75 3-004c: uevent
> lm75 3-004c: uevent
> BUG: unable to handle kernel paging request at ffff880272ab0200
> IP: [<ffff880272ab0200>] 0xffff880272ab0200
> PGD 8000000001768063 PUD 80000002400001e3
> Oops: 0011 [#1] SMP
> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-3/3-004c/uevent
> CPU 8
> Modules linked in: igb ixgbe pmbus_core ltc2978 i2c_mux pca954x [last unloaded:
> scsi_wait_scan]
> 
> Pid: 1774, comm: S0i2cinit Not tainted 2.6.34.10-grsec-WR4.3.0.0_cgl #1 To be
> filled by O.E.M./To be filled by O.E.M.
> RIP: 0010:[<ffff880272ab0200>]  [<ffff880272ab0200>] 0xffff880272ab0200
> RSP: 0018:ffff8804734d5c70  EFLAGS: 00010296
> RAX: ffff880272ab01f0 RBX: ffff880473f18c28 RCX: 0000000000000dcd
> RDX: 0000000000000000 RSI: ffffffff814f0620 RDI: ffff880272ab0000
> RBP: ffff880473f18c00 R08: 00000000000165c8 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000001 R12: ffff880473f18c04
> R13: ffff880473f18c00 R14: ffffffff8132ec80 R15: 0000000000000000
> FS:  00007f894f16e700(0000) GS:ffff880287200000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: ffff880272ab0200 CR3: 000000027495c000 CR4: 00000000000406f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process S0i2cinit (pid: 1774, threadinfo ffff8804734d4000, task
> ffff8804734eabb0)
> Stack:
>  ffffffff8132ecaa ffff880473f18c28 ffffffff814f0620 ffff880473f18c04
> <0> ffff880473f18c00 ffffffff8132ec80 ffffffff81327014 0000000000000000
> <0> ffffffff812a018a ffffffff84a8c350 ffff880473f18c28 00000000ffffffed
> Call Trace:
>  [<ffffffff8132ecaa>] ? lm75_probe+0x2a/0x1b0
>  [<ffffffff814f0620>] ? lm75_ids+0x40/0x1e0
>  [<ffffffff8132ec80>] ? lm75_probe+0x0/0x1b0
>  [<ffffffff81327014>] ? i2c_device_probe+0x104/0x130
>  [<ffffffff812a018a>] ? driver_sysfs_add+0x5a/0x80
>  [<ffffffff812a02a8>] ? driver_probe_device+0x88/0x180
>  [<ffffffff812a0440>] ? __device_attach+0x0/0x60
>  [<ffffffff8129f6bc>] ? bus_for_each_drv+0x5c/0x90
>  [<ffffffff812a0555>] ? device_attach+0x85/0x90
>  [<ffffffff8129f4d5>] ? bus_probe_device+0x25/0x40
>  [<ffffffff8129ddd5>] ? device_add+0x4f5/0x5c0
>  [<ffffffff812287ed>] ? kobject_init+0x2d/0xb0
>  [<ffffffff813287e8>] ? i2c_new_device+0x118/0x1b0
>  [<ffffffff81328b50>] ? i2c_sysfs_new_device+0xe0/0x2a0
>  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
>  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
>  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
>  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
>  [<ffffffff81488524>] ? page_fault+0x24/0x30
>  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
>  
I suspect it requires additional patches to work. Jean might know.
fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 seems relevant, and there may be others,
even infrastructure changes.

Can you switch to a more recent kernel ?

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (2 preceding siblings ...)
  (?)
@ 2012-06-13 13:53 ` Sasikanth babu
  -1 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-13 13:53 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 7461 bytes --]

On Wed, Jun 13, 2012 at 9:53 AM, Guenter Roeck
<guenter.roeck@ericsson.com>wrote:

> On Tue, Jun 12, 2012 at 11:51:51PM -0400, Sasikanth babu wrote:
> >
> > On Sun, Jun 10, 2012 at 9:06 PM, Jean Delvare <khali@linux-fr.org>
> wrote:
> >
> >     (Note: Frodo is out of the lm-sensors project for years, no need to
> Cc
> >     him.)
> >
> >     On Sun, 10 Jun 2012 07:41:03 -0700, Sasikanth babu wrote:
> >     >   when I'm trying to delete lm75 device using sysfs delete_device
> >     attribute
> >     > (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> >     >   It hangs at lm75_remove function. I started the device using
> sysfs
> >     > attribute new_device.
> >     >
> >     >
> >     >   Kernel verion : 2.6.34.12
> >
> >     I can't reproduce this with kernel 3.4.2.
> >
> >     Did you try reproducing this with a more recent kernel? 2.6.34 is
> >     getting old.
> >
> >     Is there anything you can think of which makes your system special?
> I2C
> >     bus multiplexing ? Some unusual kernel option maybe?
> >
> >
> >       Yes, I have PCA9545 Mux device. LM75 device was connected to
> PCA9545 Mux
> > devices (Mux device
> >       is connected to SMBUS). At first I unloaded PCA954x module, It
> hanged at
> > lm75_remove. Later I had
> >       to tried remove the lm75 device using sysfs, again it hanged at
> same
> > location. Both PCA Mux device and
> >       lm75 devvice instantiated using sysfs new_device.
> >
> >
> >     > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
> message.
> >     > i2cinit       D ffffffff814a04e0     0  2064   2059 0x00000004
> >     >  ffff880271928a70 0000000000000086 0000000000000096
> ffff880273215b48
> >     >  ffff8802ffffffff ffff880477306a70 0000000000010140
> ffff880273215fd8
> >     >  0000000000010140 ffff880271928a70 ffff880273215fd8
> ffff880273215fd8
> >     > Call Trace:
> >     >  [<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> >     >  [<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> >     >  [<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> >     >  [<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> >     >  [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> >     >  [<ffffffff81327c40>] ? i2c_smbus_write_byte_data+0x30/0x40
> >
> >     This looks odd, sysfs_remove_group() doesn't call
> >     i2c_smbus_write_byte_data(), and i2c_smbus_write_byte_data() doesn't
> >     touch dev_sysfs_ops... So this stack trace is approximate.
> >
> >     >  [<ffffffff811361f9>] ? sysfs_remove_group+0x59/0x100
> >     >  [<ffffffff8132ec2d>] ? lm75_remove+0x4d/0x80
> >     >  [<ffffffff81326ef9>] ? i2c_device_remove+0xa9/0xc0
> >     >  [<ffffffff8129ffb6>] ? __device_release_driver+0x56/0xc0
> >     >  [<ffffffff812a00f5>] ? device_release_driver+0x25/0x40
> >     >  [<ffffffff8129f481>] ? bus_remove_device+0x91/0xc0
> >     >  [<ffffffff8129d7a8>] ? device_del+0x118/0x190
> >     >  [<ffffffff8129d829>] ? device_unregister+0x9/0x20
> >     >  [<ffffffff813281bc>] ? i2c_sysfs_delete_device+0x17c/0x200
> >     >  [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
> >     >  [<ffffffff810d5323>] ? vfs_write+0x103/0x200
> >     >  [<ffffffff810d550e>] ? sys_write+0x4e/0x90
> >     >  [<ffffffff814884e4>] ? page_fault+0x24/0x30
> >     >  [<ffffffff810024ab>] ? system_call_done+0x0/0x5
> >
> Jean,
>
> in 2.6.34, i2c_sysfs_delete_device calls i2c_lock_adapter, then
> i2c_unregister_device.
> This in turn calls lm75_remove which through i2c_smbus_xfer tries to
> acquire the lock again.
>
> The current code is different - i2c_sysfs_delete_device no longer calls
> i2c_lock_adapter.
> Commit ID is dafc50d141c27959dbd3a1cfe9857a86d23402a7, which specifically
> mentions deadlock
> issues with multiplexed busses.
>
> Guenter
>


After patching dafc50d141c27959dbd3a1cfe9857a86d23402a7 lm75_probe is
getting crashed.

i2c i2c-1: adapter [i2c-0-mux (chan_id 0)] registered
i2c-dev: adapter [i2c-0-mux (chan_id 0)] registered as minor 1
i2c i2c-0: Added multiplexed i2c bus 1
i2c i2c-2: adapter [i2c-0-mux (chan_id 1)] registered
i2c-dev: adapter [i2c-0-mux (chan_id 1)] registered as minor 2
i2c i2c-0: Added multiplexed i2c bus 2
i2c i2c-3: adapter [i2c-0-mux (chan_id 2)] registered
i2c-dev: adapter [i2c-0-mux (chan_id 2)] registered as minor 3
i2c i2c-0: Added multiplexed i2c bus 3
i2c i2c-4: adapter [i2c-0-mux (chan_id 3)] registered
i2c-dev: adapter [i2c-0-mux (chan_id 3)] registered as minor 4
i2c i2c-0: Added multiplexed i2c bus 4
pca954x 0-0073: registered 4 multiplexed busses for I2C switch pca9545
i2c i2c-0: client [pca9545] registered with bus id 0-0073
i2c i2c-0: new_device: Instantiated device pca9545 at 0x73
i2c i2c-3: The new_device interface is still experimental and may change in
a near future
i2c 3-004c: uevent
lm75 3-004c: probe
kernel tried to execute NX-protected page - exploit attempt? (uid: 0, task:
S0i2cinit, pid: 1774)
lm75 3-004c: uevent
lm75 3-004c: uevent
BUG: unable to handle kernel paging request at ffff880272ab0200
IP: [<ffff880272ab0200>] 0xffff880272ab0200
PGD 8000000001768063 PUD 80000002400001e3
Oops: 0011 [#1] SMP
last sysfs file:
/sys/devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-3/3-004c/uevent
CPU 8
Modules linked in: igb ixgbe pmbus_core ltc2978 i2c_mux pca954x [last
unloaded: scsi_wait_scan]

Pid: 1774, comm: S0i2cinit Not tainted 2.6.34.10-grsec-WR4.3.0.0_cgl #1 To
be filled by O.E.M./To be filled by O.E.M.
RIP: 0010:[<ffff880272ab0200>]  [<ffff880272ab0200>] 0xffff880272ab0200
RSP: 0018:ffff8804734d5c70  EFLAGS: 00010296
RAX: ffff880272ab01f0 RBX: ffff880473f18c28 RCX: 0000000000000dcd
RDX: 0000000000000000 RSI: ffffffff814f0620 RDI: ffff880272ab0000
RBP: ffff880473f18c00 R08: 00000000000165c8 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffff880473f18c04
R13: ffff880473f18c00 R14: ffffffff8132ec80 R15: 0000000000000000
FS:  00007f894f16e700(0000) GS:ffff880287200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff880272ab0200 CR3: 000000027495c000 CR4: 00000000000406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process S0i2cinit (pid: 1774, threadinfo ffff8804734d4000, task
ffff8804734eabb0)
Stack:
 ffffffff8132ecaa ffff880473f18c28 ffffffff814f0620 ffff880473f18c04
<0> ffff880473f18c00 ffffffff8132ec80 ffffffff81327014 0000000000000000
<0> ffffffff812a018a ffffffff84a8c350 ffff880473f18c28 00000000ffffffed
Call Trace:
 [<ffffffff8132ecaa>] ? lm75_probe+0x2a/0x1b0
 [<ffffffff814f0620>] ? lm75_ids+0x40/0x1e0
 [<ffffffff8132ec80>] ? lm75_probe+0x0/0x1b0
 [<ffffffff81327014>] ? i2c_device_probe+0x104/0x130
 [<ffffffff812a018a>] ? driver_sysfs_add+0x5a/0x80
 [<ffffffff812a02a8>] ? driver_probe_device+0x88/0x180
 [<ffffffff812a0440>] ? __device_attach+0x0/0x60
 [<ffffffff8129f6bc>] ? bus_for_each_drv+0x5c/0x90
 [<ffffffff812a0555>] ? device_attach+0x85/0x90
 [<ffffffff8129f4d5>] ? bus_probe_device+0x25/0x40
 [<ffffffff8129ddd5>] ? device_add+0x4f5/0x5c0
 [<ffffffff812287ed>] ? kobject_init+0x2d/0xb0
 [<ffffffff813287e8>] ? i2c_new_device+0x118/0x1b0
 [<ffffffff81328b50>] ? i2c_sysfs_new_device+0xe0/0x2a0
 [<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
 [<ffffffff81133046>] ? sysfs_write_file+0x1c6/0x260
 [<ffffffff810d5323>] ? vfs_write+0x103/0x200
 [<ffffffff810d550e>] ? sys_write+0x4e/0x90
 [<ffffffff81488524>] ? page_fault+0x24/0x30
 [<ffffffff810024ab>] ? system_call_done+0x0/0x5

[-- Attachment #1.2: Type: text/html, Size: 8955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (3 preceding siblings ...)
  (?)
@ 2012-06-13 16:05 ` Jean Delvare
  -1 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-13 16:05 UTC (permalink / raw)
  To: lm-sensors

On Wed, 13 Jun 2012 06:51:32 -0700, Guenter Roeck wrote:
> I suspect it requires additional patches to work. Jean might know.
> fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 seems relevant, and there may be others,
> even infrastructure changes.

fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 is certainly relevant too,
yes. I can't think of anything else, but that was long ago, so I could
miss something else.

> Can you switch to a more recent kernel ?

This would seem reasonable, yes, 2.6.34 is getting very old and
unsupported, and it did not even support I2C multiplexing so I take it
that you already did a fair amount of backport to get to the kernel
you're currently running. No real surprise you get into trouble...

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (4 preceding siblings ...)
  (?)
@ 2012-06-13 16:34 ` Sasikanth babu
  -1 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-13 16:34 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1162 bytes --]

On Wed, Jun 13, 2012 at 9:35 PM, Jean Delvare <khali@linux-fr.org> wrote:

> On Wed, 13 Jun 2012 06:51:32 -0700, Guenter Roeck wrote:
> > I suspect it requires additional patches to work. Jean might know.
> > fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 seems relevant, and there may
> be others,
> > even infrastructure changes.
>
> fe61e07e9ebc890c70d97a1f72ddaad4bee2d848 is certainly relevant too,
> yes. I can't think of anything else, but that was long ago, so I could
> miss something else.
>
> > Can you switch to a more recent kernel ?
>
> This would seem reasonable, yes, 2.6.34 is getting very old and
> unsupported, and it did not even support I2C multiplexing so I take it
> that you already did a fair amount of backport to get to the kernel
> you're currently running. No real surprise you get into trouble...
>
> --
> Jean Delvare
>


Yes, as you had mentioned we just backported I2c mux support.
I planning to use
linux-2.6.39.4.tar.bz2<http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2>kernel
(Since I cant go to 3.x kernels for now).
Is that version is fine with I2c mux devices or do I have to go with 3.x
kernels.?

Thanks
Sasi

[-- Attachment #1.2: Type: text/html, Size: 1638 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (5 preceding siblings ...)
  (?)
@ 2012-06-13 17:59 ` Jean Delvare
  -1 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-13 17:59 UTC (permalink / raw)
  To: lm-sensors

On Wed, 13 Jun 2012 21:52:02 +0530, Sasikanth babu wrote:
> Yes, as you had mentioned we just backported I2c mux support.
> I planning to use
> linux-2.6.39.4.tar.bz2<http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2>kernel
> (Since I cant go to 3.x kernels for now).
> Is that version is fine with I2c mux devices or do I have to go with 3.x
> kernels.?

2.6.39.4 should work fine with regards to i2c muxing, however this
branch is already out of maintenance while the 3.0 branch is a longterm
branch so it will be maintained for some more time (not sure exactly
how long though.) So if 3.0 is an option, you should consider it seriously.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (6 preceding siblings ...)
  (?)
@ 2012-06-13 19:07 ` Guenter Roeck
  -1 siblings, 0 replies; 23+ messages in thread
From: Guenter Roeck @ 2012-06-13 19:07 UTC (permalink / raw)
  To: lm-sensors

On Wed, Jun 13, 2012 at 01:59:50PM -0400, Jean Delvare wrote:
> On Wed, 13 Jun 2012 21:52:02 +0530, Sasikanth babu wrote:
> > Yes, as you had mentioned we just backported I2c mux support.
> > I planning to use
> > linux-2.6.39.4.tar.bz2<http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2>kernel
> > (Since I cant go to 3.x kernels for now).
> > Is that version is fine with I2c mux devices or do I have to go with 3.x
> > kernels.?
> 
> 2.6.39.4 should work fine with regards to i2c muxing, however this
> branch is already out of maintenance while the 3.0 branch is a longterm
> branch so it will be maintained for some more time (not sure exactly
> how long though.) So if 3.0 is an option, you should consider it seriously.
> 
I definitely agree, but that smells like large company process to me.
Sasikanth may not have much of a choice.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (7 preceding siblings ...)
  (?)
@ 2012-06-14  9:47 ` Sasikanth babu
  -1 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-14  9:47 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1882 bytes --]

On Thu, Jun 14, 2012 at 12:37 AM, Guenter Roeck
<guenter.roeck@ericsson.com>wrote:

> On Wed, Jun 13, 2012 at 01:59:50PM -0400, Jean Delvare wrote:
> > On Wed, 13 Jun 2012 21:52:02 +0530, Sasikanth babu wrote:
> > > Yes, as you had mentioned we just backported I2c mux support.
> > > I planning to use
> > > linux-2.6.39.4.tar.bz2<
> http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2>kernel
> > > (Since I cant go to 3.x kernels for now).
> > > Is that version is fine with I2c mux devices or do I have to go with
> 3.x
> > > kernels.?
> >
> > 2.6.39.4 should work fine with regards to i2c muxing, however this
> > branch is already out of maintenance while the 3.0 branch is a longterm
> > branch so it will be maintained for some more time (not sure exactly
> > how long though.) So if 3.0 is an option, you should consider it
> seriously.
> >
> I definitely agree, but that smells like large company process to me.
> Sasikanth may not have much of a choice.
>
> Guenter
>

Sorry guys for bothering you again

 I was running 2.6.39.4 kernel now.  Software reboot always creating
problems with LM75 device and saying address
 is busy but with hardware reboot It works fine (since all the power to
board gets resets)

 Added a error message on failure of * i2c_check_addr_busy.*

*        /* Check for address business */
        status = i2c_check_addr_busy(adap, client->addr);
        if (status) {
             dev_err(&adap->dev, "Address Busy to register i2c client %s at
0x%02x "
                "(%d)\n", client->name, client->addr, status);

                goto out_err;
        }*


* i2c i2c-3: Address Busy to register i2c client lm75 at 0x4c (-16)*
 i2c i2c-3: Failed to register i2c client lm75 at 0x4c (-16)
*i2c i2c-3: Address Busy to register i2c client lm75 at 0x4b (-16)*
i2c i2c-3: Failed to register i2c client lm75 at 0x4b (-16)

Thanks
Sasi

[-- Attachment #1.2: Type: text/html, Size: 2620 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (8 preceding siblings ...)
  (?)
@ 2012-06-14 13:52 ` Sasikanth babu
  -1 siblings, 0 replies; 23+ messages in thread
From: Sasikanth babu @ 2012-06-14 13:52 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 3448 bytes --]

On Thu, Jun 14, 2012 at 3:05 PM, Sasikanth babu <sasikanth.v19@gmail.com>wrote:

>
>
> On Thu, Jun 14, 2012 at 12:37 AM, Guenter Roeck <
> guenter.roeck@ericsson.com> wrote:
>
>> On Wed, Jun 13, 2012 at 01:59:50PM -0400, Jean Delvare wrote:
>> > On Wed, 13 Jun 2012 21:52:02 +0530, Sasikanth babu wrote:
>> > > Yes, as you had mentioned we just backported I2c mux support.
>> > > I planning to use
>> > > linux-2.6.39.4.tar.bz2<
>> http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2>kernel
>> > > (Since I cant go to 3.x kernels for now).
>> > > Is that version is fine with I2c mux devices or do I have to go with
>> 3.x
>> > > kernels.?
>> >
>> > 2.6.39.4 should work fine with regards to i2c muxing, however this
>> > branch is already out of maintenance while the 3.0 branch is a longterm
>> > branch so it will be maintained for some more time (not sure exactly
>> > how long though.) So if 3.0 is an option, you should consider it
>> seriously.
>> >
>> I definitely agree, but that smells like large company process to me.
>> Sasikanth may not have much of a choice.
>>
>> Guenter
>>
>
> Sorry guys for bothering you again
>
>  I was running 2.6.39.4 kernel now.  Software reboot always creating
> problems with LM75 device and saying address
>  is busy but with hardware reboot It works fine (since all the power to
> board gets resets)
>
>  Added a error message on failure of * i2c_check_addr_busy.*
>
> *        /* Check for address business */
>         status = i2c_check_addr_busy(adap, client->addr);
>         if (status) {
>              dev_err(&adap->dev, "Address Busy to register i2c client %s
> at 0x%02x "
>                 "(%d)\n", client->name, client->addr, status);
>
>                 goto out_err;
>         }*
>
>
> * i2c i2c-3: Address Busy to register i2c client lm75 at 0x4c (-16)*
>  i2c i2c-3: Failed to register i2c client lm75 at 0x4c (-16)
> *i2c i2c-3: Address Busy to register i2c client lm75 at 0x4b (-16)*
> i2c i2c-3: Failed to register i2c client lm75 at 0x4b (-16)
>
> Thanks
> Sasi
>

After making the following changes, It is working fine on soft reboot too.

diff -urpN orig/linux-2.6.39.4/drivers/i2c/muxes/pca954x.c
linux-2.6.39.4/drivers/i2c/muxes/pca954x.c
--- orig/linux-2.6.39.4/drivers/i2c/muxes/pca954x.c     2011-08-03
15:43:28.000000000 -0400
+++ linux-2.6.39.4/drivers/i2c/muxes/pca954x.c  2012-06-14
08:37:52.572107218 -0400
@@ -174,6 +174,7 @@ static int pca954x_deselect_mux(struct i
        struct pca954x *data = i2c_get_clientdata(client);

        /* Deselect active channel */
+       printk (KERN_INFO"pca954x_deselect_mux: called ...\n");
        data->last_chan = 0;
        return pca954x_reg_write(adap, client, data->last_chan);
 }
@@ -228,8 +229,7 @@ static int pca954x_probe(struct i2c_clie
                data->virt_adaps[num] =
                        i2c_add_mux_adapter(adap, client,
                                force, num, pca954x_select_chan,
*-                               (pdata &&
pdata->modes[num].deselect_on_exit)
-                                       ? pca954x_deselect_mux : NULL);
+                               pca954x_deselect_mux);*

                if (data->virt_adaps[num] == NULL) {
                        ret = -ENODEV;

No one  is setting the "deselect_on_exit" for pca954x devices (verified in
3.5.0-rc2 too). Does the* pca954x_deselect_mux *not required for PCA mux
devices* *for every bus transfer?*.


*Thanks
Sasi*
*

[-- Attachment #1.2: Type: text/html, Size: 4548 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] lm75_remove: LM75 Device remove using sysfs delete_device
  2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
                   ` (9 preceding siblings ...)
  (?)
@ 2012-06-14 14:26 ` Jean Delvare
  -1 siblings, 0 replies; 23+ messages in thread
From: Jean Delvare @ 2012-06-14 14:26 UTC (permalink / raw)
  To: lm-sensors

On Thu, 14 Jun 2012 19:10:27 +0530, Sasikanth babu wrote:
> After making the following changes, It is working fine on soft reboot too.
> 
> diff -urpN orig/linux-2.6.39.4/drivers/i2c/muxes/pca954x.c
> linux-2.6.39.4/drivers/i2c/muxes/pca954x.c
> --- orig/linux-2.6.39.4/drivers/i2c/muxes/pca954x.c     2011-08-03
> 15:43:28.000000000 -0400
> +++ linux-2.6.39.4/drivers/i2c/muxes/pca954x.c  2012-06-14
> 08:37:52.572107218 -0400
> @@ -174,6 +174,7 @@ static int pca954x_deselect_mux(struct i
>         struct pca954x *data = i2c_get_clientdata(client);
> 
>         /* Deselect active channel */
> +       printk (KERN_INFO"pca954x_deselect_mux: called ...\n");
>         data->last_chan = 0;
>         return pca954x_reg_write(adap, client, data->last_chan);
>  }
> @@ -228,8 +229,7 @@ static int pca954x_probe(struct i2c_clie
>                 data->virt_adaps[num] >                         i2c_add_mux_adapter(adap, client,
>                                 force, num, pca954x_select_chan,
> *-                               (pdata &&
> pdata->modes[num].deselect_on_exit)
> -                                       ? pca954x_deselect_mux : NULL);
> +                               pca954x_deselect_mux);*
> 
>                 if (data->virt_adaps[num] = NULL) {
>                         ret = -ENODEV;
> 
> No one  is setting the "deselect_on_exit" for pca954x devices (verified in
> 3.5.0-rc2 too). Does the* pca954x_deselect_mux *not required for PCA mux
> devices* *for every bus transfer?*.

Whether deselecting after bus transfer is needed or not depends on the
I2C bus topology. If you have a single PCA954x chip on the bus then it
is normally not needed, and omitting it speeds transactions up. But if
you have more than one PCA954x chip on the bus, and the bus segments
behind these PCA954x chips use common device addresses, then you must
deselect after each bus transfer otherwise you risk addressing several
slaves at once. Same holds if you mix a PCA954x chip with another
multiplexing strategy.

Why this would cause the symptoms you reported is beyond me though. But
if setting deselect_on_exit fixes it, then just do that!

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2012-06-14 14:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-10 14:41 lm75_remove: LM75 Device remove using sysfs delete_device Sasikanth babu
2012-06-10 14:41 ` [lm-sensors] " Sasikanth babu
     [not found] ` <CAOJFanUqFZPih6puAy2DWPWPQMs6ZZz_DFgO9wnRttnP5mCPZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-10 15:28   ` Guenter Roeck
2012-06-10 15:28     ` Guenter Roeck
2012-06-10 15:36   ` Jean Delvare
2012-06-10 15:36     ` [lm-sensors] " Jean Delvare
     [not found]     ` <20120610173640.3b21759c-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-06-10 15:46       ` Guenter Roeck
2012-06-10 15:46         ` Guenter Roeck
     [not found]         ` <20120610154629.GD10367-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org>
2012-06-10 15:52           ` Jean Delvare
2012-06-10 15:52             ` [lm-sensors] " Jean Delvare
2012-06-13  3:51     ` Sasikanth babu
2012-06-13  3:58       ` [lm-sensors] " Sasikanth babu
     [not found]       ` <CAOJFanUqEPUGm-7M2HEP8U+uwhg4zQS5ww5dFu0gYAU-exs_Sg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-13  4:23         ` Guenter Roeck
2012-06-13  4:23           ` [lm-sensors] " Guenter Roeck
2012-06-13 13:51 ` Guenter Roeck
2012-06-13 13:53 ` Sasikanth babu
2012-06-13 16:05 ` Jean Delvare
2012-06-13 16:34 ` Sasikanth babu
2012-06-13 17:59 ` Jean Delvare
2012-06-13 19:07 ` Guenter Roeck
2012-06-14  9:47 ` Sasikanth babu
2012-06-14 13:52 ` Sasikanth babu
2012-06-14 14:26 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.