Wind River Support Network

HomeOther DownloadsPatch to fix the preemptive kernel for fsl_mpc8349e_mitx BSP not to show "scheduling while atomic" message.
Optional Type: Patch

Patch to fix the preemptive kernel for fsl_mpc8349e_mitx BSP not to show "scheduling while atomic" message.

Released: Sep 16, 2007     Updated: Sep 16, 2007

Description

Problem Description :
---------------------
1. set CONFIG_PREEMPT=y
2. build kernel
3. boot the kernel on fsl_mpc8349e_mitx board
4. The message is shown on console.

….
Mounting USB filesystem: [ OK ]
Press 'I' to enter interactive startup.
scheduling while atomic: hwclock/0x00000001/689
Call trace:
[c026fca0] schedule+0x10a8/0x1138
[c0270a74] schedule_timeout+0x74/0xd4
[c01d2f6c] i2c_wait+0x158/0x1cc
[c01d326c] mpc_xfer+0x28c/0x388
[c01d1444] i2c_transfer_entry+0x7c/0x108
[c01d1d90] i2c_transfer+0x54/0x78
[c01d381c] ds1337_command+0x230/0x354
[c0017964] mpc8349_itx_get_rtc_time+0x28/0xa8
[c015c6a4] gen_rtc_ioctl+0x308/0x35c
[c00a0d2c] do_ioctl+0x84/0xc0
[c00a0e20] vfs_ioctl+0xb8/0x458
[c00a12a0] sys_ioctl+0xe0/0xa40
[c0004464] ret_from_syscall+0x0/0x6c
….

Fix Description :
----------------
Current i2c-mpc code was written thinking that it would always
be spawned from non atomic context, but the setting of the RTC
happens from the timer IRQ.

Removed the schedule() and wait_*() type functions from
the code paths of interest, replaced with a mdelay(1) so that
we don't continually smash the i2c waiting on the ready status
bits in our poll loops.

Testing Output:
---------------
enable PREEMPT and PREEMPT_BKL (Not on by default - they are the enhancement)
read date from RTC via hwclock.
set date to a new time.
store it to RTC via hwclock.
check dmesg for "scheduling while atomic" messages.

Testing on target:
------------------
root@mpc8349e-mitx:/root> cat /proc/version
Linux version 2.6.14.7-selinux1-WR1.5zz_cgl (paul@yow-pgortmak-d1) (gcc version 3.4.4 (Wind River Linux)) #20 PREEMPT Tue Aug 28 19:38:24 EDT 2007
root@mpc8349e-mitx:/root> date
Tue Aug 28 23:22:44 GMT 2007
root@mpc8349e-mitx:/root> date 082823442007
Tue Aug 28 23:44:00 GMT 2007
root@mpc8349e-mitx:/root> hwclock -r
Tue Aug 28 23:23:08 2007 -0.659846 seconds
root@mpc8349e-mitx:/root> hwclock -w
root@mpc8349e-mitx:/root> hwclock -r
Tue Aug 28 23:44:10 2007 -0.425670 seconds
root@mpc8349e-mitx:/root> date
Tue Aug 28 23:44:11 GMT 2007
root@mpc8349e-mitx:/root> dmesg |grep atomic
root@mpc8349e-mitx:/root> zcat /proc/config.gz |grep PREEMPT
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_BKL=y
CONFIG_DEBUG_PREEMPT=y
root@mpc8349e-mitx:/root>

IDENTIFIER = WIND00101065


Product Version

Linux Platforms 1.x

Downloads


Installation Notes

Installation Notes

Installation Instructions:
--------------------------

1. Copy the patch zip file to your /updates directory
2. Unzip the patch file
3. Go to your /updates/ directory
4. Run setup_linux and install the patch
5. This is a source patch to a non-default config option.
6. Configure for the fsl_mpc8349e_mitx board
7. Set kernel CONFIG_PREEMPT=y
8. build kernel
9. boot the kernel on fsl_mpc8349e_mitx board


Live chat
Online