All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: linux-kernel@vger.kernel.org,
	"Nikita V. Youshchenko" <yoush@cs.msu.su>,
	linuxpps@ml.enneenne.com, john stultz <johnstul@us.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Joonwoo Park <joonwpark81@gmail.com>
Subject: Re: [PATCHv3 05/16] pps: access pps device by direct pointer
Date: Mon, 9 Aug 2010 14:47:41 +0200	[thread overview]
Message-ID: <20100809124741.GC20272@gundam.enneenne.com> (raw)
In-Reply-To: <20100809115343.122c4f2c@desktopvm.lvknet>

On Mon, Aug 09, 2010 at 11:53:43AM +0400, Alexander Gordeev wrote:
> 
> Hmm, yes, I see...
> But this is custom problem of only one client. I think it should be
> fixed in place instead of trying to fix it in the subsystem.

I agree with you but I had no luck in doing it in the past... :'(

Maybe you can ask some help to the serial port maintainers or you can
try in pushing the PPS_IRQ_EVENTS solution (see my repository) into
main tree, in fact that solution could resolve two problems at once:

* this one, since we simply read PPS data into an array in RAM, and
* the weak PPS resolution in recording PPS timestamps into normal IRQ
* handlers.

However, the big issue on this solution is about the call of
gettimeofday() for each IRQs into the system (see old mails into this
list about this topic) which slows down the machine's performance.

A workaround (as suggested by Alan Cox if I well remember) could be
adding a flag for each IRQs in order to know if the timestamp must be
recorded or not (testing a flag is not a bit issue for the machine's
performance).

> Are you 100% sure dcd_change can be called before open or after close?
> Then I'll try to deal with this.

Before the open there are no problems since the line discipline is
off, the problem is during the close.

> > > affects performance. So we have to choose what is the priority:
> > > security or performance. My guru told me I shouldn't bother too much
> > > about broken kernel-space code which my code interacts with. If it's
> > > broken it should be fixed. Some assertions enabled by DEBUG define are
> > > enough. For me it makes sense but I don't know what should I check here?
> > 
> > I'm sorry but I disagree with you. Kernel code can't allow userland
> > programs to corrupt it!
> > 
> > We are not discussing about security or performance but about
> > reliability.
> 
> Sure, now I see the problem (in the pps-ldisc).

Yes, the problem is there (and globally in all drivers whose not
directly take care off PPS issues). Unluckely the pps-ldisc is the
most currently used by PPS users...

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it

  reply	other threads:[~2010-08-09 12:47 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 21:06 [PATCHv3 00/16] pps: several fixes and improvements Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 01/16] pps: trivial fixes Alexander Gordeev
2010-08-05  8:57   ` Rodolfo Giometti
2010-08-04 21:06 ` [PATCHv3 02/16] pps: declare variables where they are used in switch Alexander Gordeev
2010-08-05  9:05   ` Rodolfo Giometti
2010-08-04 21:06 ` [PATCHv3 03/16] pps: fix race in PPS_FETCH handler Alexander Gordeev
2010-08-05  5:19   ` Vitezslav Samel
2010-08-05 10:19     ` Alexander Gordeev
2010-08-05 11:07       ` Vitezslav Samel
2010-08-05 14:31         ` Alexander Gordeev
2010-08-05  9:15   ` Rodolfo Giometti
2010-08-04 21:06 ` [PATCHv3 04/16] pps: unify timestamp gathering Alexander Gordeev
2010-08-05  9:17   ` Rodolfo Giometti
2010-08-04 21:06 ` [PATCHv3 05/16] pps: access pps device by direct pointer Alexander Gordeev
2010-08-05  9:32   ` Rodolfo Giometti
2010-08-05 11:42     ` Alexander Gordeev
2010-08-05 12:31       ` Rodolfo Giometti
2010-08-09  7:53         ` Alexander Gordeev
2010-08-09 12:47           ` Rodolfo Giometti [this message]
2010-08-04 21:06 ` [PATCHv3 06/16] pps: convert printk/pr_* to dev_* Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 07/16] pps: move idr stuff to pps.c Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 08/16] pps: add async PPS event handler Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 09/16] pps: don't disable interrupts when using spin locks Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 10/16] pps: use BUG_ON for kernel API safety checks Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 11/16] pps: simplify conditions a bit Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 12/16] ntp: add hardpps implementation Alexander Gordeev
2010-08-04 22:49   ` john stultz
2010-08-05 12:00     ` Alexander Gordeev
2010-08-04 23:26   ` Andrew Morton
2010-08-04 23:39     ` David Daney
2010-08-04 23:49       ` Andrew Morton
2010-08-04 21:06 ` [PATCHv3 13/16] pps: capture MONOTONIC_RAW timestamps as well Alexander Gordeev
2010-08-04 23:03   ` john stultz
2010-08-05 12:16     ` Alexander Gordeev
2010-08-04 23:29   ` Andrew Morton
2010-08-05 12:29     ` Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 14/16] pps: add kernel consumer support Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 15/16] pps: add parallel port PPS client Alexander Gordeev
2010-08-04 23:34   ` Andrew Morton
2010-08-05 12:48     ` Alexander Gordeev
2010-08-04 21:06 ` [PATCHv3 16/16] pps: add parallel port PPS signal generator Alexander Gordeev
2010-08-04 23:38   ` Andrew Morton

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=20100809124741.GC20272@gundam.enneenne.com \
    --to=giometti@enneenne.com \
    --cc=akpm@linux-foundation.org \
    --cc=johnstul@us.ibm.com \
    --cc=joonwpark81@gmail.com \
    --cc=lasaine@lvk.cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxpps@ml.enneenne.com \
    --cc=tj@kernel.org \
    --cc=yoush@cs.msu.su \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.