@@ -390,31 +390,32 @@ static void acpi_os_map_cleanup_deferred(struct work_struct *work)
390
390
}
391
391
392
392
/* Must be called with mutex_lock(&acpi_ioremap_lock) */
393
- static bool acpi_os_drop_map_ref (struct acpi_ioremap * map , bool defer )
393
+ static void acpi_os_drop_map_ref (struct acpi_ioremap * map )
394
394
{
395
395
if (-- map -> track .refcount )
396
- return true ;
396
+ return ;
397
397
398
398
list_del_rcu (& map -> list );
399
399
400
- if (defer ) {
401
- INIT_RCU_WORK (& map -> track .rwork , acpi_os_map_cleanup_deferred );
402
- queue_rcu_work (system_wq , & map -> track .rwork );
403
- }
404
- return defer ;
405
- }
406
-
407
- static void acpi_os_map_cleanup (struct acpi_ioremap * map )
408
- {
409
- if (!map )
410
- return ;
411
-
412
- synchronize_rcu_expedited ();
413
- acpi_os_map_remove (map );
400
+ INIT_RCU_WORK (& map -> track .rwork , acpi_os_map_cleanup_deferred );
401
+ queue_rcu_work (system_wq , & map -> track .rwork );
414
402
}
415
403
416
- static void __ref __acpi_os_unmap_iomem (void __iomem * virt , acpi_size size ,
417
- bool defer )
404
+ /**
405
+ * acpi_os_unmap_iomem - Drop a memory mapping reference.
406
+ * @virt: Start of the address range to drop a reference to.
407
+ * @size: Size of the address range to drop a reference to.
408
+ *
409
+ * Look up the given virtual address range in the list of existing ACPI memory
410
+ * mappings, drop a reference to it and if there are no more active references
411
+ * to it, queue it up for later removal.
412
+ *
413
+ * During early init (when acpi_permanent_mmap has not been set yet) this
414
+ * routine simply calls __acpi_unmap_table() to get the job done. Since
415
+ * __acpi_unmap_table() is an __init function, the __ref annotation is needed
416
+ * here.
417
+ */
418
+ void __ref acpi_os_unmap_iomem (void __iomem * virt , acpi_size size )
418
419
{
419
420
struct acpi_ioremap * map ;
420
421
@@ -431,49 +432,20 @@ static void __ref __acpi_os_unmap_iomem(void __iomem *virt, acpi_size size,
431
432
WARN (true, PREFIX "%s: bad address %p\n" , __func__ , virt );
432
433
return ;
433
434
}
434
- if (acpi_os_drop_map_ref (map , defer ))
435
- map = NULL ;
435
+ acpi_os_drop_map_ref (map );
436
436
437
437
mutex_unlock (& acpi_ioremap_lock );
438
-
439
- acpi_os_map_cleanup (map );
440
- }
441
-
442
- /**
443
- * acpi_os_unmap_iomem - Drop a memory mapping reference.
444
- * @virt: Start of the address range to drop a reference to.
445
- * @size: Size of the address range to drop a reference to.
446
- *
447
- * Look up the given virtual address range in the list of existing ACPI memory
448
- * mappings, drop a reference to it and unmap it if there are no more active
449
- * references to it.
450
- *
451
- * During early init (when acpi_permanent_mmap has not been set yet) this
452
- * routine simply calls __acpi_unmap_table() to get the job done. Since
453
- * __acpi_unmap_table() is an __init function, the __ref annotation is needed
454
- * here.
455
- */
456
- void __ref acpi_os_unmap_iomem (void __iomem * virt , acpi_size size )
457
- {
458
- __acpi_os_unmap_iomem (virt , size , false);
459
438
}
460
439
EXPORT_SYMBOL_GPL (acpi_os_unmap_iomem );
461
440
462
441
/**
463
442
* acpi_os_unmap_memory - Drop a memory mapping reference.
464
443
* @virt: Start of the address range to drop a reference to.
465
444
* @size: Size of the address range to drop a reference to.
466
- *
467
- * Look up the given virtual address range in the list of existing ACPI memory
468
- * mappings, drop a reference to it and if there are no more active references
469
- * to it, queue it up for later removal.
470
- *
471
- * During early init (when acpi_permanent_mmap has not been set yet) this
472
- * routine behaves like acpi_os_unmap_iomem().
473
445
*/
474
446
void __ref acpi_os_unmap_memory (void * virt , acpi_size size )
475
447
{
476
- __acpi_os_unmap_iomem ((void __iomem * )virt , size , true );
448
+ acpi_os_unmap_iomem ((void __iomem * )virt , size );
477
449
}
478
450
EXPORT_SYMBOL_GPL (acpi_os_unmap_memory );
479
451
@@ -518,7 +490,7 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
518
490
mutex_unlock (& acpi_ioremap_lock );
519
491
return ;
520
492
}
521
- acpi_os_drop_map_ref (map , true );
493
+ acpi_os_drop_map_ref (map );
522
494
523
495
mutex_unlock (& acpi_ioremap_lock );
524
496
}
0 commit comments