lkml.org 
[lkml]   [2010]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCHv4 05/17] pps: access pps device by direct pointer
    В Sun, 21 Nov 2010 14:12:26 +0000
    Alan Cox <alan@lxorguk.ukuu.org.uk> пишет:

    >
    > > Maybe this lock is useless... however, are we sure that before setting
    > > tty->disc_data to pps its value is null? Otherwise the dcd_change may
    > > be called with an oops! We cannot control serial port IRQ
    > > generation... :-/
    >
    > tty->disc_data is LDISC private. It may be any arbitary value on entry to
    > the ldisc open method.
    >
    >
    > > > + spin_lock_irq(&pps_ldisc_lock);
    > > > + tty->disc_data = NULL;
    > > > + spin_unlock_irq(&pps_ldisc_lock);
    >
    > And you don't need to set it to NULL after - some ldiscs do this mostly
    > as a debug aid.

    It was a part of attempt to do a workaround. But it still is not safe
    enough because it doesn't protect from a sudden ldisc change while we
    are at the beginning of pps_tty_dcd_change() i.e. haven't acquired spin
    lock yet. The real fix is ready, I'll send it soon.

    --
    Alexander
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2010-11-22 15:59    [W:0.035 / U:32.484 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site