ethercat/examples/mini
Bjarne von Horn 7727ac725d Use spinlocks in ec_mini.ko examples
down() must not be used in softirq context:
```
[  613.686994] BUG: sleeping function called from invalid context at ../kernel/locking/semaphore.c:58
[  613.687003] in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 29, name: ktimers/1
[  613.687007] preempt_count: 0, expected: 0
[  613.687009] RCU nest depth: 3, expected: 0
[  613.687013] CPU: 1 PID: 29 Comm: ktimers/1 Tainted: G        W  OE      6.1.38-lp154.12-0601rt #1 1ef8e7f7e45a6388beff51e7b17265074b1375d6
[  613.687020] Hardware name: ICP / iEi IMBA-9454ISA/IMBA-9454ISA(E168), BIOS 080014  02/20/2009
[  613.687023] Call Trace:
[  613.687029]  <TASK>
[  613.687034]  dump_stack_lvl+0x44/0x5c
[  613.687046]  __might_resched+0x171/0x1c0
[  613.687055]  ? check_slave_config_states+0x100/0x100 [ec_mini 7f93b9d1541d0037eab9400e73ee29f252250780]
[  613.687070]  down+0x1e/0x70
[  613.687076]  cyclic_task+0x11/0xdc [ec_mini 7f93b9d1541d0037eab9400e73ee29f252250780]
[  613.687088]  call_timer_fn+0x29/0x190
[  613.687096]  run_timer_softirq+0x4d5/0x570
[  613.687104]  ? __schedule+0x32b/0x1330
[  613.687110]  __do_softirq+0xd5/0x2ec
[  613.687117]  ? smpboot_thread_fn+0x23/0x300
[  613.687127]  run_timersd+0x60/0xb0
[  613.687130]  smpboot_thread_fn+0x24c/0x300
[  613.687133]  ? smpboot_unregister_percpu_thread+0x70/0x70
[  613.687135]  kthread+0x129/0x140
[  613.687138]  ? kthread_complete_and_exit+0x20/0x20
[  613.687141]  ret_from_fork+0x22/0x30
[  613.687146]  </TASK>
```
2024-02-01 14:09:00 +01:00
..
Kbuild.in Remove EtherCAT copyright notice. 2024-02-01 09:18:26 +01:00
Makefile.am Remove EtherCAT copyright notice. 2024-02-01 09:18:26 +01:00
README Removed MSR example; adapted RTAI example; README files for examples. 2008-07-02 12:16:48 +00:00
mini.c Use spinlocks in ec_mini.ko examples 2024-02-01 14:09:00 +01:00

README

-------------------------------------------------------------------------------

$Id$

-------------------------------------------------------------------------------

This is a minimal example module for the use of the EtherCAT master realtime
interface. It uses a kernel timer to generate a cyclic task.

Most probably you'll have different EtherCAT slaves present. Try adjusting the
section "process data" in mini.c to your bus configuration.

There are some features that can be disabled by commenting out the respective
defines at the head of mini.c.

---

To build the example module, call:

make modules

To run it, call:

insmod ec_mini.ko

...and watch the system logs for the outputs.

-------------------------------------------------------------------------------