From patchwork Sun Jan 28 16:00:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Kulhavy X-Patchwork-Id: 866840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zTy7b2NJwz9sBd for ; Mon, 29 Jan 2018 03:01:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5D88F2DFDD; Sun, 28 Jan 2018 16:01:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDAYmdQrPT7f; Sun, 28 Jan 2018 16:01:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CA9FF2D75F; Sun, 28 Jan 2018 16:01:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5984B1C0E79 for ; Sun, 28 Jan 2018 16:01:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 55C5F87AC0 for ; Sun, 28 Jan 2018 16:01:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28tsbhZuipKb for ; Sun, 28 Jan 2018 16:01:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from twin.jikos.cz (twin.jikos.cz [91.219.245.39]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 32F9E87AB7 for ; Sun, 28 Jan 2018 16:01:31 +0000 (UTC) Received: from localhost.localdomain (240.90.254.84.ftth.as8758.net [84.254.90.240]) (authenticated bits=0) by twin.jikos.cz (8.13.6/8.13.6) with ESMTP id w0SG0hkb029714; Sun, 28 Jan 2018 17:01:28 +0100 From: Petr Kulhavy To: buildroot@buildroot.org Date: Sun, 28 Jan 2018 17:00:21 +0100 Message-Id: <1517155221-19399-3-git-send-email-brain@jikos.cz> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517155221-19399-1-git-send-email-brain@jikos.cz> References: <1517155221-19399-1-git-send-email-brain@jikos.cz> Subject: [Buildroot] [PATCH 3/3] package: linuxptp: workaround for system crash if PHY is not initialized X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Kulhavy MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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