Problem with set_fs function in 2.4 linux kernel module

OP (Company: LanPro) #3739234
Rate this post
• ▲ useful
▼ not useful
Hello!

I'm writing kernel module for embedded system working on Linux kernel 
2.4.xx.
CPU on the device is ARM926ejs. Communication with device - serial port 
(COM). Here is a code fragment:

if( sock->ops && sock->ops->ioctl ) {
   old_fs = get_fs();
   printk( KERN_ALERT "aaa\n" );
   set_fs( KERNEL_DS );
   printk( KERN_ALERT "bbb\n" );
   retval = sock->ops->ioctl( ... );
   set_fs( old_fs );
   ...
}

Module loads perfectly and works until the function "set_fs(KERNEL_DS)" 
is called. In HyperTerminal i see message "aaa", but cannot see "bbb". 
The behavior of device is strange: no kernel_panic, no error messages, 
nothing, it "dies" silently and absolutely till power switching. I 
suppose that the problem dialed with domain switching but cannot see 
where is error. I tried to write local_irq_disable()/local_irq_enable() 
around set_fs() - no effect. Does anybody know how to fix problem?
P.S. On x86 processors module works.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.