Commit c854087
usb: dwc3: gadget: Improve dwc3_gadget_suspend() and dwc3_gadget_resume()
Prevent -ETIMEDOUT error on .suspend().
e.g. If gadget driver is loaded and we are connected to a USB host,
all transfers must be stopped before stopping the controller else
we will not get a clean stop i.e. dwc3_gadget_run_stop() will take
several seconds to complete and will return -ETIMEDOUT.
Handle error cases properly in dwc3_gadget_suspend().
Simplify dwc3_gadget_resume() by using the introduced helper function.
Fixes: 9f8a67b ("usb: dwc3: gadget: fix gadget suspend/resume")
Cc: stable@vger.kernel.org
Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20230503110048.30617-1-rogerq@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 94d25e9 commit c854087
1 file changed
Lines changed: 34 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2699 | 2699 | | |
2700 | 2700 | | |
2701 | 2701 | | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
2702 | 2717 | | |
2703 | 2718 | | |
2704 | 2719 | | |
| |||
2737 | 2752 | | |
2738 | 2753 | | |
2739 | 2754 | | |
2740 | | - | |
| 2755 | + | |
2741 | 2756 | | |
2742 | | - | |
2743 | | - | |
2744 | | - | |
2745 | | - | |
2746 | | - | |
2747 | | - | |
2748 | | - | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
| 2757 | + | |
| 2758 | + | |
2755 | 2759 | | |
2756 | 2760 | | |
2757 | 2761 | | |
| |||
4655 | 4659 | | |
4656 | 4660 | | |
4657 | 4661 | | |
| 4662 | + | |
4658 | 4663 | | |
4659 | 4664 | | |
4660 | 4665 | | |
4661 | 4666 | | |
4662 | | - | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
4663 | 4670 | | |
4664 | 4671 | | |
4665 | 4672 | | |
4666 | | - | |
4667 | 4673 | | |
4668 | 4674 | | |
4669 | 4675 | | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
4670 | 4687 | | |
4671 | 4688 | | |
4672 | 4689 | | |
4673 | 4690 | | |
4674 | | - | |
4675 | | - | |
4676 | 4691 | | |
4677 | 4692 | | |
4678 | 4693 | | |
4679 | | - | |
4680 | | - | |
4681 | | - | |
4682 | | - | |
4683 | | - | |
4684 | | - | |
4685 | | - | |
4686 | | - | |
4687 | | - | |
4688 | | - | |
4689 | | - | |
4690 | | - | |
4691 | | - | |
4692 | | - | |
4693 | | - | |
| 4694 | + | |
4694 | 4695 | | |
4695 | 4696 | | |
4696 | 4697 | | |
| |||
0 commit comments