LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 10-02-2010, 05:17 PM   #1
GurgleSpuge
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
spinlock semaphore question 2.6.32 mac80211


Hi,
I am trying to cut in a function in the mac80211 layer in the 2.6.32 kernel and am stuck I was hoping someone can help.

The issue is that I need to call msleep() or schedule() or down() inside multiple layers of existing spinlock and rcu_lock critical sections, when I attempt this I get the "scheduling while atomic" or "scheduling from idle thread" error.

This is using 2.6.32 non-SMP. I have tried both preempt and not preempt as kernel options.

I have read around that if you are non-SMP the spin locks shouldn't do anything and I found an option to let the RCU's be preemptable.

Is there an obvious way to tackle this problem?

I am trying to cut in this fcn :
void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch,
u8 *data, size_t data_len,
u8 *cdata, u8 *mic)
in

net/mac80211/aes_ccm.c

with a blocking version, without rewriting the kernel

Any help or 411 on spinlocks,interrupts and rcu_locks in the networking layer will help a ton
Thanks
 
Old 10-03-2010, 03:30 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
Why do you need to block there? You're running the encryption elsewhere and you need to wait for the result?
 
Old 10-04-2010, 12:10 AM   #3
GurgleSpuge
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Exactly, The chip (freescale) has a dedicated encryption co-processor and I have to wait for the result
 
Old 10-04-2010, 03:53 AM   #4
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
Why don't you acquire the those locks before this function executes?
Or unlock those locks?
Or just use tasklets or workqueues?
 
Old 10-04-2010, 10:07 PM   #5
GurgleSpuge
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
archieval thanks for the info,
I am reading up on workqueues and tasklets, I think the workqueue is what I am looking for, (which permits sleeping).

I still cant think of a clever way force a function running in a interrupt context to wait for one in a user context.
You can always split the function up into a top and bottom half, I was just trying to be lazier than that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on spinlock??? linqu Programming 0 04-05-2009 11:58 AM
spinlock example programs ashok449 Linux - Kernel 1 07-28-2008 11:28 PM
What's a spinlock? TheLateJC Programming 3 05-18-2007 10:19 AM
Spinlock Recursion wahming Linux - General 2 02-15-2007 03:44 AM
spinlock error culin Linux - Hardware 1 09-28-2006 01:29 AM


All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration