From nobody Mon Oct 6 19:09:14 2025 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: quoted-printable 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..762b60e10a9415e58147cde2f61= 5045da5804a0e 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); =20 vdev->udev =3D usb_get_dev(urb->dev); + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); =20 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"); =20 vdev->udev =3D usb_get_dev(urb->dev); + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); goto out; =20 --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 1275D1F30AD; Thu, 17 Jul 2025 15:55:27 +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=1752767730; cv=none; b=WusJQaFtYIZuWzrgFs+zZpSmXEIXu3TxX2XFTfvrUtgmiFEd6jJgec7+FqyEPUqiqOl3TrgVU0M9PiWrQZNIJ50AqoRyZFZqqaDrWluizHapLDP047ekye2zkitwtwnbVGEV+cDehTGfkYX1XuITf+WLlJQ4RODrC8NBWmGG1Zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767730; c=relaxed/simple; bh=dAlBGJWzOQaxL/cJBq38h5CnyCsTBcPmMCLlpCIcODE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UtOyFXbqtXvwRYNrrhre0ZxRScb9AgQoz3K4tnv10KL2k0kEZntaNWfdUt0/c6JU6iEhCvsclH4Q5v6iOqRMNsPDOzJ/oXIqbjZr9Llp46UlnYgdL/awxGk14m+cGlrtjp7nkcJbUj+uK9AkPR21ODqcKYdP3+4UuyzJ4n07XBo= 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=OR4JW4YE; 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="OR4JW4YE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767726; bh=dAlBGJWzOQaxL/cJBq38h5CnyCsTBcPmMCLlpCIcODE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OR4JW4YES6zxJKRiCHMnZ6C3BwMnlKpODS7iW/+xFX2gr6FIm3zt184HmdmbtQ1PE rbVkW07PXGUAR/6oUEj6tWoDBclm645pG4cEXrAk1Z/S4AQQ265YTmMk7gd9LlfKjz MQaJD7UZIanH34Zw1eIO3XGtjFQ0sEDYYeCuB2T05yf7Tnyg1W5d1qoGLnEQ0jGEDQ 9Ga2IksMrnndVGlaCIgeunL6BKCJADytzMQH02kg3JgHXtoumAjqTahSF0oRDP4xAN 9Hnwn2oUSDr4KYPbLlph9rf13uxCf+sk2zC9QIv8DEQCqeksqHJwlwB0qWMGGDRaxe e0H8zCRuODQ/A== 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 2569117E128C; Thu, 17 Jul 2025 17:55:26 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:51 +0300 Subject: [PATCH 2/9] usb: vhci-hcd: Fix space, brace, alignment and line length issues 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-2-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 Perform a first round of coding style cleanup: * Add new lines after several statement blocks * Avoid line wrapping when 100-column width is not exceeded and it helps improve code readability * Ensure lines do not end with '(' * Drop superfluous spaces or empty lines * Add spaces where necessary, e.g. around operators * Add braces for single if-statements when at least one branch of the conditional requires them This helps getting rid of the following checkpatch complaints: CHECK: Lines should not end with a '(' CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement CHECK: Blank lines aren't necessary before a close brace '}' CHECK: Unnecessary parentheses around CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 127 +++++++++++++++++++++++----------------= ---- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 762b60e10a9415e58147cde2f615045da5804a0e..f58ba3b5ed50c5cc68d2180a4df= 78ab4a5f5061d 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -145,6 +145,7 @@ static void dump_port_status_diff(u32 prev_status, u32 = new_status, bool usb3) if (bit =3D=3D 1) /* USB_PORT_STAT_CONNECTION */ pr_debug(" %c%s\n", change, "USB_PORT_STAT_SPEED_5GBPS"); } + bit <<=3D 1; i++; } @@ -254,7 +255,7 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *b= uf) } } =20 - if ((hcd->state =3D=3D HC_STATE_SUSPENDED) && (changed =3D=3D 1)) + if (hcd->state =3D=3D HC_STATE_SUSPENDED && changed =3D=3D 1) usb_hcd_resume_root_hub(hcd); =20 done: @@ -267,7 +268,6 @@ static struct { struct usb_bos_descriptor bos; struct usb_ss_cap_descriptor ss_cap; } __packed usb3_bos_desc =3D { - .bos =3D { .bLength =3D USB_DT_BOS_SIZE, .bDescriptorType =3D USB_DT_BOS, @@ -289,8 +289,8 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc) memset(desc, 0, sizeof *desc); desc->bDescriptorType =3D USB_DT_SS_HUB; desc->bDescLength =3D 12; - desc->wHubCharacteristics =3D cpu_to_le16( - HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); + desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | + HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =3D VHCI_HC_PORTS; desc->u.ss.bHubHdrDecLat =3D 0x04; /* Worst case: 0.4 micro sec*/ desc->u.ss.DeviceRemovable =3D 0xffff; @@ -302,11 +302,11 @@ static inline void hub_descriptor(struct usb_hub_desc= riptor *desc) =20 memset(desc, 0, sizeof(*desc)); desc->bDescriptorType =3D USB_DT_HUB; - desc->wHubCharacteristics =3D cpu_to_le16( - HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); - + desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | + HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =3D VHCI_HC_PORTS; BUILD_BUG_ON(VHCI_HC_PORTS > USB_MAXCHILDREN); + width =3D desc->bNbrPorts / 8 + 1; desc->bDescLength =3D USB_DT_HUB_NONVAR_SIZE + 2 * width; memset(&desc->u.hs.DeviceRemovable[0], 0, width); @@ -347,8 +347,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, invalid_rhport =3D true; if (wIndex > VHCI_HC_PORTS) pr_err("invalid port number %d\n", wIndex); - } else + } else { rhport =3D wIndex - 1; + } =20 vhci_hcd =3D hcd_to_vhci_hcd(hcd); vhci =3D vhci_hcd->vhci; @@ -359,7 +360,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, if (usbip_dbg_flag_vhci_rh) { if (!invalid_rhport) memcpy(prev_port_status, vhci_hcd->port_status, - sizeof(prev_port_status)); + sizeof(prev_port_status)); } =20 switch (typeReq) { @@ -371,6 +372,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + switch (wValue) { case USB_PORT_FEAT_SUSPEND: if (hcd->speed >=3D HCD_USB3) { @@ -378,8 +380,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, "supported for USB 3.0 roothub\n"); goto error; } - usbip_dbg_vhci_rh( - " ClearPortFeature: USB_PORT_FEAT_SUSPEND\n"); + + usbip_dbg_vhci_rh(" ClearPortFeature: USB_PORT_FEAT_SUSPEND\n"); if (vhci_hcd->port_status[rhport] & USB_PORT_STAT_SUSPEND) { /* 20msec signaling */ vhci_hcd->resuming =3D 1; @@ -387,8 +389,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } break; case USB_PORT_FEAT_POWER: - usbip_dbg_vhci_rh( - " ClearPortFeature: USB_PORT_FEAT_POWER\n"); + usbip_dbg_vhci_rh(" ClearPortFeature: USB_PORT_FEAT_POWER\n"); if (hcd->speed >=3D HCD_USB3) vhci_hcd->port_status[rhport] &=3D ~USB_SS_PORT_STAT_POWER; else @@ -399,6 +400,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, wValue); if (wValue >=3D 32) goto error; + vhci_hcd->port_status[rhport] &=3D ~(1 << wValue); break; } @@ -406,15 +408,15 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, case GetHubDescriptor: usbip_dbg_vhci_rh(" GetHubDescriptor\n"); if (hcd->speed >=3D HCD_USB3 && - (wLength < USB_DT_SS_HUB_SIZE || - wValue !=3D (USB_DT_SS_HUB << 8))) { + (wLength < USB_DT_SS_HUB_SIZE || wValue !=3D (USB_DT_SS_HUB << 8))) { pr_err("Wrong hub descriptor type for USB 3.0 roothub.\n"); goto error; } + if (hcd->speed >=3D HCD_USB3) - ss_hub_descriptor((struct usb_hub_descriptor *) buf); + ss_hub_descriptor((struct usb_hub_descriptor *)buf); else - hub_descriptor((struct usb_hub_descriptor *) buf); + hub_descriptor((struct usb_hub_descriptor *)buf); break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR: if (hcd->speed < HCD_USB3) @@ -428,7 +430,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, break; case GetHubStatus: usbip_dbg_vhci_rh(" GetHubStatus\n"); - *(__le32 *) buf =3D cpu_to_le32(0); + *(__le32 *)buf =3D cpu_to_le32(0); break; case GetPortStatus: usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); @@ -464,10 +466,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 t= ypeReq, u16 wValue, VDEV_ST_NOTASSIGNED || vhci_hcd->vdev[rhport].ud.status =3D=3D VDEV_ST_USED) { - usbip_dbg_vhci_rh( - " enable rhport %d (status %u)\n", - rhport, - vhci_hcd->vdev[rhport].ud.status); + usbip_dbg_vhci_rh(" enable rhport %d (status %u)\n", + rhport, + vhci_hcd->vdev[rhport].ud.status); vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_ENABLE; } @@ -488,8 +489,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } } } - ((__le16 *) buf)[0] =3D cpu_to_le16(vhci_hcd->port_status[rhport]); - ((__le16 *) buf)[1] =3D + + ((__le16 *)buf)[0] =3D cpu_to_le16(vhci_hcd->port_status[rhport]); + ((__le16 *)buf)[1] =3D cpu_to_le16(vhci_hcd->port_status[rhport] >> 16); =20 usbip_dbg_vhci_rh(" GetPortStatus bye %x %x\n", ((u16 *)buf)[0], @@ -502,25 +504,23 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, case SetPortFeature: switch (wValue) { case USB_PORT_FEAT_LINK_STATE: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_LINK_STATE req not " "supported for USB 2.0 roothub\n"); goto error; } + /* * Since this is dummy we don't have an actual link so * there is nothing to do for the SET_LINK_STATE cmd */ break; case USB_PORT_FEAT_U1_TIMEOUT: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_U1_TIMEOUT\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_U1_TIMEOUT\n"); fallthrough; case USB_PORT_FEAT_U2_TIMEOUT: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); /* TODO: add suspend/resume support! */ if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_U1/2_TIMEOUT req not " @@ -529,8 +529,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } break; case USB_PORT_FEAT_SUSPEND: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); /* Applicable only for USB2.0 hub */ if (hcd->speed >=3D HCD_USB3) { pr_err("USB_PORT_FEAT_SUSPEND req not " @@ -546,24 +545,24 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_SUSPEND; break; case USB_PORT_FEAT_POWER: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_POWER\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_POWER\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; } + if (hcd->speed >=3D HCD_USB3) vhci_hcd->port_status[rhport] |=3D USB_SS_PORT_STAT_POWER; else vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_POWER; break; case USB_PORT_FEAT_BH_PORT_RESET: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; } + /* Applicable only for USB3.0 hub */ if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " @@ -572,12 +571,12 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, } fallthrough; case USB_PORT_FEAT_RESET: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_RESET\n"); + usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_RESET\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; } + /* if it's already enabled, disable */ if (hcd->speed >=3D HCD_USB3) { vhci_hcd->port_status[rhport] =3D 0; @@ -601,18 +600,21 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + if (wValue >=3D 32) goto error; + if (hcd->speed >=3D HCD_USB3) { if ((vhci_hcd->port_status[rhport] & USB_SS_PORT_STAT_POWER) !=3D 0) { vhci_hcd->port_status[rhport] |=3D (1 << wValue); } - } else + } else { if ((vhci_hcd->port_status[rhport] & USB_PORT_STAT_POWER) !=3D 0) { vhci_hcd->port_status[rhport] |=3D (1 << wValue); } + } } break; case GetPortErrorCount: @@ -623,7 +625,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, goto error; } /* We'll always return 0 since this is a dummy hub */ - *(__le32 *) buf =3D cpu_to_le32(0); + *(__le32 *)buf =3D cpu_to_le32(0); break; case SetHubDepth: usbip_dbg_vhci_rh(" SetHubDepth\n"); @@ -635,7 +637,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, break; default: pr_err("default hub control req: %04x v%04x i%04x l%d\n", - typeReq, wValue, wIndex, wLength); + typeReq, wValue, wIndex, wLength); error: /* "protocol stall" on error */ retval =3D -EPIPE; @@ -683,7 +685,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_de= vice *vdev) priv->vdev =3D vdev; priv->urb =3D urb; =20 - urb->hcpriv =3D (void *) priv; + urb->hcpriv =3D (void *)priv; =20 list_add_tail(&priv->list, &vdev->priv_tx); =20 @@ -705,10 +707,10 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, stru= ct urb *urb, gfp_t mem_flag pr_err("invalid port number %d\n", portnum); return -ENODEV; } - vdev =3D &vhci_hcd->vdev[portnum-1]; + vdev =3D &vhci_hcd->vdev[portnum - 1]; =20 if (!urb->transfer_buffer && !urb->num_sgs && - urb->transfer_buffer_length) { + urb->transfer_buffer_length) { dev_dbg(dev, "Null URB transfer buffer\n"); return -EINVAL; } @@ -730,6 +732,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag spin_unlock_irqrestore(&vhci->lock, flags); return -ENODEV; } + spin_unlock(&vdev->ud.lock); =20 ret =3D usb_hcd_link_urb_to_ep(hcd, urb); @@ -749,7 +752,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag struct usb_device *old; __u8 type =3D usb_pipetype(urb->pipe); struct usb_ctrlrequest *ctrlreq =3D - (struct usb_ctrlrequest *) urb->setup_packet; + (struct usb_ctrlrequest *)urb->setup_packet; =20 if (type !=3D PIPE_CONTROL || !ctrlreq) { dev_err(dev, "invalid request to devnum 0\n"); @@ -782,7 +785,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag =20 case USB_REQ_GET_DESCRIPTOR: if (ctrlreq->wValue =3D=3D cpu_to_le16(USB_DT_DEVICE << 8)) - usbip_dbg_vhci_hc( + usbip_dbg_vhci_hc(/**/ "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); =20 vdev->udev =3D usb_get_dev(urb->dev); @@ -799,7 +802,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag ret =3D -EINVAL; goto no_need_xmit; } - } =20 out: @@ -820,6 +822,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag usb_hcd_giveback_urb(hcd, urb, urb->status); local_irq_enable(); } + return ret; } =20 @@ -876,6 +879,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) struct vhci_priv *priv; struct vhci_device *vdev; unsigned long flags; + int ret; =20 spin_lock_irqsave(&vhci->lock, flags); =20 @@ -887,14 +891,10 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, stru= ct urb *urb, int status) return -EIDRM; } =20 - { - int ret =3D 0; - - ret =3D usb_hcd_check_unlink_urb(hcd, urb, status); - if (ret) { - spin_unlock_irqrestore(&vhci->lock, flags); - return ret; - } + ret =3D usb_hcd_check_unlink_urb(hcd, urb, status); + if (ret) { + spin_unlock_irqrestore(&vhci->lock, flags); + return ret; } =20 /* send unlink request here? */ @@ -957,7 +957,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) } =20 static void vhci_cleanup_unlink_list(struct vhci_device *vdev, - struct list_head *unlink_list) + struct list_head *unlink_list) { struct vhci_hcd *vhci_hcd =3D vdev_to_vhci_hcd(vdev); struct usb_hcd *hcd =3D vhci_hcd_to_hcd(vhci_hcd); @@ -1136,7 +1136,7 @@ static int hcd_name_to_id(const char *name) if (c =3D=3D NULL) return 0; =20 - ret =3D kstrtol(c+1, 10, &val); + ret =3D kstrtol(c + 1, 10, &val); if (ret < 0) return ret; =20 @@ -1213,12 +1213,14 @@ static int vhci_start(struct usb_hcd *hcd) dev_err(hcd_dev(hcd), "init attr group failed, err =3D %d\n", err); return err; } + err =3D sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group); if (err) { dev_err(hcd_dev(hcd), "create sysfs files failed, err =3D %d\n", err); vhci_finish_attr_group(); return err; } + pr_info("created sysfs %s\n", hcd_name(hcd)); } =20 @@ -1280,10 +1282,12 @@ static int vhci_bus_resume(struct usb_hcd *hcd) dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); =20 spin_lock_irqsave(&vhci->lock, flags); + if (!HCD_HW_ACCESSIBLE(hcd)) rc =3D -ESHUTDOWN; else hcd->state =3D HC_STATE_RUNNING; + spin_unlock_irqrestore(&vhci->lock, flags); =20 return rc; @@ -1297,8 +1301,8 @@ static int vhci_bus_resume(struct usb_hcd *hcd) =20 /* Change a group of bulk endpoints to support multiple stream IDs */ static int vhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint **eps, unsigned int num_eps, - unsigned int num_streams, gfp_t mem_flags) + struct usb_host_endpoint **eps, unsigned int num_eps, + unsigned int num_streams, gfp_t mem_flags) { dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n"); return 0; @@ -1306,7 +1310,7 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, st= ruct usb_device *udev, =20 /* Reverts a group of bulk endpoints back to not using stream IDs. */ static int vhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint **eps, unsigned int num_eps, + struct usb_host_endpoint **eps, unsigned int num_eps, gfp_t mem_flags) { dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n"); @@ -1356,6 +1360,7 @@ static int vhci_hcd_probe(struct platform_device *pde= v) pr_err("create primary hcd failed\n"); return -ENOMEM; } + hcd_hs->has_tt =3D 1; =20 /* @@ -1471,6 +1476,7 @@ static int vhci_hcd_resume(struct platform_device *pd= ev) hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); usb_hcd_poll_rh_status(hcd); =20 @@ -1502,6 +1508,7 @@ static void del_platform_devices(void) platform_device_unregister(vhcis[i].pdev); vhcis[i].pdev =3D NULL; } + sysfs_remove_link(&platform_bus.kobj, driver_name); } =20 --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 CB5232F94B3; Thu, 17 Jul 2025 15:55:28 +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=1752767730; cv=none; b=P6Vc+UD7BwvRl6xavCzOZYyhAM49HiHw2T6AWjlqKad/hjqT4PKJ8SqQvUHZ9LqftoaxY1bHRuCdkLRxSI82MUEt4drCDIGUjz/JxL0ofosZdJIDvYazziNtDz86WeC9N3lC6LIrGnBDLPdaDIvLqYZLhQE7nZEUUiptSfcAEI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767730; c=relaxed/simple; bh=Mq75B3YLUjtjut5Sgu7P62yPBv9viF0PjYeZ1ACiQJc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X5avNCqck1mgCYKRDqBNoYJ0u3uv7ZE2IiBZmfBi95os857FZOriXdyeMv0rQBhmwc6ql549cEhpL1N63clOj1M5SeecbTn3ZWNJhYfG5hQ2SdyYpuHXqLvjrZvdbIjGfe+z05CS1V0MaXcnPQrFNz5hg/T10N2/7gN69UbeMfA= 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=T1ETQKcH; 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="T1ETQKcH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767727; bh=Mq75B3YLUjtjut5Sgu7P62yPBv9viF0PjYeZ1ACiQJc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=T1ETQKcHD4wQrUkVFUs19SF0WfyrVvY88eQY3T874hsDDcTff+k+cVm816ZkmJTtY ywECvBkz55X9Vk00J1C7r3JNl9zjHybRYx/o9C5OIE4EkWgsgc6bMQfIRKjWVKhMVw sgxhsG2bsSB8hpqGg2f5dueMqsC9fnYGt7KavKkZkLKFbBIJKnFbhrKwZhG8db/UYV 6Yl95Z/yQ9U0o9jD9qxpvlo03B6EEEQhFHNuvoHV3XrfJE+iSfBTcLKMxQ+aSX/r4b jYTxVYjw+S8J8hOestJt2ToJty38C1TW+F+m4lfiDp4ylFyJgvSWe11x1y0J1GSFun XeWed1Qd1UvLQ== 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 E7B2F17E1319; Thu, 17 Jul 2025 17:55:26 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:52 +0300 Subject: [PATCH 3/9] usb: vhci-hcd: Simplify NULL comparison 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-3-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 Use the shorter variants as suggested by checkpatch.pl: CHECK: Comparison to NULL could be written "!c" CHECK: Comparison to NULL could be written "!vhcis" Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index f58ba3b5ed50c5cc68d2180a4df78ab4a5f5061d..7e0f11fdbf4fe919265db31768c= 3a19d27dbdd18 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1133,7 +1133,7 @@ static int hcd_name_to_id(const char *name) int ret; =20 c =3D strchr(name, '.'); - if (c =3D=3D NULL) + if (!c) return 0; =20 ret =3D kstrtol(c + 1, 10, &val); @@ -1523,7 +1523,7 @@ static int __init vhci_hcd_init(void) vhci_num_controllers =3D 1; =20 vhcis =3D kcalloc(vhci_num_controllers, sizeof(struct vhci), GFP_KERNEL); - if (vhcis =3D=3D NULL) + if (!vhcis) return -ENOMEM; =20 ret =3D platform_driver_register(&vhci_driver); --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 9CC892FA630; Thu, 17 Jul 2025 15:55:29 +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=1752767731; cv=none; b=NCQ7DTpjISQNLVCBFd+3a/o8pfhBpQS+SX3LWZoCVfUQcFuENW9S1uLyVuPZc9/PyWg2X1bg7h11z65AdxUzyIUavoyYfUMk+X23xnY7suy8jw4hqkqHcqqi5l2KMyhApqW8QtyeJjmtWmp9g20s+qd4BKnclwHW6vsUwHvZbCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767731; c=relaxed/simple; bh=iVIlGn4z/4vUIrTKnK+kS0K7mwBnCqN0jok0pyq28Yw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N0VETZbagVxTN9iFgY4WbWRIOVvAIDXv2Ywqk2cq5t9CzYH3MinibGaUYKxcb8liROyt8AsmsNAX1pC6KDMXIP2eubkwjgYGrDVzdiWxYA5oFM4yA65nVTY1/K8mZBNQKh/DA7/FYGTcqYWab7C1ZBIcu/b379jRHXoNqLrf6MY= 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=pC4bf/NF; 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="pC4bf/NF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767727; bh=iVIlGn4z/4vUIrTKnK+kS0K7mwBnCqN0jok0pyq28Yw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pC4bf/NFauqYVNJQiLxR706N/D/twO2BIYu+zf8KLOK39zl8Hst6ACZ5igxXlMV6k /I7MTD5du+SgMNjXar3eXFniliLNkKxGaNQGnV6FbZ2JTz7FbZao59vzZdY3ZiL1Oc 5vuST0XxCd1jROzYhVvezrq+HBDydsuPx105CUSimVfteUQ5Lg1m9yZnY6zqn3CUTJ J9/yfCxnx6oGRmHH3zQxTkWFg4Em7XlbzFEFC5nf5oqrEF/IizNcUZy2OA0BTvph76 IlLwlOfyzvwdsCYL2wiVORTZpKa+p7z6qUgKXHvGzzWI2RqOu/anorPbw+89+0SuYN pbNmQOGVyapSQ== 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 BA93F17E1325; Thu, 17 Jul 2025 17:55:27 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:53 +0300 Subject: [PATCH 4/9] usb: vhci-hcd: Simplify kzalloc usage 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-4-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 Use the shorter variants as suggested by checkpatch.pl: CHECK: Prefer kzalloc(sizeof(*priv)...) over kzalloc(sizeof(struct vhci_p= riv)...) CHECK: Prefer kzalloc(sizeof(*unlink)...) over kzalloc(sizeof(struct vhci= _unlink)...) This also improves further maintainability. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 7e0f11fdbf4fe919265db31768c3a19d27dbdd18..3f888455d238b983a6aafa52418= fb89a914c32b5 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -670,7 +670,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_de= vice *vdev) struct vhci_hcd *vhci_hcd =3D vdev_to_vhci_hcd(vdev); unsigned long flags; =20 - priv =3D kzalloc(sizeof(struct vhci_priv), GFP_ATOMIC); + priv =3D kzalloc(sizeof(*priv), GFP_ATOMIC); if (!priv) { usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); return; @@ -928,7 +928,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) spin_lock(&vdev->priv_lock); =20 /* setup CMD_UNLINK pdu */ - unlink =3D kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); + unlink =3D kzalloc(sizeof(*unlink), GFP_ATOMIC); if (!unlink) { spin_unlock(&vdev->priv_lock); spin_unlock_irqrestore(&vhci->lock, flags); --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 8921C2FA648; Thu, 17 Jul 2025 15:55:30 +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=1752767732; cv=none; b=U8diUwsTYsmjgPUJYf1Nay8jJ8Y9DQ3DSsB7FKh/pZCGfyyV5BkfS67lo+TjFgwSaayKXsPB0wgS0Ui656xTZvR9iHkwsh8VhrvWaJ+eMYQvsjJOrC7DOUkNtLoLYKIQY/lvthvwpN3WHfxXWz02Ur/Hb/krilpNXrdqrABOlnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767732; c=relaxed/simple; bh=2URY2vrp2VUg0fswoG7QKU1FIa8Q8yhLzv1tO9NJNAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yj48C3qkH/kUdxbHQL1b4WqIOpzGQAf4Mx2KYio7U80JBw2irHiE/b2ZsbGB1kH6EYHDf2gXZbs7Optt3vFgXyZkXrqpjp8Kik6+kcowEES/qc+wYLq+hcPqYoc7W80QD964ZgsT/Om+/dHu2aEXAvQj/T5pDUm+pwZOlpsOO38= 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=B/lh5RBE; 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="B/lh5RBE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767728; bh=2URY2vrp2VUg0fswoG7QKU1FIa8Q8yhLzv1tO9NJNAQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=B/lh5RBEiLP5WH1UEVT9t6HBvwNbbV6nYq5o6OoBBCtiqPZ6RG0fqI3jDxDBhwrzs 8TlIN2kb4YQSKpveBe7gHDBH6V9NC36YZsLj9VCTrKSCw6G1v85z1E9Wpjety6niQG p/UqwVECnvZzoJQFxlEeK8KBNeNEZTVi+NEnN2JdN8HgyELp+F75ZGf8K+kk5bOWxE Sq6cnplAHl9aTO0M1GbvCkU0VjpysxlXPNTs4nmmjmmtlNQ3ORZuHqXp8GNjfkQzMU M6jIVaLRozDMeHy+nrK3q9aOBDFEXd8fFh+iAEPFRseoBPpBHIvtX8Ge5DJlOXE49L 98wQbtunyZu1Q== 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 9A2D217E1336; Thu, 17 Jul 2025 17:55:28 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:54 +0300 Subject: [PATCH 5/9] usb: vhci-hcd: Do not split quoted strings 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-5-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 Join the split strings to make checkpatch happy and regain ability to grep for those log messages in the source code: WARNING: quoted string split across lines Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 3f888455d238b983a6aafa52418fb89a914c32b5..53691d5e77d386b0b0e16fe9d08= 824baa04c0b1e 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -376,8 +376,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, switch (wValue) { case USB_PORT_FEAT_SUSPEND: if (hcd->speed >=3D HCD_USB3) { - pr_err(" ClearPortFeature: USB_PORT_FEAT_SUSPEND req not " - "supported for USB 3.0 roothub\n"); + pr_err(" ClearPortFeature: USB_PORT_FEAT_SUSPEND req not supported for= USB 3.0 roothub\n"); goto error; } =20 @@ -506,8 +505,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_LINK_STATE: usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_LINK_STATE req not " - "supported for USB 2.0 roothub\n"); + pr_err("USB_PORT_FEAT_LINK_STATE req not supported for USB 2.0 roothub= \n"); goto error; } =20 @@ -523,8 +521,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); /* TODO: add suspend/resume support! */ if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_U1/2_TIMEOUT req not " - "supported for USB 2.0 roothub\n"); + pr_err("USB_PORT_FEAT_U1/2_TIMEOUT req not supported for USB 2.0 rooth= ub\n"); goto error; } break; @@ -532,8 +529,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); /* Applicable only for USB2.0 hub */ if (hcd->speed >=3D HCD_USB3) { - pr_err("USB_PORT_FEAT_SUSPEND req not " - "supported for USB 3.0 roothub\n"); + pr_err("USB_PORT_FEAT_SUSPEND req not supported for USB 3.0 roothub\n"= ); goto error; } =20 @@ -565,8 +561,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, =20 /* Applicable only for USB3.0 hub */ if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " - "supported for USB 2.0 roothub\n"); + pr_err("USB_PORT_FEAT_BH_PORT_RESET req not supported for USB 2.0 root= hub\n"); goto error; } fallthrough; @@ -620,8 +615,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case GetPortErrorCount: usbip_dbg_vhci_rh(" GetPortErrorCount\n"); if (hcd->speed < HCD_USB3) { - pr_err("GetPortErrorCount req not " - "supported for USB 2.0 roothub\n"); + pr_err("GetPortErrorCount req not supported for USB 2.0 roothub\n"); goto error; } /* We'll always return 0 since this is a dummy hub */ @@ -630,8 +624,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case SetHubDepth: usbip_dbg_vhci_rh(" SetHubDepth\n"); if (hcd->speed < HCD_USB3) { - pr_err("SetHubDepth req not supported for " - "USB 2.0 roothub\n"); + pr_err("SetHubDepth req not supported for USB 2.0 roothub\n"); goto error; } break; --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 69D8E2FA62F; Thu, 17 Jul 2025 15:55:31 +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=1752767733; cv=none; b=Vf6tocUEGmTVTKDZEv6ssR0+nP0RpE/DNgnp6JmI+4vKwQ6yNGmlSzZ0/tUQ/LgU4ABPEW27lsylbWW9KZ6hXXxux6GG9BiYbd8Q/zsAYYjCeAiG1hd2y6zrtAk7TyXGIMdtXV3nMXpdsolpqlf6Tj3qVjpbGORCPP5j8gmXB4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767733; c=relaxed/simple; bh=X2wpOuU+3x3c/fPBM9pR1L3oxoadnvlz/RHvJVMa6bY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eje5Tp4Q+PcAi2hG4T5Yle7Siuge4FU9RSDvQSRcg3N5zJQJl601tyc82AzqHuezwqiQ/FYgo1Kwr6i4XMTmDsMYG5Vzb9csaWmXJUmoSobj+sl1/5h/6qQzs5TiycTLCqAAEgeHSkqecSgR71nOUYaGQLvbaW/VItc6dfZ0qHw= 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=bXf3ZQ+K; 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="bXf3ZQ+K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767729; bh=X2wpOuU+3x3c/fPBM9pR1L3oxoadnvlz/RHvJVMa6bY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bXf3ZQ+KxIBLJTfjSRwhPWlKCTLMgxtv3KiarvTkR01WUob7nZE0Fp3T2xTeMyZMi gKED13HCQkxTyQNPXGGHcvArM8eFiWL8Y8uD8N0O+qW2M1WlviXwwKMwVA+j3r9Vwj 7rRX3aXPiAhCEH3fUMw/6NtFW1Fj8/CWcJu6bd613r/itEFC2nJOXUaEOWPPK68F93 D93JlqISWsVG6JjUJpyK6+eeC0atnFPp5EGXLxCuPXWmfth6qIY85qMkWFvuxXxV22 byy03JXBTNUzka3R/3ZgBjGgdnoW1xCg6kuKhXS0rLzUjvRjQ4pW8T6zaaYDZ03di1 OXjXq/Q4QqZ3w== 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 76DD717E14D6; Thu, 17 Jul 2025 17:55:29 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:55 +0300 Subject: [PATCH 6/9] usb: vhci-hcd: Fix block comments 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-6-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 Address a couple of comment formatting issues indicated by checkpatch.pl: WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 53691d5e77d386b0b0e16fe9d08824baa04c0b1e..a2a8418c77e58ae9e06d673d001= 2b972c92ee33b 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -879,7 +879,8 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) priv =3D urb->hcpriv; if (!priv) { /* URB was never linked! or will be soon given back by - * vhci_rx. */ + * vhci_rx. + */ spin_unlock_irqrestore(&vhci->lock, flags); return -EIDRM; } @@ -936,7 +937,8 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) unlink->unlink_seqnum =3D priv->seqnum; =20 /* send cmd_unlink and try to cancel the pending URB in the - * peer */ + * peer + */ list_add_tail(&unlink->list, &vdev->unlink_tx); wake_up(&vdev->waitq_tx); =20 --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 490E32FC013; Thu, 17 Jul 2025 15:55:32 +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=1752767734; cv=none; b=YsWSAztOlTlXDzdst9im+WMVuuNrPuxPbBIuugwJkHKqj8pUE68tU8CT4gKv+4iWVD8YSyYoPw/UpWEp+UzVit9Vc7lVN8/2Ciuq3uYl/cDl0gdp0N5IBjdCdOtjcH1Cn38Jmmp3zxtPMlFoednAguhgIWjUL1IDm7IrUSxPmlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767734; c=relaxed/simple; bh=RrHksrFkCg/NKrEpe92y6Svmo1I7KY/ch6FiLjn+DN8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mvgxH7Mgdk3wb8D35k+uuNtqH1bB9j32Rby1AilSmYOFSTEW6jYHP1K9lGXeKOyIod6TDYGOPiiLPvfaavjRAV7IAl9ubI8yMdezYM+dtkVo5lMTu1vBdh31ROlZ62l7g4dYRL0gtOjoBnkdkkG4u4Qrz3IC5SP66+8Gw/v+pno= 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=hSA/bLe8; 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="hSA/bLe8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767730; bh=RrHksrFkCg/NKrEpe92y6Svmo1I7KY/ch6FiLjn+DN8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hSA/bLe8DZxuEQU8M/DcpYvijG71b7Ey3e8SN1AAOp3/cikHkWksfYSjgQtu6GDiV knmCPCwMT9g9MgY2wK+/ohZU4xnzd8ldhI8G4SE2jLgfcrI79bJn2xXWga+mwOSZDx qx1Xs/R6vztQbAZ1OcjCcF9nPwMxw2fRgBx6CdZ6IUIaPWiv26tZvK5CyqjdrDZAQ3 C2tu+vQIu9N3fhpBUI1X+/sHzagwi6gpbRWKt0C9kM2I7jgJ9x9IT8qcPY6ZtY7C42 ttPiZ6S8pCSHHCMV9ewMDkF53pbtlRYzG2E7cEH9V0s2eGztJ+qyg8GPt/sj333qZl TCOJgnBYAOXrA== 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 455A617E14DC; Thu, 17 Jul 2025 17:55:30 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:56 +0300 Subject: [PATCH 7/9] usb: vhci-hcd: Use the paranthesized form of sizeof 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-7-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 Fix the sizeof usage issue reported by checkpatch.pl: WARNING: sizeof *desc should be sizeof(*desc) Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index a2a8418c77e58ae9e06d673d0012b972c92ee33b..841902482fb15d1d86525f23492= e4966f35630a0 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -286,7 +286,7 @@ static struct { static inline void ss_hub_descriptor(struct usb_hub_descriptor *desc) { - memset(desc, 0, sizeof *desc); + memset(desc, 0, sizeof(*desc)); desc->bDescriptorType =3D USB_DT_SS_HUB; desc->bDescLength =3D 12; desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 B17CE2FC3A0; Thu, 17 Jul 2025 15:55:32 +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=1752767734; cv=none; b=DeXPLwY2FKxP/fn7vFkYGQ8t3MzteCLZL4KR+u+k0JKsakfqWSmqiyX4YqHsM4ptwGtVCkw1Xh7aLnxTwzCOdN6DAZCxNwCvHKchhzA8dzJIbiJpAdHeJPKkqKsa10JyI+z8uwTTS9Fgdqx7DGThzFFSYmdjyI6qrhlI1a/fk/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767734; c=relaxed/simple; bh=yAcMEUIV0dG0+uHEGl30q+AsJo3WbPvIl4PIcWkT/sI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WCbTnFJpcdX+WalMUNkxc/aX9XCZzOleoWCOmoOhWFwfyIcO2vihy08YT9fv2uKmF4xqaaDYR/e79yIlALBiD5u4S1jjiMDzgx4GaQMv9oIcEvDOSP4Z5e0FehnkjRTC972r3L6/1XEDGkuxwUfVUgmK0fNNtCw6vzx85S//vnI= 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=DoefK9r0; 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="DoefK9r0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767731; bh=yAcMEUIV0dG0+uHEGl30q+AsJo3WbPvIl4PIcWkT/sI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DoefK9r0l+Bu6P1Vc+y9ZzTOvkzQzR0yd37KwcTHXwW0qO2kkQ+QVdB+s/tL3njg+ AFiqIr0NFX6wteuVens2Og4CRs4TBNvaATCNs8UeuTy9oqLDp9wD8YEC95HKFMNtXj vCE0Zrf0PctN8ykM9V0dnHv0d2ccJDOdQy1buY5lkYM5DwBC+eXFyOVtdZK9MTu6Rn JReAQlb+8W9xn3xLrydTgzh3i5ULG9TUQwuy3sYs1M61+Pt5LiKz8ezddNKBDuw5cQ WxRt8SIn/ky6lwa948cA346hcUococaQHnU7n+27DncKDwrm7qmS9C+j9k5iWqu8GZ T/ICEYQ2flAEg== 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 172EE17E14E7; Thu, 17 Jul 2025 17:55:31 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:57 +0300 Subject: [PATCH 8/9] usb: vhci-hcd: Consistently use __func__ 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-8-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 Replace all explicit function names in string literals with __func__ and silent several checkpatch complaints similar to the following one: WARNING: Prefer using '"%s...", __func__' to using 'vhci_start', this fun= ction's name, in a string Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 841902482fb15d1d86525f23492e4966f35630a0..95034440c84f931bdf47552b499= e0fdc6f726e59 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -160,7 +160,7 @@ void rh_port_connect(struct vhci_device *vdev, enum usb= _device_speed speed) u32 status; unsigned long flags; =20 - usbip_dbg_vhci_rh("rh_port_connect %d\n", rhport); + usbip_dbg_vhci_rh("%s %d\n", __func__, rhport); =20 spin_lock_irqsave(&vhci->lock, flags); =20 @@ -194,7 +194,7 @@ static void rh_port_disconnect(struct vhci_device *vdev) u32 status; unsigned long flags; =20 - usbip_dbg_vhci_rh("rh_port_disconnect %d\n", rhport); + usbip_dbg_vhci_rh("%s %d\n", __func__, rhport); =20 spin_lock_irqsave(&vhci->lock, flags); =20 @@ -1172,7 +1172,7 @@ static int vhci_start(struct usb_hcd *hcd) int id, rhport; int err; =20 - usbip_dbg_vhci_hc("enter vhci_start\n"); + usbip_dbg_vhci_hc("enter %s\n", __func__); =20 if (usb_hcd_is_primary_hcd(hcd)) spin_lock_init(&vhci_hcd->vhci->lock); @@ -1299,7 +1299,7 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, st= ruct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, unsigned int num_streams, gfp_t mem_flags) { - dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n"); + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__); return 0; } =20 @@ -1308,7 +1308,7 @@ static int vhci_free_streams(struct usb_hcd *hcd, str= uct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, gfp_t mem_flags) { - dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n"); + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__); return 0; } =20 --=20 2.50.0 From nobody Mon Oct 6 19:09:14 2025 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 875D82FC3C6; Thu, 17 Jul 2025 15:55:33 +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=1752767735; cv=none; b=dbmtHoBGtJaYQvUnOzfnJuyVji4Zl/A9XqYCC/HGl9XGrDEIEq6RWYyikHMnH75hqGTl40zB5Sugwhy7dj0YzrO67B7XaRiW9MqpFt11ilWifXRBDzAWuNR1HIdg9s6EV5kdpryvVZdyJCueXvWUT0G3JzbUZE/qO4FdCDY/7J0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752767735; c=relaxed/simple; bh=iIBvm4isEZ0JANWXsNBsZTwrFMEvPBpiu/OSWJ1uQnU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wk0RUtL9wC4KxaKYBWZLg1BwEXzjiNrtpymC50ECihRaknF1xyQDiOoXoeXbmiZGwACmwKBW8YZvJIa0WhMeAGkp3DtMlUkfhIN0iJPP3P9J+gqzGO6r9ZrjUOpQKSB/Rw4ojM4yK8ymx2REnmiB/nEZpWNrBDwwVzswS20xAVE= 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=Oat/WXqz; 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="Oat/WXqz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1752767732; bh=iIBvm4isEZ0JANWXsNBsZTwrFMEvPBpiu/OSWJ1uQnU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Oat/WXqzeyoWciB2mJvgxOVFO6xsfV+YT6rVBwxkz0RNEi4a0LlIDoBSFKrKknl12 Xnc07Rj4oOZ+++0YmRg0kgdtJPu2ec0RQvbAb96YCPxs3mOCbG0n+X+AyQriyks06f MIkN+cE5Zzg9uOcZHmlW1xjHH61u9a07/PR+7CqZdP8Zoxh72AzjOYMTVTy9UXIqO/ CN/TZ2ncjPssQjoGqM5snifTA9MPdCqat2V5T49A7PrsxarrbInfz6790qwJdUvejQ YpT7SeYmYq3GJU0BVg2fXlEYJO3lZTfxbaxEc/XRCuu2M59nz0HxJryZEUST8vfGiP KbB3SU9O0n+ew== 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 E34F217E1507; Thu, 17 Jul 2025 17:55:31 +0200 (CEST) From: Cristian Ciocaltea Date: Thu, 17 Jul 2025 18:54:58 +0300 Subject: [PATCH 9/9] usb: vhci-hcd: Remove ftrace-like logging 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: quoted-printable Message-Id: <20250717-vhci-hcd-suspend-fix-v1-9-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 Drop all superfluous log entries as reported by checkpatch: WARNING: Unnecessary ftrace-like logging - prefer using ftrace Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 95034440c84f931bdf47552b499e0fdc6f726e59..cb28be94de02627d01fcdab97a3= 571bca9cc0858 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1172,8 +1172,6 @@ static int vhci_start(struct usb_hcd *hcd) int id, rhport; int err; =20 - usbip_dbg_vhci_hc("enter %s\n", __func__); - if (usb_hcd_is_primary_hcd(hcd)) spin_lock_init(&vhci_hcd->vhci->lock); =20 @@ -1259,8 +1257,6 @@ static int vhci_bus_suspend(struct usb_hcd *hcd) struct vhci *vhci =3D *((void **)dev_get_platdata(hcd->self.controller)); unsigned long flags; =20 - dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); - spin_lock_irqsave(&vhci->lock, flags); hcd->state =3D HC_STATE_SUSPENDED; spin_unlock_irqrestore(&vhci->lock, flags); @@ -1274,8 +1270,6 @@ static int vhci_bus_resume(struct usb_hcd *hcd) int rc =3D 0; unsigned long flags; =20 - dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); - spin_lock_irqsave(&vhci->lock, flags); =20 if (!HCD_HW_ACCESSIBLE(hcd)) @@ -1427,8 +1421,6 @@ static int vhci_hcd_suspend(struct platform_device *p= dev, pm_message_t state) int ret =3D 0; unsigned long flags; =20 - dev_dbg(&pdev->dev, "%s\n", __func__); - hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; @@ -1466,8 +1458,6 @@ static int vhci_hcd_resume(struct platform_device *pd= ev) { struct usb_hcd *hcd; =20 - dev_dbg(&pdev->dev, "%s\n", __func__); - hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; --=20 2.50.0