On Mon, Aug 10, 2009 at 10:28:43AM -0700, Paul E. McKenney wrote: > On Mon, Aug 10, 2009 at 06:16:39PM +0400, Dmitry Eremin-Solenikov wrote: > > Some of available devices are just dump radios implementing IEEE 802.15.4 > > PHY layer. This commit adds a common library that acts like an intermediate > > layer between our socket family and drivers for those dumb devices. > > > > Currently this is data-only part (no commands, no beacons). Control > > interfaces will follow up shortly. > > > > Note this implementaion is neither certified, nor feature complete! > > One question below, otherwise looks plausible. (I am not entirely sure > which lists are which...) > > Thanx, Paul [skipped] > > > + > > +/* > > + * This is for hw unregistration only, as it doesn't do RCU locking > > So this list is different than the RCU-protected one, and readers > always hold locks when traversing it? > > I am not familiar with this code, so might be missing something, but > it looks to me like the same list that RCU readers traverse. If so, > need list_del_rcu() and synchronize_rcu(). On the first glance, yes. On the second glance, list_del instead of list_del_rcu should be safe as there should be now other list traversals at the same time. I'll think about it however. > > > + */ > > +void ieee802154_drop_slaves(struct ieee802154_dev *hw) > > +{ > > + struct ieee802154_priv *priv = ieee802154_to_priv(hw); > > + struct ieee802154_sub_if_data *sdata, *next; > > + > > + ASSERT_RTNL(); > > + > > + list_for_each_entry_safe(sdata, next, &priv->slaves, list) { > > + mutex_lock(&sdata->hw->slaves_mtx); > > + list_del(&sdata->list); > > + mutex_unlock(&sdata->hw->slaves_mtx); > > + > > + dev_put(sdata->hw->netdev); > > + > > + unregister_netdevice(sdata->dev); > > + } > > +} -- With best wishes Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html