lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20111109181257.GA26633@core.coreip.homeip.net>
Date:	Wed, 9 Nov 2011 10:12:58 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	"Murali K. Vemuri" <vemuri.muralikrishna@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: worker thread - filp_close() problem

On Wed, Nov 09, 2011 at 08:52:12PM +0900, Murali K. Vemuri wrote:
> Hi there,
> 
> I have a device driver where in I have to do like this:
> 
> (I am using Kernel 2.6.32, and unfortunately cannot upgrade).
> 
> 1. Register for an interrupt.
> 2. When I receive the interrupt, I do some processing, and schedule a
> worker for further processing after 25 msec.
> (The device data sheet says I have to give a minimum of 20 m sec).
> 3. The worker thread has to do some processing and then program
> another device connected to the serial port.
> 
> Problem:
> 1. as long as I don't call the program_serial_dev() from
> my_dev_task(), everything is fine.
> 2. When I call the program_serial_dev(), I am, getting the error
> (console freezes as well):
> ------------[ cut here ]------------
> WARNING: at kernel/workqueue.c:485 flush_cpu_workqueue+0x34/0x88()
> [<c003f92c>] (unwind_backtrace+0x0/0xd8) from [<c006404c>]
> (warn_slowpath_common+0x48/0x60)

It looks like we end up trying to flush a workqueue from within a work
item, which deadlocks.

Since you are using threaded IRQ just stick msleep(25) there and call
program_serial_dev() from it.

... But from the looks of things the programming should not be done in
kernel but rather from userspace...

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ