• Ralf Baechle's avatar
    [PATCH] rcu in bpqether driver. · bc0a7438
    Ralf Baechle authored
    From Suzanne Wood <suzannew@cs.pdx.edu>:
    
    Clarify RCU implementation in bpqether.c.
    
    Because bpq_new_device() calls list_add_rcu() and bpq_free_device() calls
    list_del_rcu(), substitute list_for_each_entry_rcu() for
    list_for_each_entry() in bpq_get_ax25_dev() and in bpq_seq_start().
    
    Add rcu dereference protection in bpq_seq_next().
    
    The rcu_read_lock()/unlock() in bpq_device_event() are removed because
    netdev event handlers are called with RTNL locking in place.
    
    FYI: bpq_free_device() calls list_del_rcu() which, per list.h, requires
    synchronize_rcu() which can block or call_rcu() or call_rcu_bh() which
    cannot block.  Herbert Xu notes that synchronization is done here by
    unregister_netdevice().  This calls synchronize_net() which in turn uses
    synchronize_rcu().
    Signed-off-by: default avatarRalf Baechle DL5RB <ralf@linux-mips.org>
    Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
    bc0a7438
bpqether.c 14.3 KB