LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-06-2012, 06:19 AM   #1
arul_ewl
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
driver porting from 2.6.29 to 2.6.37


Hi,

We are using embedded linux. Recently we have upgraded our kernel from 2.6.29 to 2.6.37.After upgrading the custom driver (provided by infineon for 2.6.29) the functionality is not working, kernel hangs and getting watchdog reboot.
After stopping watchdog also we are not getting any info why / where the hang is happening.

Can some one suggest any clue about this.

Thanks & Regards,
Arul.
 
Old 04-09-2012, 02:54 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
There are multiple things possible, I'd start with ioctl handling. It has changed somewhere around this range of versions.

Do you have the source code of the driver?
 
Old 04-09-2012, 08:11 PM   #3
arul_ewl
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi Mara,

Thanks for your reply. Yes, we have the source code. we have changed the ioctl to unlocked_ioctl.
Now the problem seems to be in interrupt, If the interrupt assignment number is not correct, no hang happen. So we feel that the kernel hangs while getting or processing interrupt.. but we are not getting any clue where and why it's happening.

Regards,
Arul.
 
Old 04-12-2012, 03:12 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
There's a difference between ioctl and unlocked_ioctl. In the new one, you need to add synchronization yourself. Look if it is not the case of a race condition between the unlocked_ioctl and the interrupt.
 
Old 04-12-2012, 08:26 PM   #5
arul_ewl
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I found the route cause for the problem.
The kernel hang due to the following new change in kernel 2.6.37
Request irq() changed with request_threaded_irq with added parameter for the thread ptr.
Bydefault, the kernel isr routine will re-enable the interrupt after processing the user isr routine.
The default behavior of kernel re-enabling interrupt giving problem for our driver and kernel hangs due to multiple interrupts.

For threaded irq, which don’t want to re-enable the interrupt after the isr, we need to pass a parameter IRQF_ONESHOT in request_irq().
After adding the IRQF_ONESHOT in request_irq() our kernel hang issue resolved.

Thanks.
 
  


Reply



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
porting a new driver to the kernel 2.6.32 the hope Linux - Software 2 04-22-2011 05:08 AM
Porting driver from kernel version 2.6.21 to 2.6.27 mad34 Linux - Kernel 5 01-22-2010 07:36 PM
Porting driver to kernel 2.6 jhoya Linux - Software 0 08-24-2005 11:25 AM
driver porting to 64-bit-linux yogeshwar_s Programming 0 07-19-2005 09:18 AM
Driver porting dafri Linux - Hardware 2 06-07-2003 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:20 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
Open Source Consulting | Domain Registration