在tasklet中一般不要做休眠的动作,如果在tasklet_handler中执行了msleep(5000),
void as3604_tasklet_handler(unsigned long ignore)
{
PRINT_CURRENT_INFO();
msleep(5000);
printk("Test number is %d\n", iTestNumber);
}
由于 tasklet 休眠时间太长,内核还是会被调度,但是,这是一个不好的现象,内核会给出提示:
[PID:0 swapper] in_interrupt: 256, in_atomic 1, function as3604_tasklet_handler, line 1659
scheduling while atomic: swapper/0x00000100/0
bad: scheduling from the idle thread!
如果在tasklet中做了休眠动作,该tasklet仍然会被抢占,但是内核会给出提示,不建议在tasklet中加入延时的,应该尽快的处理完毕tasklet。
zImage magic = 0x016f2818
NOW, Booting Linux......
Uncompressing Linux................................................................................ done, booting the kernel.
Linux version 2.6.10 (xiewei@ibmGentoo) (gcc version 3.4.2 (release) (CodeSourcery ARM Q3 2004)) #37 Sun Oct 26 23:51:03 UTC 2008
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
CPU: D VIVT write-back cache
CPU: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: SMDK2440
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2442B (id 0x32440aab)
S3C2440: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz
S3C2440 Clock control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: root=/dev/mtdblock/2 init=/linuxrc rootfstype=cramfs ro noinitrd console=ttySAC2,115200n8 mem=57M
irq: clearing subpending status 00000080
PID hash table entries: 256 (order: 8, 4096 bytes)
OK? timer tcon=00500000, tcnt 28a6, tcfg 00000f00,00000000, usec 0000170f
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 57MB = 57MB total
Memory: 55168KB available (1795K code, 615K data, 160K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2440: Initialising architecture
Linux Plug and Play Support v0.97 (c) Adam Belay
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 65 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
rtc5372_REG_CTRL1=c0, rtc5372_REG_CTRL2=20
rtc5372_REG_CTRL1=c0, rtc5372_REG_CTRL2=20
i2c address 0x32 already in use.
i2c address 0x32 already in use.
as3604(chip id:0x33) detected.
[PID:1 swapper] in_interrupt: 65536, in_atomic 1, function as3604_irq_handler, line 1680
schedule_work(&as3604_work);
tasklet_schedule(&as3604_tasklet);
[PID:1 swapper] in_interrupt: 256, in_atomic 1, function as3604_tasklet_handler, line 1659
scheduling while atomic: swapper/0x00000100/1
[PID:3 events/0] in_interrupt: 0, in_atomic 0, function as3604_callback, line 1694
::hilbert:as3604 interrupt status = 0x12
Test number is 10
wake enabled for irq 0
S3C2440 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4102000, irq 17
DMA channel 1 at c4102040, irq 18
DMA channel 2 at c4102080, irq 19
DMA channel 3 at c41020c0, irq 20