lkml.org 
[lkml]   [2012]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: efi_pstore: question about how to remove create_sysfs_entry() from a write callback.
Date
> 
> 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


\
 
 \ /
  Last update: 2012-08-15 00:22    [W:0.034 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site