From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasikanth babu Subject: Re: lm75_remove: LM75 Device remove using sysfs delete_device Date: Wed, 13 Jun 2012 09:21:51 +0530 Message-ID: References: <20120610173640.3b21759c@endymion.delvare> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3624348710319718668==" Return-path: In-Reply-To: <20120610173640.3b21759c@endymion.delvare> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lm-sensors-bounces@lm-sensors.org Errors-To: lm-sensors-bounces@lm-sensors.org To: Jean Delvare , Guenter Roeck Cc: linux-i2c@vger.kernel.org, lm-sensors@lm-sensors.org List-Id: linux-i2c@vger.kernel.org --===============3624348710319718668== Content-Type: multipart/alternative; boundary=047d7b33c710d9144704c2528014 --047d7b33c710d9144704c2528014 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jun 10, 2012 at 9:06 PM, 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? > 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: > > [] ? default_wake_function+0x0/0x20 > > [] ? __rt_mutex_slowlock+0x4f/0x110 > > [] ? rt_mutex_slowlock+0x93/0x190 > > [] ? i2c_smbus_xfer+0x49/0x110 > > [] ? dev_sysfs_ops+0x0/0x10 > > [] ? 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. > > > [] ? sysfs_remove_group+0x59/0x100 > > [] ? lm75_remove+0x4d/0x80 > > [] ? i2c_device_remove+0xa9/0xc0 > > [] ? __device_release_driver+0x56/0xc0 > > [] ? device_release_driver+0x25/0x40 > > [] ? bus_remove_device+0x91/0xc0 > > [] ? device_del+0x118/0x190 > > [] ? device_unregister+0x9/0x20 > > [] ? i2c_sysfs_delete_device+0x17c/0x200 > > [] ? sysfs_write_file+0x1c6/0x260 > > [] ? vfs_write+0x103/0x200 > > [] ? sys_write+0x4e/0x90 > > [] ? page_fault+0x24/0x30 > > [] ? system_call_done+0x0/0x5 > > -- > Jean Delvare > --047d7b33c710d9144704c2528014 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Jun 10, 2012 at 9:0= 6 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:
> =A0 when I'm trying to delete lm75 device using sysfs delete_devic= e attribute
> (echo 0x4e >/sys/bus/i2c/devices/i2c-3/delete_device)
> =A0 It hangs at lm75_remove function. I started the device using sysfs=
> attribute new_device.
>
>
> =A0 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?
= =A0 =A0
=A0 =A0 =A0 Yes, I have PCA9545 Mux device. LM75 device was con= nected to PCA9545 Mux devices (Mux device
=A0=A0=A0=A0=A0 is connected t= o SMBUS). At first I unloaded PCA954x module, It hanged at lm75_remove. Lat= er I had
=A0=A0=A0=A0=A0 to tried remove the lm75 device using sysfs, again it hange= d at same location. Both PCA Mux device and
=A0=A0=A0=A0=A0 lm75 devvice= instantiated using sysfs new_device.

> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disabl= es this message.
> i2cinit =A0 =A0 =A0 D ffffffff814a04e0 =A0 =A0 0 =A02064 =A0 2059 0x00= 000004
> =A0ffff880271928a70 0000000000000086 0000000000000096 ffff880273215b48=
> =A0ffff8802ffffffff ffff880477306a70 0000000000010140 ffff880273215fd8=
> =A00000000000010140 ffff880271928a70 ffff880273215fd8 ffff880273215fd8=
> Call Trace:
> =A0[<ffffffff8103ecd0>] ? default_wake_function+0x0/0x20
> =A0[<ffffffff8148765f>] ? __rt_mutex_slowlock+0x4f/0x110
> =A0[<ffffffff814879e3>] ? rt_mutex_slowlock+0x93/0x190
> =A0[<ffffffff813278d9>] ? i2c_smbus_xfer+0x49/0x110
> =A0[<ffffffff814e1de0>] ? dev_sysfs_ops+0x0/0x10
> =A0[<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.

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

--
Jean Delvare

--047d7b33c710d9144704c2528014-- --===============3624348710319718668== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors --===============3624348710319718668==--