Problem with notifier_lock in notifier_chain_unregister with 2.4. 0-test5

From: Adam Radford (aradford@3WARE.com)
Date: Thu Jul 20 2000 - 13:16:06 EST


I am trying create a patch for the 3ware driver to have it notify the cards
firmware
of a pending shutdown using register_reboot_notifier() and
unregister_reboot_notifier().

The problem is that under SMP, the system gets partially hung in
notifier_chain_unregister()
in kernel/sys.c in this area:

int notifier_chain_unregister(struct notifier_block **nl, struct
notifier_block *n)
{
        write_lock (&notifier_lock); ----> The system gets stuck
right here and never gets this lock
        while ((*nl)!=NULL)
        {
                if ((*nl)==n)
                {
                        *nl=n->next;
                        write_unlock(&notifier_lock);
                        return 0;
                }
                nl=&(*nl)->next);
        }
        write_unlock(&notifier_lock);
        return -ENOENT;
}

It is probably worth noting that the 2.2.X kernels don't have this lock
scheme, and removing it fixes the
problem. Is this lock scheme correct in 2.4.0 ?

--
Adam Radford
Software Engineer
3ware, Inc.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:14 EST