[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BC3A5CD34524E4468CEC38A99142631601AD93A8D3@cktexmb01.cds.int>
Date: Mon, 17 Sep 2018 17:09:30 +0000
From: "Spruyt, Randy" <Randy.Spruyt@...istiedigital.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "john.stultz@...aro.org" <john.stultz@...aro.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"sboyd@...eaurora.org" <sboyd@...eaurora.org>
Subject: getting a PHC reference in a kernel module?
I'm new to kernel driver development, so I hope you bear with me on the question.
I'd like to timestamp an IRQ event in a kernel module using a PTP synchronized clock (e.g. the PHC from eth0 = /dev/ptp0). E.g. a GPIO pin goes high, I'd like to keep track of when this happened as accurate as we can. One option is to use getnstimeofday() and have phc2sys synchronize /dev/ptp0 with the system clock.
This seems to work but I feel like there is a more direct way to just query the PHC clock e.g. using struct ptp_clock* and gettime64(). The question is how to get this pointer, find_driver()? Or something else? Perhaps this is not exposed for a reason?
If this is the wrong way to go about this, by all means, I'm open to suggestions.
Powered by blists - more mailing lists