Re: [PARPORT] ECP mode transfers in 2.4.x kernels

From: Tim Waugh (twaugh@redhat.com)
Date: Thu Aug 23 2001 - 12:07:08 EDT

  • Next message: Ian Hinder: "[PARPORT] Parport sharing code on old 486 laptop"

    On Thu, Aug 23, 2001 at 12:01:00PM -0400, Dave Strauss wrote:

    > On Thu, 23 Aug 2001 16:36:49 +0100, Tim Waugh <twaugh@redhat.com> wrote:
    > >
    > > On Thu, Aug 23, 2001 at 11:31:50AM -0400, Dave Strauss wrote:
    > >
    > > > if (check_release_me_flag()) {
    > >
    > > You can clear it here, since you are already going to release the
    > > port. Otherwise:
    > >
    > > > parport_release();
    > > ... it could get set here...
    > > > lock_access();
    > > > clear_release_me_flag();
    > > ... and never noticed.
    > > > unlock_access();
    > > > clear_ownership_flag();
    > > > }
    > > > }
    > >
    > > Tim.
    > > */
    > >
    > Not necessarily. I probably don't care if it gets set after I
    > check for it, because I will sooner or later come back into an
    > entrypoint and check for it again.

    No, but you do care if it gets set after you check it but before you
    set it, which is why you want to do both at the set time.

    > I'm assuming that "lock_access()" exists and that it holds off
    > the preempt function from getting at the "release_me" flag until
    > "unlock_access()" is called. What would these functions consist
    > of?

    Just use test_and_set_bit.

    Tim.
    */



    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 12:13:38 EDT