LINUX.ORG.RU

История изменений

Исправление ttnl, (текущая версия) :

preempt_count() у тебя равен:

printf "0x%x\n" 7600
0x1db0

При этом

 * We put the hardirq and softirq counter into the preemption
 * counter. The bitmask has the following meaning:
 *
 * - bits 0-7 are the preemption count (max preemption depth: 256)
 * - bits 8-15 are the softirq count (max # of softirqs: 256)
 *
 * The hardirq count can in theory reach the same as NR_IRQS.
 * In reality, the number of nested IRQS is limited to the stack
 * size as well. For archs with over 1000 IRQS it is not practical
 * to expect that they will all nest. We give a max of 10 bits for
 * hardirq nesting. An arch may choose to give less than 10 bits.
 * m68k expects it to be 8.
 *
 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
 * - bit 26 is the NMI_MASK
 * - bit 27 is the PREEMPT_ACTIVE flag
 *
 * PREEMPT_MASK: 0x000000ff
 * SOFTIRQ_MASK: 0x0000ff00
 * HARDIRQ_MASK: 0x03ff0000
 *     NMI_MASK: 0x04000000

Т.е. твой preempt_count() ни на что разумное не похож. Ты где-то накосячил с синхронизацией (запрещаешь local_bh, делаешь preempt_disable, но потом не разрешаешь), либо портишь память (хотя это маловероятно, т.к. оно проявлялось бы более явно), либо еще что-нибудь.

Если код драйвера хорош, можешь выложить тут, посмотрим. Если плох, то лучше не выкладывай.

Upd. Ядро 2.4, я вначале не заметил. Как там — ХЗ.

Исходная версия ttnl, :

preempt_count() у тебя равен:

printf "0x%x\n" 7600
0x1db0

При этом

 * We put the hardirq and softirq counter into the preemption
 * counter. The bitmask has the following meaning:
 *
 * - bits 0-7 are the preemption count (max preemption depth: 256)
 * - bits 8-15 are the softirq count (max # of softirqs: 256)
 *
 * The hardirq count can in theory reach the same as NR_IRQS.
 * In reality, the number of nested IRQS is limited to the stack
 * size as well. For archs with over 1000 IRQS it is not practical
 * to expect that they will all nest. We give a max of 10 bits for
 * hardirq nesting. An arch may choose to give less than 10 bits.
 * m68k expects it to be 8.
 *
 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
 * - bit 26 is the NMI_MASK
 * - bit 27 is the PREEMPT_ACTIVE flag
 *
 * PREEMPT_MASK: 0x000000ff
 * SOFTIRQ_MASK: 0x0000ff00
 * HARDIRQ_MASK: 0x03ff0000
 *     NMI_MASK: 0x04000000

Т.е. твой preempt_count() ни на что разумное не похож. Ты где-то накосячил с синхронизацией (запрещаешь local_bh, делаешь preempt_disable, но потом не разрешаешь), либо портишь память (хотя это маловероятно, т.к. оно проявлялось бы более явно), либо еще что-нибудь.

Если код драйвера хорош, можешь выложить тут, посмотрим. Если плох, то лучше не выкладывай.