[openib-general] SRP - order of wait_for_completion() and completion() in srp_remove_one()

Ramachandra K rkuchimanchi at silverstorm.com
Thu Aug 17 07:25:54 PDT 2006


Hi Roland,

In the following code snippet from srp_remove_one() in ib_srp.c:

    list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) {
                 class_device_unregister(&host->class_dev);
                 /*
                  * Wait for the sysfs entry to go away, so that no new
                  * target ports can be created.
                  */
                 wait_for_completion(&host->released);

Is it guaranteed that wait_for_completion() will be called before
the srp_class release function srp_release_class_dev() which signals the 
completion ?

I was wondering if it is not possible for the release function to run 
and signal the completion before we call wait_for_completion().

Regards,
Ram




More information about the general mailing list