Commit 299632e
regmap: debugfs: Don't sleep while atomic for fast_io regmaps
If a regmap has "fast_io" set then its lock function uses a spinlock.
That doesn't work so well with the functions:
* regmap_cache_only_write_file()
* regmap_cache_bypass_write_file()
Both of the above functions have the pattern:
1. Lock the regmap.
2. Call:
debugfs_write_file_bool()
copy_from_user()
__might_fault()
__might_sleep()
Let's reorder things a bit so that we do all of our sleepable
functions before we grab the lock.
Fixes: d3dc543 ("regmap: debugfs: Allow writes to cache state settings")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 443a34b commit 299632e
1 file changed
Lines changed: 29 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
461 | | - | |
| 460 | + | |
462 | 461 | | |
463 | 462 | | |
464 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
465 | 467 | | |
466 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
467 | 471 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
| 484 | + | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
490 | | - | |
| 492 | + | |
491 | 493 | | |
492 | 494 | | |
493 | 495 | | |
| |||
502 | 504 | | |
503 | 505 | | |
504 | 506 | | |
505 | | - | |
506 | | - | |
| 507 | + | |
| 508 | + | |
507 | 509 | | |
508 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
509 | 514 | | |
510 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
511 | 518 | | |
512 | | - | |
513 | | - | |
514 | | - | |
| 519 | + | |
515 | 520 | | |
516 | | - | |
| 521 | + | |
517 | 522 | | |
518 | 523 | | |
519 | | - | |
| 524 | + | |
520 | 525 | | |
521 | 526 | | |
| 527 | + | |
522 | 528 | | |
523 | | - | |
524 | 529 | | |
| 530 | + | |
525 | 531 | | |
526 | | - | |
| 532 | + | |
527 | 533 | | |
528 | 534 | | |
529 | 535 | | |
| |||
0 commit comments