Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Kulhavy <brain@jikos.cz>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/3] package: linuxptp: workaround for system crash if PHY is not initialized
Date: Sun, 28 Jan 2018 17:00:21 +0100	[thread overview]
Message-ID: <1517155221-19399-3-git-send-email-brain@jikos.cz> (raw)
In-Reply-To: <1517155221-19399-1-git-send-email-brain@jikos.cz>

On some systems (tested on i.MX6 with Freescale kernel 4.1) the system freezes
if phc2sys starts before the PHY is initialized (phc2sys opens /dev/ptp0).

Unfortunately systemd network.target does not guarantee the PHY to be initialized.
This workaround pulls in the network-online.target dependency, which postpones
the phc2sys start after the link is up.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
---
 package/linuxptp/linuxptp-system-clock.service | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/linuxptp/linuxptp-system-clock.service b/package/linuxptp/linuxptp-system-clock.service
index a4436a3..0c73983 100644
--- a/package/linuxptp/linuxptp-system-clock.service
+++ b/package/linuxptp/linuxptp-system-clock.service
@@ -2,6 +2,10 @@
 Description=Precision Time Protocol system clock synchronization
 After=linuxptp.service
 
+# workaround for crashing Freescale PHY if initialized after /dev/ptp0 is open
+After=network-online.target
+Wants=network-online.target
+
 [Service]
 ExecStart=/usr/sbin/phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0
 Restart=always
-- 
2.7.4

  parent reply	other threads:[~2018-01-28 16:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28 16:00 [Buildroot] [PATCH 1/3] package: linuxptp: bump to the latest GIT version Petr Kulhavy
2018-01-28 16:00 ` [Buildroot] [PATCH 2/3] package: linuxptp: enhance systemd service Petr Kulhavy
2018-01-30 22:00   ` Thomas Petazzoni
2018-01-30 22:19     ` Petr Kulhavy
2018-10-21 23:19       ` Arnout Vandecappelle
2018-01-28 16:00 ` Petr Kulhavy [this message]
2018-01-30 22:01   ` [Buildroot] [PATCH 3/3] package: linuxptp: workaround for system crash if PHY is not initialized Thomas Petazzoni
2018-01-30 22:14     ` Petr Kulhavy
2018-10-21 22:12       ` Arnout Vandecappelle
2018-01-30 22:00 ` [Buildroot] [PATCH 1/3] package: linuxptp: bump to the latest GIT version Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517155221-19399-3-git-send-email-brain@jikos.cz \
    --to=brain@jikos.cz \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox