public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Sander <tim@krieglstein.org>
To: Richard Cochran <richardcochran@gmail.com>, linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Subject: ptp device strangeness
Date: Fri, 01 Sep 2017 17:28:34 +0200	[thread overview]
Message-ID: <1934181.WnEexch2hB@dabox> (raw)

Hi

I am currently using ptp on a Altera/Intel SOC with a dp8640 PHY.
PTP functionality seems to be right. But i am doing timestamping
with gpio0 and sometimes i loose the sync of the stamping and
the events. So i would like to read out all messages. Reading O_NONBLOCK
does not work so i tried polling from usermode with the below code:

		np = poll(&ev, 1, 0);
		ev.fd=ptpDev;
		ev.events = POLLIN;
		if (np>0) {
			if (ev.revents>0) {
				std::cout<<"discarded ptp event"<<std::endl;
				read(ptpDev, &event, sizeof(event));
			}
But as confirmed in the debugger np=1 and read blocks forever.
I don't think that this is correct behavior?

For pinning down this misbehavior I would like to know it this is a local 
problem of my hardware or if this is a general problem with the ptp chardev 
interface? 

I am currently on 4.11.12. As this is the latest preempt rt release.

Best regards
Tim

                 reply	other threads:[~2017-09-01 15:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1934181.WnEexch2hB@dabox \
    --to=tim@krieglstein.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /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