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: <508A8DF9.4080607@broadcom.com>
Date:	Fri, 26 Oct 2012 15:19:53 +0200
From:	"Arend van Spriel" <arend@...adcom.com>
To:	"Peter Zijlstra" <peterz@...radead.org>
cc:	"Ingo Molnar" <mingo@...hat.com>, "Tejun Heo" <tj@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: lockdep info message

On 10/26/2012 01:25 PM, Peter Zijlstra wrote:
> On Fri, 2012-10-26 at 12:15 +0200, Arend van Spriel wrote:
>> Hi Peter and/or Ingo,
>>
>> I am working on a driver (brcmfmac) and when unloading it or unplugging
>> the device I get this info message (see below) upon calling
>> cancel_work_sync(). Just wondering if there is something I need to do in
>> the driver or should it be done in workqueue code.
>
> Your driver, as that's the one allocating the struct work_struct thingy.
>
> You've either failed to use INIT_WORK() or need to use
> INIT_WORK_ONSTACK() if that's appropriate. It looks like you could have
> used DECLARE*_WORK inside a function or something similar.
>
> Anyway, without the driver code present I can't really say much more.
>

I assume INIT_WORK_ONSTACK() can only be used when scheduling process 
waits for the work to complete. The work_struct is located inside a 
driver structure that is allocated upon device probe.

struct brcmf_fweh_info {
	struct work_struct event_work;
};

and it is initialized in that context using:

	INIT_WORK(&fweh->event_work, brcmf_fweh_event_worker);

and used in another context:

	schedule_work(&fweh->event_work);

When cleaning up I do:

	cancel_work_sync(&fweh->event_work);

I can also submit the patch with the entire code as RFC if you do not 
object digging through a couple of hundred lines.

Gr. AvS

--
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