[etherlab-users] Hotplug
Frank Werner
frank at wesoft.de
Mon Apr 18 13:19:28 CEST 2011
Hello,
I like to support hotplugging in my kernel module. My kernel module is
based on the mini.c example from EtherCAT 1.5.0.
To add or remove the slaves after hot plugging I habe to first
deactivate the master, second config the master and last activate the
master. Is that right?
When I try to deactivate the master inside the cycle function (see
mini.c) the kernel shows me the folliwing warning:
Apr 18 13:00:27 gomera0 kernel: EtherCAT 0: Domain 0: Working counter
changed to 1/2.
Apr 18 13:00:27 gomera0 kernel: EtherCAT 0: 3 slave(s) responding.
Apr 18 13:00:27 gomera0 kernel: EtherCAT 0: Scanning bus.
Apr 18 13:00:27 gomera0 kernel: ec_control: DEBUG1:
ec_control_deactivate_master()
Apr 18 13:00:27 gomera0 kernel: BUG: scheduling while atomic:
EtherCAT-OP/0x00000100/3181
Apr 18 13:00:27 gomera0 kernel: [<c02ab176>]
__sched_text_start+0x56/0x4ea
Apr 18 13:00:27 gomera0 kernel: [<f8b9708d>] ec_control_cycle+0x0/0xac
[ec_control]
Apr 18 13:00:27 gomera0 kernel: [<f8817c74>] e100_exec_cb+0x91/0xe4
[ec_e100]
Apr 18 13:00:27 gomera0 kernel: [<f8817219>]
e100_xmit_prepare+0x0/0x98 [ec_e100]
Apr 18 13:00:27 gomera0 kernel: [<c02ab734>]
wait_for_completion+0x55/0x7e
Apr 18 13:00:27 gomera0 kernel: [<c01107b9>]
default_wake_function+0x0/0xc
Apr 18 13:00:27 gomera0 kernel: [<f8b9708d>] ec_control_cycle+0x0/0xac
[ec_control]
Apr 18 13:00:27 gomera0 kernel: [<c0120b62>] kthread_stop+0x4c/0x6a
Apr 18 13:00:27 gomera0 kernel: [<f885e146>]
ec_master_thread_stop+0x51/0x89 [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<f885e8b8>]
ecrt_master_deactivate+0x5e/0x179 [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<f8b9708d>] ec_control_cycle+0x0/0xac
[ec_control]
Apr 18 13:00:27 gomera0 kernel: [<c01134b0>] printk+0x1b/0x1f
Apr 18 13:00:27 gomera0 kernel: [<f8b9708d>] ec_control_cycle+0x0/0xac
[ec_control]
Apr 18 13:00:27 gomera0 kernel: [<f8b95104>]
ec_control_deactivate_master+0x2a/0x34 [ec_control]
Apr 18 13:00:27 gomera0 kernel: [<f8b96e12>]
ec_control_check_master_state+0x82/0xcf [ec_control]
Apr 18 13:00:27 gomera0 kernel: [<f8b97126>]
ec_control_cycle+0x99/0xac [ec_control]
Apr 18 13:00:27 gomera0 kernel: [<c01192a4>]
run_timer_softirq+0xe0/0x12f
Apr 18 13:00:27 gomera0 kernel: [<c0116500>] __do_softirq+0x35/0x75
Apr 18 13:00:27 gomera0 kernel: [<c0116562>] do_softirq+0x22/0x26
Apr 18 13:00:27 gomera0 kernel: [<c0104a0a>] do_IRQ+0x61/0x73
Apr 18 13:00:27 gomera0 kernel: [<c01030a3>]
common_interrupt+0x23/0x28
Apr 18 13:00:27 gomera0 kernel: [<f885045e>]
ec_datagram_output_stats+0x5a/0x5f [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<f885f200>]
ec_master_operation_thread+0x4c/0x128 [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<f885f1b4>]
ec_master_operation_thread+0x0/0x128 [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<f885f1b4>]
ec_master_operation_thread+0x0/0x128 [ec_master]
Apr 18 13:00:27 gomera0 kernel: [<c0120d0c>] kthread+0xa0/0xc8
Apr 18 13:00:27 gomera0 kernel: [<c0120c6c>] kthread+0x0/0xc8
Apr 18 13:00:27 gomera0 kernel: [<c0103223>]
kernel_thread_helper+0x7/0x10
Apr 18 13:00:27 gomera0 kernel: =======================
What's the right way to implement hotplugging to my kernel module?
Thanks,
-Frank-
More information about the Etherlab-users
mailing list