Commit 9b989b4
usb: renesas_usbhs: gadget: disable all eps when the driver stops
commit b8b9c974afee685789fcbb191b52d1790be3608c upstream.
A gadget driver will not disable eps immediately when ->disconnect()
is called. But, since this driver assumes all eps stop after
the ->disconnect(), unexpected behavior happens (especially in system
suspend).
So, this patch disables all eps in usbhsg_try_stop(). After disabling
eps by renesas_usbhs driver, since some functions will be called by
both a gadget and renesas_usbhs driver, renesas_usbhs driver should
protect uep->pipe. To protect uep->pipe easily, this patch adds a new
lock in struct usbhsg_uep.
Fixes: 2f98382 ("usb: renesas_usbhs: Add Renesas USBHS Gadget")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent abe87c1 commit 9b989b4
1 file changed
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
638 | 639 | | |
639 | 640 | | |
640 | 641 | | |
641 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
642 | 645 | | |
643 | | - | |
644 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
645 | 652 | | |
646 | 653 | | |
647 | 654 | | |
648 | 655 | | |
649 | 656 | | |
650 | 657 | | |
651 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
652 | 662 | | |
653 | 663 | | |
654 | 664 | | |
| |||
698 | 708 | | |
699 | 709 | | |
700 | 710 | | |
701 | | - | |
| 711 | + | |
| 712 | + | |
702 | 713 | | |
| 714 | + | |
| 715 | + | |
703 | 716 | | |
704 | 717 | | |
705 | 718 | | |
| |||
708 | 721 | | |
709 | 722 | | |
710 | 723 | | |
| 724 | + | |
711 | 725 | | |
712 | 726 | | |
713 | 727 | | |
| |||
854 | 868 | | |
855 | 869 | | |
856 | 870 | | |
857 | | - | |
| 871 | + | |
858 | 872 | | |
859 | 873 | | |
860 | | - | |
| 874 | + | |
861 | 875 | | |
862 | 876 | | |
863 | 877 | | |
| |||
889 | 903 | | |
890 | 904 | | |
891 | 905 | | |
892 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
893 | 909 | | |
894 | 910 | | |
895 | 911 | | |
| |||
1072 | 1088 | | |
1073 | 1089 | | |
1074 | 1090 | | |
| 1091 | + | |
1075 | 1092 | | |
1076 | 1093 | | |
1077 | 1094 | | |
| |||
0 commit comments