Commit 2b52a4b
lan743x: fix "BUG: invalid wait context" when setting rx mode
In the net core, the struct net_device_ops -> ndo_set_rx_mode()
callback is called with the dev->addr_list_lock spinlock held.
However, this driver's ndo_set_rx_mode callback eventually calls
lan743x_dp_write(), which acquires a mutex. Mutex acquisition
may sleep, and this is not allowed when holding a spinlock.
Fix by removing the dp_lock mutex entirely. Its purpose is to
prevent concurrent accesses to the data port. No concurrent
accesses are possible, because the dev->addr_list_lock
spinlock in the core only lets through one thread at a time.
Fixes: 23f0703 ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
Link: https://lore.kernel.org/r/20201109203828.5115-1-TheSven73@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 2bae900 commit 2b52a4b
2 files changed
Lines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
678 | 677 | | |
679 | 678 | | |
680 | 679 | | |
681 | | - | |
682 | 680 | | |
683 | 681 | | |
684 | | - | |
| 682 | + | |
685 | 683 | | |
686 | 684 | | |
687 | 685 | | |
| |||
693 | 691 | | |
694 | 692 | | |
695 | 693 | | |
696 | | - | |
| 694 | + | |
697 | 695 | | |
698 | | - | |
699 | 696 | | |
700 | | - | |
701 | | - | |
702 | | - | |
| 697 | + | |
703 | 698 | | |
704 | 699 | | |
705 | 700 | | |
| |||
2735 | 2730 | | |
2736 | 2731 | | |
2737 | 2732 | | |
2738 | | - | |
2739 | 2733 | | |
2740 | 2734 | | |
2741 | 2735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | 715 | | |
719 | 716 | | |
720 | 717 | | |
| |||
0 commit comments