Commit Graph

401 Commits

Author SHA1 Message Date
Graeme Foot 2c1597231d Applied base-0028-ec_master_exec_slave_fsms-external-datagram-fix
Slaves can fail to correctly read their SII information, leading to
zero or corrupted SII information.  This leads to slaves that remain
in PREOP or SAFEOP.

This is caused by the cached external (slave) datagrams being cycled
through too quickly due to being marked as consumed when they are not.
Datagrams can then be lost or incorrectly shared between multiple slaves
as the ring returns a datagram that is still in use by a read SII call.

This may also occur if multiple services are contending for a slaves
mailbox.

I have not added checks into ec_master_get_external_datagram() to
check that a returned datagram is not currently in use.
2023-08-29 14:38:54 +02:00
Knud Baastrup ff2e062a08 Applied base-0026-EoE-processing-is-now-only-allowed-in-state-PREOP
EoE is disabled in INIT, BOOT, and invalid states to prevent errors.
2023-08-29 14:38:54 +02:00
Knud Baastrup ba27819221 Applied base-0024-Sdo-directory-now-only-fetched-on-request
Sdo directory now only fetched on request.

The time-consuming SDO directory fetch during slave scan can now be
skipped by setting the EC_SKIP_SDO_DICT in globals.h. The directory
will now instead be fethed the first time an ethercat sdos command
is executed with the ethercat tool.
2023-08-29 14:38:54 +02:00
Knud Baastrup 1124a8b359 Applied base-0023-Skip-output-statistics-during-re-scan
Skip output statistics during re-scan.

No reason to write output statistics in syslog when issuing a slave
scanning where UNMATCHED datagrams are expected behavior.
2023-08-28 13:41:59 +02:00
Knud Baastrup 74798d5259 Applied base-0022-Clear-slave-mailboxes-after-a-re-scan
When rescanning a slave (and thus discarding any prior pending FSMs),
explicitly clear the slave mailbox, to avoid getting confused by a
stale response.
2023-08-28 13:39:15 +02:00
Florian Pose 24a361c8f5 Allow zero-sized SDO responses 2023-05-02 10:53:33 +02:00
Esben Haabendal 81758004fd Improve synchronization of master->domains list
Introduce a new lock for synchronization of the master->domains list, and use
that instead of the big master_sem lock, improving real-time performance of
fx. ecrt_domain_process() when EoE thread is being shut down (or other
use-cases where master_sem is held for extended periods).

The following locking order is used:

* master->master_sem
* master->domains_lock
* master->io_sem
* domain->datagram_pairs_lock

Meaning that it is allowed to take domains_lock while holding master_sem, and
it is allowed to hold domains_lock while locking io_sem and
datagram_pairs_lock.

[RV: For now, the lockdep_assert_held() annotations are commented out,
since they don't compile with CONFIG_PROVE_LOCKING and (the default)
--disable-rtmutex.]
2022-09-01 15:38:01 +02:00
Esben Haabendal 2372382259 Acquire master->io_sem lock where needed
With this, we should have in place so that master->io_sem is always held when
accessing master->datagram_queue.

Note, the use of master->master_sem in ec_ioctl_send() and
ec_ioctl_receive() were wrong (introduced in commit cef602586c). The
only thing needing to be synchronized there is the access to
master->datagram_queue, which is protected by master->io_sem.

This corresponds roughly to the fixes for stable-1.5 that are seen in
https://gitlab.com/etherlab.org/ethercat/-/merge_requests/36 .
2022-09-01 15:37:54 +02:00
Florian Pose 8896d3b879 Applied 0020-eoe-ip.patch 2022-06-23 12:39:52 +02:00
Florian Pose f943348d98 Applied 0019-Support-for-multiple-mailbox-protocols.patch 2022-06-23 11:54:10 +02:00
Florian Pose 9955855f7e Applied 0016-If-enable-rtmutex-use-rtmutexes-instead-of-semaphore.patch 2022-06-23 11:21:51 +02:00
Florian Pose 667e93284d Applied 0015-Clear-configuration-on-deactivate-even-if-not-activa.patch 2022-06-23 11:00:45 +02:00
Florian Pose d09daadfbb Applied 0013-Do-not-reuse-the-index-of-a-pending-datagram.patch 2022-06-23 10:58:57 +02:00
Florian Pose 225af9f787 Applied 0008-read-reference-slave-clock-64bit-time.patch 2022-06-23 10:45:16 +02:00
Florian Pose 17eddce68d Applied 0002-Distributed-Clock-fixes-from-Jun-Yuan.patch 2022-06-23 10:12:12 +02:00
Florian Pose b4f8c0e750 Added 0001-Distributed-Clock-fixes-and-helpers.patch 2022-06-23 10:07:34 +02:00
Florian Pose ffbb1eed9f Define set_normal_priority() inside #ifdef EC_EOE. Fixes #12. 2021-08-31 13:09:09 +02:00
Florian Pose f2e838a664 Also changed license of gloabl headers to LGPL.
Moved definition of EC_SDO_INJECTION_TIMEOUT to master.c.
2021-08-24 17:40:06 +02:00
Nicola Fontana 40bd393ed0 Fix sched_setscheduler undefined on kernel 5.9
sched_setscheduler is no more exported:
    https://lkml.org/lkml/2020/4/22/1071
2021-08-24 17:15:09 +02:00
Florian Pose c2abe4d8d3 Fixed missing include for struct sched_param. 2021-08-24 17:13:21 +02:00
Florian Pose fffbeb4ba5 Added ecrt_master_sync_reference_clock_to() method. 2021-08-24 16:56:23 +02:00
Florian Pose 9d733cb1a9 Renamed app_start_time to dc_ref_time; output via command-line tool. 2021-08-24 16:48:07 +02:00
Florian Pose ef9517e7c3 Improved buffer overflow messages. 2021-08-24 16:33:05 +02:00
Florian Pose 606000bf40 Support scheduler parameters in kernels >= 4.11. 2021-08-24 16:32:36 +02:00
Florian Pose 1d28eafa1f Fixed statistics filter initialisation. 2021-08-24 16:29:20 +02:00
Florian Pose e78d153199 Minor change. 2016-06-22 14:08:34 +02:00
Florian Pose be5dfb7278 Do not touch AL state of EoE slaves. 2016-05-03 15:14:42 +02:00
Dave Page 45839e8666 16-ethercat-1.5-frame-corruption.patch
from ethercat-1.5.0-patches-v2.tar.bz2
by Frank Heckenbach f.heckenbach@ at fh-soft.de
Ref: http://lists.etherlab.org/pipermail/etherlab-dev/2014/000404.html
with some additional edits.
2015-04-14 16:25:44 -04:00
Gavin Lambert d9a93ffa24 Mark download data as const.
Remove redundant code.
[07-sdo-up-download]
2014-05-31 18:08:27 +12:00
Gavin Lambert 1d35113c85 Abort requests started for slave_configs that don't have any actual slaves. 2015-04-14 09:35:15 -04:00
Gavin Lambert 0aaf68055e Do not force the DC reference clock to OP; if it is not configured it may refuse and flood the logs. 2014-05-31 15:37:33 +12:00
Florian Pose 99418519bd Reverted default branch to stable-1.5. 2014-11-03 15:20:05 +01:00
Florian Pose 6ee0a18ac7 Fixed reset of allow_scanning flag if ecrt_master_activate() was not called. 2012-01-13 11:27:20 +01:00
Florian Pose 42b1bb1d3f Copy missing slave_info data in kernel space. 2012-01-10 10:11:20 +01:00
Florian Pose 4aaba1c675 Avoided unused variable warnings. 2012-01-09 17:42:28 +01:00
Florian Pose 4874ad087c Improved resetting number of responding slaves. 2011-12-09 10:35:23 +01:00
Florian Pose 2d0b832923 Fixed missing initialisation of allow_config flag. 2011-12-09 10:31:29 +01:00
Florian Pose 4a858fc97e Fixed compiler error in master.c; thanks to Jun Yuan. 2011-12-05 11:29:28 +01:00
Florian Pose 0b32dd07dd Added ecrt_master_sdo_download_complete() for ad-hoc downloading SDOs (also
via the command-line tool).
2011-10-24 10:49:27 +02:00
Florian Pose 4c0e5279e1 Removed allow_config flag and obsolete request to OP. 2011-09-16 14:10:23 +02:00
Florian Pose e3ac1ec003 Don not copy frame data to datagram memory, if datagram type is write-only. 2011-09-16 12:44:54 +02:00
Florian Pose f6b4789eca Fixed compiler error; added SDO debugging. 2011-09-15 16:45:58 +02:00
Florian Pose 8cf159bc08 Implemented ecrt_master_sdo_upload() and ecrt_master_sdo_download() for kernel
space.
2011-09-15 15:58:58 +02:00
Florian Pose 699bb79eca Fixed spacing and added some thoughts about the overlapping PDOs
implementation.
2011-08-11 20:44:18 +02:00
Florian Pose 6171cc6e3b Fixed skipped datagrams output again; added datagram information on skip. 2011-08-01 17:54:56 +02:00
Florian Pose c57242219f Minor: Fixed line wraps and spacing. 2011-08-01 17:02:45 +02:00
Florian Pose e80332d61a Fixed bug in ec_master_queue_datagram() introduced in c9d32805d984. 2011-07-21 18:25:38 +02:00
Florian Pose 8e5a96aa45 merge. 2011-07-08 15:31:46 +02:00
Florian Pose ae060ff267 Improved ecrt_master_queue_datagram(); detect skipped datagrams also when
already sent.
2011-07-08 14:26:25 +02:00
Andreas Stewering-Bone f1e2f6d912 Merge 2011-04-13 22:06:28 +02:00