Re: LinuxPPS low-level IRQs timestamps & ldisc

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rodolfo Giometti <giometti@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>
Date: Monday, June 2, 2008 - 10:02 am

> It could be a bit better... I did as above since I supposed that you

Ideally. But if it is genuinely the case that the serial port IRQ handler
in some cases needs to do

my_interrupt() {
	get_timestamp()
	frob_with_hardware()
	ld->dcd_change(blah, timestamp)
}

then that is still fairly clean and more importantly actually appears to
work. I'd avoid all the ifdefs with this in the serial drivers that need
more accuracy:

{
	struct timespec ts;
	if (ld->dcd_change)
		getnstimeofday(&ts);
	existing tty stuff
	if (ld->dcd_change)
		ld->dcd_change(tty, status, &ts);
}

And in ld->dcd_change do

	struct timespec myts;
	/* Caller passed NULL meaning 'do your own timestamp' */
	if (ts == NULL) {
		ts = &myts;
		getnstimeofday(&myts);
	}

so for uart that would

	uart_dcd_change(struct uart_port *port, unsigned int status,
					struct timespec *ts) {
	{
		...
	}

passing the timestamp from the ttys own IRQ handler

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
LinuxPPS low-level IRQs timestamps &amp; ldisc, Rodolfo Giometti, (Sun Jun 1, 12:15 pm)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Rodolfo Giometti, (Mon Jun 2, 5:25 am)
Re: LinuxPPS low-level IRQs timestamps & ldisc, Alan Cox, (Mon Jun 2, 10:02 am)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Rodolfo Giometti, (Mon Jun 2, 10:56 am)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Lennart Sorensen, (Mon Jun 2, 1:09 pm)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Rodolfo Giometti, (Mon Jun 2, 1:22 pm)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Matti Aarnio, (Mon Jun 2, 4:21 pm)
Re: LinuxPPS low-level IRQs timestamps &amp; ldisc, Lennart Sorensen, (Sun Jun 1, 3:26 pm)