Messages in this thread | | | From | Seiji Aguchi <> | Subject | RE: efi_pstore: question about how to remove create_sysfs_entry() from a write callback. | Date | Tue, 14 Aug 2012 21:38:20 +0000 |
| |
> > Something like this (pseudo) may work: > > /* Loop until we have all entries in efivars. */ while (1) { > variable_name = kzalloc(1024, GFP_KERNEL ); > spin_lock_irqsave(&efivars->lock); > bool found = false; > while (1) { > ret = ops->get_next_variable(variable_name) > if (ret == EFI_NOT_FOUND) > break; > if (!variable_is_already_present(variable, &efivars->list) { > found = true; > break; > } > } > if (!found) { > kfree(variable_name); > break; > } > <Register in sysfs> > } >
Thanks. It seems to work. I will create a patch based on your pseudo code above.
> > If we are calling into pstore_info ops though from interrupt context, it seems we'll need to fix the immediate problem of updating the > locking throughout to be interrupt safe. >
I agree with you. It should be fixing. I will update the locking to be interrupt safe as well.
Seiji
| |