[LinuxPPS] safe pps_register_source()

Fabio Checconi fchecconi at gmail.com
Thu Aug 9 15:40:41 CEST 2007


Hi !

On Thu, Aug 09, 2007 at 02:24:23PM +0200, Rodolfo Giometti wrote:
> Hello,
> 
> looking at your patch for old LinuxPPS 4.x series I suppose I need to
> apply this patch to the new 5.x series...
> 
> Please, let me know what do you think about it.
> 

I think we need something to prevent the deregistration of the
source while someone is waiting on it; wrt this patch I think that
pps_event() is not the best place to signal that the source is no
more used, since after pps_event() ends, in interrupt context, the
unregistering task will free the chardev, while the task resuming
from fetch will try to access the (already freed) source for its
data.  Also using only the completion structure without an associated
completion condition (i.e., the number of blocked tasks) I think
can be racy.

I think we need to leave to the task(s) doing fetch to wake up
anyone waiting to do source deregistration.

Hope it helps,
fabio




More information about the LinuxPPS mailing list