From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3452A2F94A0; Thu, 17 Jul 2025 15:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767729; cv=none; b=R/SRA6OvSXXbT0SYpJ2GV6VI020ohjDTXMi4ff4KFC3aFrtyB3PqIoRjBwrD8vzPwZ4zEtfnvJcX74C6R+EcuXx9BMszFz96A3EsQuP+wvPPaAJNRQMHJrKrfYNXKJTT6EhTvbis9iPQnrX5GvisCWm+Z2KDRAjMguoxf0hINso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767729; c=relaxed/simple; bh=kM/VMsCbqRqALzfP42If6ixC44yZMmQhjP5KVvTchFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VqMkK6bT4cDt6BAU7UfQ/UbPCltCTyK3c1xImMn2kLSvXLC71VLNFWncwRh73CLAsBvf2c+nksJWTYpl3rKSu4bjHjps6F+wshHhu/dSoXCQXx0v1tHPsuTcQ7hdztTCKCnxwKkgLZ+x7v3yH6c1zQbr5RIYEyLN90lOVjkdYVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=RTMKwOS+; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="RTMKwOS+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767725; bh=kM/VMsCbqRqALzfP42If6ixC44yZMmQhjP5KVvTchFM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RTMKwOS+nmIa5fFmKv61TQp948fB3D+opoLwJgOQGiVYiLWZb5EsIzbLCr+YyO/Hf wCOOnWlzSfMthCh2JEn/vChGAjzLP42tSP5zjrEJbfNm0JOMT5LL8TfXAoLrWOXSVy UWZQ7lx6pU4+XHG+tEojvtvge1IDO1/yZVKsE+cJj0nD1rUAa8TGfkf8cPm8sCdmoj tQTuqwGEE+IQMJ75v2TboeW2zhaHT2aDZV4CIewUbrtSRAu48WdzphbPnf0jxbXMqR 9bYhW+0z2yw+Yij78TDVrt6dEcO637q3U4327Pe6RF9H3SnOkNCDA1e60kJbsMcmZ7 rUdfA3KbJj2gA== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 4D20717E1072; Thu, 17 Jul 2025 17:55:25 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:50 +0300 Subject: [PATCH 1/9] usb: vhci-hcd: Prevent suspending virtually attached devices Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250717-vhci-hcd-suspend-fix-v1-1-2b000cd05952@collabora.com> References: <20250717-vhci-hcd-suspend-fix-v1-0-2b000cd05952@collabora.com> In-Reply-To: <20250717-vhci-hcd-suspend-fix-v1-0-2b000cd05952@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman , "Brian G. Merrell" Cc: kernel@collabora.com, Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 The VHCI platform driver aims to forbid entering system suspend when at least one of the virtual USB ports are bound to an active USB/IP connection. However, in some cases, the detection logic doesn't work reliably, i.e. when all devices attached to the virtual root hub have been already suspended, leading to a broken suspend state, with unrecoverable resume. Ensure the attached devices do not enter suspend by setting the syscore PM flag. Fixes: 04679b3489e0 ("Staging: USB/IP: add client driver") Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e70fba9f55d6a0edf3c5fde56a614dd3799406a1..762b60e10a9415e58147cde2f615045da5804a0e 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -765,6 +765,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag ctrlreq->wValue, vdev->rhport); vdev->udev = usb_get_dev(urb->dev); + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); spin_lock(&vdev->ud.lock); @@ -785,6 +786,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); vdev->udev = usb_get_dev(urb->dev); + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); goto out; -- 2.50.0