linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/18] USB/IP VHCI suspend fix and driver cleanup
@ 2025-07-25 22:08 Cristian Ciocaltea
  2025-07-25 22:08 ` [PATCH v2 01/18] usb: vhci-hcd: Prevent suspending virtually attached devices Cristian Ciocaltea
                   ` (18 more replies)
  0 siblings, 19 replies; 26+ messages in thread
From: Cristian Ciocaltea @ 2025-07-25 22:08 UTC (permalink / raw)
  To: Valentina Manea, Shuah Khan, Hongren Zheng, Greg Kroah-Hartman,
	Brian G. Merrell
  Cc: kernel, Greg Kroah-Hartman, linux-usb, linux-kernel

The USB/IP Virtual Host Controller (VHCI) platform driver is expected to
prevent entering system suspend when at least one remote device is
attached to the virtual USB root hub.

However, in some cases, the detection logic for active USB/IP
connections doesn't seem to work reliably, e.g. when all devices
attached to the virtual hub have been already suspended.  This will
normally lead to a broken suspend state, with unrecoverable resume.

The first patch of the series provides a workaround to ensure the
virtually attached devices do not enter suspend.  Note this is currently
limited to the client side (vhci_hcd) only, since the server side
(usbip_host) doesn't implement system suspend prevention.

Additionally, during the investigation I noticed and fixed a bunch of
coding style issues, hence the subsequent patches contain all the
changes needed to make checkpatch happy for the entire driver.

IMPORTANT:

Please note commit aa7a9275ab81 ("PM: sleep: Suspend async parents after
suspending children") from v6.16-rc1 introduced a regression which
breaks the suspend cancellation and hangs the system.

A fix [1] has been already provided, which also landed soon after in
v6.16-rc7 under commit ebd6884167ea ("PM: sleep: Update power.completion
for all devices on errors").

[1] https://lore.kernel.org/all/6191258.lOV4Wx5bFT@rjwysocki.net/

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Changes in v2:
- Updated cover letter to indicate the PM core fix has landed in
  v6.16-rc7
- Also made it clear that the patch fixing up suspend prevention only
  applies to the client side (vhci_hcd), since the server side
  (usbip_host) doesn't implement this functionality
- Documented the usage of dev_pm_syscore_device() in vhci_urb_enqueue()
- Reworked most of the cleanup patches according to the feedback
  received from Greg
- Link to v1: https://lore.kernel.org/r/20250717-vhci-hcd-suspend-fix-v1-0-2b000cd05952@collabora.com

---
Cristian Ciocaltea (18):
      usb: vhci-hcd: Prevent suspending virtually attached devices
      usb: vhci-hcd: Ensure lines do not end with '('
      usb: vhci-hcd: Consistently use the braces
      usb: vhci-hcd: Avoid unnecessary use of braces
      usb: vhci-hcd: Consistently use blank lines
      usb: vhci-hcd: Drop spaces after casts
      usb: vhci-hcd: Add spaces around operators
      usb: vhci-hcd: Drop unnecessary parentheses
      usb: vhci-hcd: Fix open parenthesis alignment
      usb: vhci-hcd: Simplify NULL comparison
      usb: vhci-hcd: Simplify kzalloc usage
      usb: vhci-hcd: Use the paranthesized form of sizeof
      usb: vhci-hcd: Fix block comments
      usb: vhci-hcd: Remove ftrace-like logging
      usb: vhci-hcd: Consistently use __func__
      usb: vhci-hcd: Do not split quoted strings
      usb: vhci-hcd: Switch to dev_err_probe() in probe path
      usb: vhci-hcd: Replace pr_*() with dev_*() logging

 drivers/usb/usbip/vhci_hcd.c | 274 +++++++++++++++++++++++--------------------
 1 file changed, 146 insertions(+), 128 deletions(-)
---
base-commit: 024e09e444bd2b06aee9d1f3fe7b313c7a2df1bb
change-id: 20250714-vhci-hcd-suspend-fix-7db5c25c509d


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2025-08-29 16:33 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 22:08 [PATCH v2 00/18] USB/IP VHCI suspend fix and driver cleanup Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 01/18] usb: vhci-hcd: Prevent suspending virtually attached devices Cristian Ciocaltea
2025-07-26  6:43   ` Greg Kroah-Hartman
2025-07-26  7:06   ` Greg Kroah-Hartman
2025-07-28 10:03     ` Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 02/18] usb: vhci-hcd: Ensure lines do not end with '(' Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 03/18] usb: vhci-hcd: Consistently use the braces Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 04/18] usb: vhci-hcd: Avoid unnecessary use of braces Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 05/18] usb: vhci-hcd: Consistently use blank lines Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 06/18] usb: vhci-hcd: Drop spaces after casts Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 07/18] usb: vhci-hcd: Add spaces around operators Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 08/18] usb: vhci-hcd: Drop unnecessary parentheses Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 09/18] usb: vhci-hcd: Fix open parenthesis alignment Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 10/18] usb: vhci-hcd: Simplify NULL comparison Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 11/18] usb: vhci-hcd: Simplify kzalloc usage Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 12/18] usb: vhci-hcd: Use the paranthesized form of sizeof Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 13/18] usb: vhci-hcd: Fix block comments Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 14/18] usb: vhci-hcd: Remove ftrace-like logging Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 15/18] usb: vhci-hcd: Consistently use __func__ Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 16/18] usb: vhci-hcd: Do not split quoted strings Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 17/18] usb: vhci-hcd: Switch to dev_err_probe() in probe path Cristian Ciocaltea
2025-07-25 22:08 ` [PATCH v2 18/18] usb: vhci-hcd: Replace pr_*() with dev_*() logging Cristian Ciocaltea
2025-07-26  6:43 ` [PATCH v2 00/18] USB/IP VHCI suspend fix and driver cleanup Greg Kroah-Hartman
2025-07-28  9:41   ` Cristian Ciocaltea
2025-08-27  9:14     ` Cristian Ciocaltea
2025-08-29 16:33       ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).