From nobody Mon Oct 6 01:23:47 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 3FE95230BEE; Fri, 25 Jul 2025 22:08:21 +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=1753481303; cv=none; b=kyIGXGY4FY/JtYvwscKE46OfaPE6lFWo5QDMCSxZHAtQqT4Y4CYUvDuS6cSK12ZU0IKEXaBf5hsd4rz3mKlifrrmcGmrFzAM5tQdEnvXE4fnhI+bJMFwBLpxSeRr+ieB71NKt992ir+ahbGf3omLdtBsMxWnT1ptTKcsyj3YkxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481303; c=relaxed/simple; bh=rUdEV/3BscSaZsG+qcyIHFIShaaDu5dTVcKo5heFN8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S5LROV1kmxpRsm6aTBJXPpk134eyAR55oYqcVDHm28QMa8Nkh6btYbURYiFSMSj4S7kToZJi7Q6Pz3xeXbPR3y/3CAu/ZF+hdjS6nFbfEsvZ/H/59DWptY4DdtsMF9h+Bv9AZKggtW+5uuCHTjGSZ7mMZhbhInGT7FsfAV6m74E= 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=najVh8mJ; 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="najVh8mJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481299; bh=rUdEV/3BscSaZsG+qcyIHFIShaaDu5dTVcKo5heFN8k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=najVh8mJZUGSDn5MDFngu3Ez5JBluxoBb3ThJmejlCbMJHSo26Dv+fhaeye6ASZVz LWDOAbxhPcIXLUaPJEXkWSVN5dbqh9dyMGAgsrpEGpKv/dY2k2uFbYf/TDPiDpi7i7 FXwXmke9hj11hnHVWaSL/STKMX9gBliYSlAuSEykhxcU+AGiwTpyZMkPDqsfJh+GTb qKQ4xywm2LI12VXxPoLAwIyCiHzn+HhxFEIKa/FLMNWd/Pxvqb3MiMxtYhVHlIgcJG Ttjdv+QR4tlURlzOnWvjL+/PAwRP93vExi0LqsMAdpBAnnM+xDLHENITC4B5G4+R4S FweBT6C/BGKug== 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 3F64617E0C8C; Sat, 26 Jul 2025 00:08:19 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:03 +0300 Subject: [PATCH v2 01/18] 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: <20250726-vhci-hcd-suspend-fix-v2-1-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 virtually attached devices do not enter suspend by setting the syscore PM flag. Note this is currently limited to the client side only, since the server side doesn't implement system suspend prevention. Fixes: 04679b3489e0 ("Staging: USB/IP: add client driver") Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e70fba9f55d6a0edf3c5fde56a614dd3799406a1..b4b0ed5d64966214636b1579684= 78600e2e4178a 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -765,6 +765,17 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struc= t urb *urb, gfp_t mem_flag ctrlreq->wValue, vdev->rhport); =20 vdev->udev =3D usb_get_dev(urb->dev); + /* + * FIXME: A similar operation has been done via + * USB_REQ_GET_DESCRIPTOR handler below, which is + * supposed to always precede USB_REQ_SET_ADDRESS. + * + * It's not entirely clear if operating on a different + * usb_device instance here is a real possibility, + * otherwise this call and vdev->udev assignment above + * should be dropped. + */ + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); =20 spin_lock(&vdev->ud.lock); @@ -785,6 +796,17 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struc= t 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); + /* + * Set syscore PM flag for the virtually attached + * devices to ensure they will not enter suspend on + * the client side. + * + * Note this doesn't have any impact on the physical + * devices attached to the host system on the server + * side, hence there is no need to undo the operation + * on disconnect. + */ + dev_pm_syscore_device(&vdev->udev->dev, true); usb_put_dev(old); goto out; =20 --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 1CC1C233727; Fri, 25 Jul 2025 22:08:21 +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=1753481304; cv=none; b=J2L/2wZqt7Aa2X4W8SRtJBDz099dWJivN1GdfhQEFmujDDwzH+Rs/dEBcjpK76Ymut3HjIui3ZQDK2N1tAuuFEra0Vb4J/VtRRvEEpQm/uO0QG28J24zQAEdIT9GOvn5fhI1OXwBAXdYE6quWUZqyuWnV72PDa9wfCfjZ38OOAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481304; c=relaxed/simple; bh=KIDKVbMIjmNKsNhFukh7yRi1QC18aCvH853jRSmpofA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ikACxgXrGxkfyG5O+sx6wtR5TANmeSPXP7yt4xMab29D+V+Tc5APCYbAcdo4Gqw9t3MFaIbvXRKivcLVQaH8IKIugwWMk5d7B0liBQFFEByZpfHh2B9Uimms6pwVCmntca1rKR4thUL9x/abrQhDrrAxGttZ7WiSAh+khQIPEek= 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=KkTHft0T; 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="KkTHft0T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481300; bh=KIDKVbMIjmNKsNhFukh7yRi1QC18aCvH853jRSmpofA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KkTHft0TWVJmF7K2YFxREEQf9e2SHqxg99hTBZ2MPqZSHaZG+vrIbverOgYNp/o2Z Bae13UvkcpFyrXxkTH2CazxvCgsba68fD/PfTX2//S8vdwXYvOx2Iqnb1IPxJWt5ac Me/wTbUpOYo588luEwVMfPAbbPALrHKk7EmWbf5ck1m/hJ1Rrl1kfPIA7NWBfM9er7 FEFiyKtBqiQVacBO8TwETjO1aWMkeuX5HvFl7VrEbVeQ2bWP7W95ONoc79wVIkt1UB 5cMpbbFJDietusmyK9Ja6GO/mME0m2E5TP05c+uzGV5031LatYh5ijXFKhxFvDh0px rPyYOtRPLCaUQ== 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 0C19017E12A1; Sat, 26 Jul 2025 00:08:20 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:04 +0300 Subject: [PATCH v2 02/18] usb: vhci-hcd: Ensure lines do not end with '(' 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: <20250726-vhci-hcd-suspend-fix-v2-2-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 Format code to get rid of the checkpatch complaint: CHECK: Lines should not end with a '(' While at it, also remove the leading whitespace from the quoted strings passed as arguments to the affected functions. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 46 +++++++++++++++++-----------------------= ---- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index b4b0ed5d64966214636b157968478600e2e4178a..ec82a8dcabb90fd975e5a216c6e= 0835d2010a7b6 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -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,9 +302,8 @@ static inline void hub_descriptor(struct usb_hub_descri= ptor *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; @@ -378,8 +377,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 +386,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 @@ -464,10 +462,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; } @@ -502,8 +499,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, 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"); @@ -515,12 +511,10 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, */ 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 +523,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,8 +539,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, 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; @@ -558,8 +550,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, 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; @@ -572,8 +563,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, 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; @@ -792,7 +782,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); --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 C7EFB221703; Fri, 25 Jul 2025 22:08:22 +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=1753481304; cv=none; b=LCW5I/e+8Fb/1nyCf88GVPfTh4kBaIqje4j7pNRozmcX48ow7RpZX8LZ5IfXHoFcsa6hvjXh5RiE6hOgVIL4yAG8x5bVel/312cp9y2TKTSyghN7OnWIdL7yKfPrrAvOYDVrBb+n3AfOZA/I+IYhy8vjUWekYIXef/mLoNI1lfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481304; c=relaxed/simple; bh=Y4TJVkfkRTXKcJwkJcS+G3Yye3rX4fOXCfZPRoeos+c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U4t9LJpD/VYsZVwP3vakIB08CKQGr0TzZmRwyLgqf2nJBO0ton/Eg+/0Y96hhFIarQ5NifwFfvHj6nZRIgQ5+ykZ96NbyzWsxAH2t/eX465T0+Hb4edei/RCdQJOe0TtFDO2vjMFPu7AbNXy35mRhdejf7QPN3CeQoSh8dSwz0w= 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=UX1LbHVI; 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="UX1LbHVI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481301; bh=Y4TJVkfkRTXKcJwkJcS+G3Yye3rX4fOXCfZPRoeos+c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UX1LbHVIDlXU7af4N5Xoc0ekEtC/lwm/oodPMpAFJw0q7O5M2XKQeg96AdOKZ3PmS UdOj8cipVeCgD2NLi1wtcyr7ulA650XousH1aa6OL/Vh/BqwMs3TstF0oVYKfzuBel qu/Ccv8baIT3eO+qsSj3XC+JXoZ7WLCxeUNGMICsw3d3pZmnR4fYQ0FGBUj3OCOCH0 RWQJUmxYoW3bsrUfg45p0cEIofo7lImqz1UUsv1vYTuOySFxBJ37HikD71QrVJqhfN d8yS71ES1a/RCYCYtBkcvuqGHhk7el+rXBfWth5oJp8KRs0G8Eps9eoIBNM4UbdEsr KCfnZYdsO77kg== 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 CDD5217E1314; Sat, 26 Jul 2025 00:08:20 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:05 +0300 Subject: [PATCH v2 03/18] usb: vhci-hcd: Consistently use the braces 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: <20250726-vhci-hcd-suspend-fix-v2-3-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 inconsistent usage of braces as reported by checkpatch: CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement 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 ec82a8dcabb90fd975e5a216c6e0835d2010a7b6..dfdd6ae2cf95c7d5a24d97f713d= 86588c2dab350 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -346,8 +346,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; @@ -598,11 +599,12 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, 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: --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 8C9C225A620; Fri, 25 Jul 2025 22:08:23 +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=1753481305; cv=none; b=fMqxJJ/BuTarjg9xHBns68MTX5hPmD9n8cZ9XhvfjgBJPnIyLLSjwc5gHsguPqQicr8IcQ5wG7Z3wxtdnPbL1iWmgiXp0cBk6eHvQ0hfSSaPpWzxELjFK65Q6XTuQX7AHyCXjvE0DGw9IkzsQ2DmxOthzHTu3uij58KAPsSJeXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481305; c=relaxed/simple; bh=KOj+eyujRFeFtivf7jk0L85lyc1oGzmXW8wKBy4jGDM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N5L6Bg1VM+angUDQhkOxSvmvY0pHOzyAA7XDBnj5H23s96ArQQiroPSu2er/HkXcXLtJcRodzzxKExYjTuodzJDCl3Ynf05ISy90VZH2Hz7Jp8JQhUvb75uuHB3XKv1eKPIwiJGZt/TKo74OgFXyofJVw4ccYUGnHeCxZJR851M= 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=jPHjxce3; 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="jPHjxce3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481301; bh=KOj+eyujRFeFtivf7jk0L85lyc1oGzmXW8wKBy4jGDM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jPHjxce3npd5xnHdkz3C4QDZTc60arrhq0j9fg+m+fvrOnKcmqbAuo5QbEjc47rn7 LnJcQZtYzodBp0Y435QFOHG/tEWBqn4jzerS8TGXUjyuUnl/Wvt8qP0BBzWqd112n/ lu/YqLPXRwccdUIsjy9XA+tn21n573rhJcR8j5oJzXM8tx7Tn6MH3l58CoOBTB01IJ PUvCxuAbpIV2mLSSOefa1MMazN6vMBdmwMOV+lDacNDM2J+KX2Rcx/Wy12D6rLVmWL 2efbzuUL+43OdnrgVe1WSSkcrCCJwEUasq2m4JfHHsNzB+HyjwzWpu4oC1qE9KckQd c4Qe5/MNxMCCg== 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 AE2D017E131B; Sat, 26 Jul 2025 00:08:21 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:06 +0300 Subject: [PATCH v2 04/18] usb: vhci-hcd: Avoid unnecessary use of braces 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: <20250726-vhci-hcd-suspend-fix-v2-4-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 Improve code readability in vhci_urb_dequeue() by getting rid of a pair of braces and reduce the indentation level of the related code block. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index dfdd6ae2cf95c7d5a24d97f713d86588c2dab350..cace9bbbd528602703869cf955f= 93b311fddd045 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -888,6 +888,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 @@ -899,14 +900,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? */ --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 B2EE325F784; Fri, 25 Jul 2025 22:08:24 +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=1753481306; cv=none; b=YAIJkFi9W3ZEX20xJ+SdojzJ+3YwOUP+LNOBrlbEAjWOTnmACdOVRZWpgUrq8m0w+og5ib8s3oWNMii7UZpyr5C/uPkb26Vy2HqslgQ5jDvj6+tzFsK68j7SSWFKfMz7YjFzbSrpPpxBnyZosm0cNITKQTkU8fbLshzOW3MAK5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481306; c=relaxed/simple; bh=ceeGJ8INo1YLVGOsGFHsCuJY/T33PhKEQyNnPbdXE+k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IJulv27c1x5E9PN0bVdXh41kZXmsgAEvPgtlkJzZx1sVFxUCKGPGKb9/YqR078r1r4sGCnGUEcK+et5ztwqc3K4qNgYoJKvV2m7X2XucW4ZwPaCKAVRw/HsKR9AXvrwCvDWjmspGmRBfSNv5pRnrVLSz+ITDqWJ78+UK19SoPYo= 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=NEuanHl/; 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="NEuanHl/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481302; bh=ceeGJ8INo1YLVGOsGFHsCuJY/T33PhKEQyNnPbdXE+k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NEuanHl/mPfJX+/h8vzEldp5fihgJyOQknUUvaDnv/4aLTZ9mgP0tUzhbyAwiWQk+ C0fgQbkslnPSxwisUw6kGqTKJ0fdn1PLm8xPgYMx7lME43qu2Lmt5Q6S3xxMmGyU5N WHLUoi8W3fviuTmXuIMXHHOYOlvYoJkB9OKVzH60wntT/dPuv6nktTfSgn56X/N/uN VTbvUgC9+neAQ12s8mIO4ZnT5/8ImKplRYfKit5nBPFcTVP1pmWPvT+mwXzTJlABqZ 5644Q1GZkfVJ/MX+GWW72srYbE5pL7/MHz6RGROVP0gCLOCtUq9Ef0fFygBlCBeEu0 8wHNn6Kuy9o+w== 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 85F2A17E1324; Sat, 26 Jul 2025 00:08:22 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:07 +0300 Subject: [PATCH v2 05/18] usb: vhci-hcd: Consistently use blank lines 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: <20250726-vhci-hcd-suspend-fix-v2-5-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 Add blank lines where it helps improve code readability and drop those which are really not required, as indicated by checkpatch: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index cace9bbbd528602703869cf955f93b311fddd045..c739107a3e0411ba2e8227ea6db= 46802b4882177 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++; } @@ -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, @@ -306,6 +306,7 @@ static inline void hub_descriptor(struct usb_hub_descri= ptor *desc) 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); @@ -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) { @@ -398,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; } @@ -410,6 +413,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, 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); else @@ -506,6 +510,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, "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 @@ -545,6 +550,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; } + if (hcd->speed >=3D HCD_USB3) vhci_hcd->port_status[rhport] |=3D USB_SS_PORT_STAT_POWER; else @@ -556,6 +562,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; } + /* Applicable only for USB3.0 hub */ if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " @@ -569,6 +576,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; } + /* if it's already enabled, disable */ if (hcd->speed >=3D HCD_USB3) { vhci_hcd->port_status[rhport] =3D 0; @@ -592,8 +600,10 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 t= ypeReq, 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) { @@ -722,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); @@ -811,7 +822,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: @@ -832,6 +842,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 @@ -1222,12 +1233,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 @@ -1289,10 +1302,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; @@ -1365,6 +1380,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 /* @@ -1480,6 +1496,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 @@ -1511,6 +1528,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 01:23:47 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 3FD5D25FA1D; Fri, 25 Jul 2025 22:08:24 +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=1753481307; cv=none; b=PDYljLCbomi62rAXQFIIAIy/4srUAJbLLX0pjMgutcP7OEwpTpee/O4CvNLPyjhvN9oWmAxFkYy9EAq/EYXI+o9WfCNNGBxz5/FscPa+ww0ODLAaiaiocHkaXHNkm4bp2Qe8iU8fwlbrpj9gLSGdH54TDruu16VmdZuI7eprkjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481307; c=relaxed/simple; bh=3Lld/ZdX6oD4wzXwjGI+1Lt0L30PGu/6rMJnkGfvWI8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qFeqRAoDalgy6HbAOI9VsxPSIarna1CoQsYhAuDLNj/2AuGC9nAXC8eSTfraGgaVl2LO4t1zIJ8DSaaHxmEh29nsopMCOOnSPrOaCZaj/KlqQWVMsNZo+JNVk43vFmZadF56BinvJc/yirE0/n3spkcl6L0/11oUtWMQ8olRzdc= 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=Qq+qyJNU; 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="Qq+qyJNU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481303; bh=3Lld/ZdX6oD4wzXwjGI+1Lt0L30PGu/6rMJnkGfvWI8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Qq+qyJNUql4oeKo8iomQ6W9BmRqLfRQXbff+bMYdNC1gN/ZFpkYmCYvI36KPTmEDd QrGGok/azPDY1VcXo28vrFcgeBHwd5PMjZpEUtorOFs9cqely3d96jRWRAsEMnmkGK b4WlHpMwv3JiO/J2uQcWtsLfpeAhbxOs/+hhhIk8pshvSln+HsUwsiCvGuw67Sfsr2 1JQTAaeyBAYY0oZtRDF/2iZPcT4mTgoJpo0ANLS7mBxWXDHI8QepTC2Y888JpYCzpm oy+L7AxHiQN8eLYerfwNDARZ6RqFcQqIFdwEaDArEhsJaNNc8Nz97zxHPFQwyvI+wk rMLsJSLFfGEsw== 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 5B6B317E1325; Sat, 26 Jul 2025 00:08:23 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:08 +0300 Subject: [PATCH v2 06/18] usb: vhci-hcd: Drop spaces after casts 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: <20250726-vhci-hcd-suspend-fix-v2-6-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 a bunch of checkpatch reports: CHECK: No space is necessary after a cast Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index c739107a3e0411ba2e8227ea6db46802b4882177..5b2d4a57dddf06fcbb8ce8e3930= 6d1b5c4b23b38 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -415,9 +415,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 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) @@ -431,7 +431,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); @@ -490,8 +490,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], @@ -625,7 +626,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"); @@ -685,7 +686,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 @@ -752,7 +753,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"); --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 1543B26981C; Fri, 25 Jul 2025 22:08:25 +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=1753481307; cv=none; b=LfbyTVYYme47hLkGwhZOgVL+BdJlsfjp6m2hoITyRiiZ04yB7ZyPah6Xh/1sv8xq7FKCcaUjAb5oUot4HD4kJWGl1kFUv2gu7EAXHVvyIES7jpEdbZEbV8C7Cye+XU0UHbf6qCr2rwDB7VZPSJ3IZnzwukaW3yEw1bRgLo1TCc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481307; c=relaxed/simple; bh=rKl3rOq2XsEfoE3cv9HLp3sfTuNANK4XSlbH+fM1i3o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZfFlanbshXuq9yfPNpUaAL/W1gsWpe9zaM5I9RZtRmuV5IhKUEtyRwXyHDrTDqRDCAtancOuUW/isF7qqnhdTajE39qCyUwc/6Fd2hciCOoZ926LzPHdBDQkNwEPyZdLLV8fJxVTgYk4LKltUh+N0n7dIZwrwTTw3hxr821Bys4= 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=eIg3snxN; 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="eIg3snxN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481304; bh=rKl3rOq2XsEfoE3cv9HLp3sfTuNANK4XSlbH+fM1i3o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eIg3snxNaNhSgPAf1BC2SX+XAhZ4iNX9JSdPj1AOA56P6eROgMUjZ4xgp3pmOrvEN m56ol+050Ri8ne1Z7FGdZY4OQfsIKPgL6xtg4jjS7Mcyqx0kI7W/wFi3ig5QmR0Qnq lKHGldS+I5XTh4d6webqpXMCHXivNirkeeYOSCADlrsxpdnBu3Ky21VOxc5cl+OK1s yzOayab80xW/6Uo6Ri3w1oOP4dgi+94Frt3r59wQfGjMZh8FECJZn4SV1Gd5Wvyabw 6I8pEOpBhgJTF348rv+Lt05n0jweGt+wzAqOyrTFyqFrddqDqxcoJvJcYn4F551+Ht Z3Xmx8z7IOJ6w== 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 3A57C17E1336; Sat, 26 Jul 2025 00:08:24 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:09 +0300 Subject: [PATCH v2 07/18] usb: vhci-hcd: Add spaces around operators 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: <20250726-vhci-hcd-suspend-fix-v2-7-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 a couple of checkpatch reports: 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 | 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 5b2d4a57dddf06fcbb8ce8e39306d1b5c4b23b38..00729ff76206905fafc263422c3= ad4bcc28ba774 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -708,7 +708,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= 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) { @@ -1157,7 +1157,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 --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 AA816269D11; Fri, 25 Jul 2025 22:08: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=1753481308; cv=none; b=XLO9x8ZjAaAOXX/Ij15gSCgIlFaYq0ohYbWARovPMaU87P1ChmT3FXnrrvZl5nal4IN8AZSXI7lvGLkmVkdLd8XhJBJeqtn9JNQ9QQ7vWd6cgOyO34dDIQ5S4NcM3fAZD7qsVL5OZ8XzrONzHI8eElfGJ/LTzXmh6gCvQfuqnSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481308; c=relaxed/simple; bh=VJ50li0AH58SWukwXrrIDXxeP9yPYrEW27D+aiR7rEo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tmp5GS4dr1OubQUhNWzpwpINtJd5riyRKgiHEw4JEY5eleDeGB42MSAOWQ4mthpm95xAhyeg/I118CgWJhUEqxRQYF80KqnXfRY5JD07/IsT401rkLSRMF1I7uTXmEp7MSYLM8A6ApwaPISfABJbNSqg1bsQcJkrO1bmATers9U= 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=D3msxMRH; 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="D3msxMRH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481305; bh=VJ50li0AH58SWukwXrrIDXxeP9yPYrEW27D+aiR7rEo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=D3msxMRH3P7ibTeBxs5mcxGh4r80AfP1U9Ud7/5iU1D75wPi/LLiCGtiCfOWW/egx EagmEnjgnTFNZmzFEVqQGLe2T0/D3T6ljPxAN/8TWUUjC06qyPO8DnF8rDBjdi9QPg n188hMHaPumC5xWRB5ZDSnButtv4ow0S/poPjT5qie3ODLGcay/UvWIpLehgNYhSrU dX6lrUEcDDvuxK1pgubK2kw/xZB3ZtN5lY2SrUpArqCnAd61AKabYDvc2E4yi4IsJG geUHndjBvB23FszYdKPSeoNicyLMVggLpHQ5N0yZsr3REMev4QThXMZ7bAMraphRsT lOAn8tJCWHQKA== 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 1327417E14D6; Sat, 26 Jul 2025 00:08:25 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:10 +0300 Subject: [PATCH v2 08/18] usb: vhci-hcd: Drop unnecessary parentheses 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: <20250726-vhci-hcd-suspend-fix-v2-8-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 a checkpatch complaint: CHECK: Unnecessary parentheses around 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 00729ff76206905fafc263422c3ad4bcc28ba774..d74bfde1f71c50f2f4e7b69dfaf= 7687619e8c310 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -255,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: --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 ACBDC26AABD; Fri, 25 Jul 2025 22:08: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=1753481309; cv=none; b=mHskv7muvfASE0zrBwhheykh4XhY5OZsF2DJ6SWaG0zh6HB1kwVUfR5Ty2y3vPVz0I/3pr29UXbV4nM4HNYYfNDxYKs1KniCGuIolMCOF8svV5qwUQc0fKOI9pjC55xFNwoBEOrtOFHIa3Tj1S4IKIPi0lTGsAJKs+ZkW27IFzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481309; c=relaxed/simple; bh=mS1vPmHlBcEA3tG8hdyev2j06crtXOGFlAAclm8afF8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n0SzcokId4dMdy/vgr2D+UCMjMLnuNoZizFf5hhPt1A0Jzf7scyJvZmX3AKuqa8GE5QCUbG64+AKMWuXLM4GmV7Y4uNpsu8ISJlXziPC2NF/E7/KqDTcQR+1iD47r9iPCyCpePsstDxThOtOcL6hxRvvZpJE3qX+Wh6JJgrRBZY= 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=IXuWfXuF; 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="IXuWfXuF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481306; bh=mS1vPmHlBcEA3tG8hdyev2j06crtXOGFlAAclm8afF8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IXuWfXuFL4SgBWYpmOPvHjclkv1Mb8H7v2EcSAJbjSnLtbh3ibBTGAUlBQSu8YyDG 9KqjtiXGEglXz0/TjlN047/iLnFZizxVH61unCqiedTgIMPKGSOR2WIEos1xqLjS7D eUOqJSVTdo+5mlQFz52CVx17JQRv6xNbsjnoFQPdEZt5RKe1uUCVDanhJDyMXOK9qS T5+Izrq639E6ZanYG/jibClBFDc1CkDw8GnK8xIAgm68xYN7zWQYAbcuuh6pDHm+rj PCuYyZKbeSTQO8FpOTdzwtM3JPQz9YCs6w1ECXRygpZLsHkLhe2JL66+DSD1r5hQo0 0OjbQ0kKL/0Yg== 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 D060817E14DC; Sat, 26 Jul 2025 00:08:25 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:11 +0300 Subject: [PATCH v2 09/18] usb: vhci-hcd: Fix open parenthesis alignment 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: <20250726-vhci-hcd-suspend-fix-v2-9-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 bunch of checkpatch complaints: CHECK: Alignment should match open parenthesis Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index d74bfde1f71c50f2f4e7b69dfaf7687619e8c310..15e1613f4d196e0172131ac722e= 62c5c579c6346 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -360,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) { @@ -408,8 +408,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, 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; } @@ -711,7 +710,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag 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; } @@ -978,7 +977,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); @@ -1322,8 +1321,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; @@ -1331,8 +1330,8 @@ 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, - gfp_t mem_flags) + 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"); return 0; --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 AEC0D26B76A; Fri, 25 Jul 2025 22:08: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=1753481310; cv=none; b=f0C15xeF+p7JGUHzbK1yWHf8eQ5cMlI2GtGV+HZ//J62mqZ6mgxnxjR+XxDtv41WAq0v7BHjlviCJsMrMdRJzsNbmG962kTU7+mOxAZ6bsBBtCe+dw+yx5cS700cuZ6yMQNlvonFwOnsX3g7peuuYC7EyLf+IrlxR4rdzGH2TAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481310; c=relaxed/simple; bh=BTiZt0A3QcfiED5Ytviafe/ndXfvYdnp38ZNGVjYV/Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SCOe/pBaCTgMuGFC/XLvk8GLZeNubG230Zj+zKfcHTEuYVRo3d5c/Jss15SmCq6EEQsSRh9sWJZ14BRhYanUQcLrjfzcIt2KyEhQwLSr+Fyt/d4THC339Nj+QJPLr6ueshEZUjl/469TQ7UoxRm1eQJJPD9hqM8dor8yXkDEcyg= 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=NJWZQRr2; 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="NJWZQRr2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481306; bh=BTiZt0A3QcfiED5Ytviafe/ndXfvYdnp38ZNGVjYV/Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NJWZQRr2QWrip00HWvntGMvMYJRL8qOKDmc7B2G64voL/Xb2t8AYfOkp+2sE0CqPc ChS6cxgoXJM/w5w7GhKkNzzl8sxmGwh8MgAJxtNhK74DUDBatW6GBduKpzbbr+nXYK WK3fL07lyN/NWWwNdrytvWxLy10mcJsBTeV1jt8dnbrdzfukZyHyaV4aRz55L/V+ua TsdmfP7wxjark+qMwPBr0h9Sp4P33qtJOW2GA2j3xeETo0GmCwfTnkUTlafngwgaNB W/SfxPxiADjoMckJdlcc6v2R+KimxtK++IhJSNDuLjhod/vCTRjkQVNFe6dYCx3KBa 8YWNAMEnOoHjA== 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 AC4B517E14E7; Sat, 26 Jul 2025 00:08:26 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:12 +0300 Subject: [PATCH v2 10/18] 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: <20250726-vhci-hcd-suspend-fix-v2-10-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 15e1613f4d196e0172131ac722e62c5c579c6346..cda42ca492897e4ebf0055a3179= 16874cab94ad6 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1153,7 +1153,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); @@ -1543,7 +1543,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 01:23:47 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 79AF126A0AF; Fri, 25 Jul 2025 22:08: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=1753481311; cv=none; b=My51cJMIrSUsqbt+b6J5ypCLBy3Nw4+M+pfn4125Ly9BJjOdiszil/wsl9hV64uBNfIiK9almSkeC1X+GaCs5CRwNSwRY6QX9jEYAXlHFZmZkUu/2Y9UlcB4+XEj8KiHxd1iPSULEs4YrAWdI9t3Dz6HprUH4HUg2+Y7B8T0guM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481311; c=relaxed/simple; bh=b8rhHUt6ZqRiawu90SB1XnIW5xwZlN+mO4kLgoqwxjE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j6i34Ux9FcLgpAFdepPMWOV2cxV2xZQBQndZ4aDhlmkfjOjpSKZLQlD9NllasIssbNHRrGiUBX53RMYxm54wLSnAOmUnqko/aP67oibVvlIr3N/b0bmclz0FGouNPaXvKQm/P5ZNtJ9akr2paBf2cRzm1BcpYD4OWKH0tYqsr2o= 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=W/zHl5e+; 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="W/zHl5e+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481307; bh=b8rhHUt6ZqRiawu90SB1XnIW5xwZlN+mO4kLgoqwxjE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=W/zHl5e+tEz/GEEdWPbUi8VxIfQHbvyPU7+3lQKQLqP08gwN0sx8YOzOpjXcYr0sJ GmQH2j5lf1ivw0ZioeB9KINx1YkuI0nq3BgTFSQdxSDaXVFXJLsx1RFwHOhyzn2UKU GhD8kvc0wqXCOpwhz3f0r7jIiPSv+8KjrWY8L2mvEHq7suHHF9FOWFOl1D86JwJDoL z623pV4O/votfdvAVqpKwxMqwwcxJSNiKITv7OIjs6mtzMKwUALIDdIbWSJPuh9oaz cMs+m4x47aM7Ogb3RUDCBuWZN5+dvW8DL9EJqiwYyobPTOBatfWCxzOrlKhWF68zal KzA07ogPmFKPg== 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 A0A6017E14FE; Sat, 26 Jul 2025 00:08:27 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:13 +0300 Subject: [PATCH v2 11/18] 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: <20250726-vhci-hcd-suspend-fix-v2-11-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 cda42ca492897e4ebf0055a317916874cab94ad6..34ce2d70cfca6ba7fd3003b8780= 36c8eb332eb81 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; @@ -948,7 +948,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 01:23:47 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 4110826D4D0; Fri, 25 Jul 2025 22:08: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=1753481312; cv=none; b=ltIISZiMmJHiFNlVbvAbawBmdRNU2/ZgOrzc34gzLq5Nxb83i4L1deLSVOL8fhxjQb0U7pgKO+T50tj46mKhpmuL9lZ1SOvLF/Q98ytC8k+Mz4g7JP+gOIDWbFaTu8vSleT2iyF8M5VbiK2qwm+YCgc0nEvX2MELoBbroHL1ujg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481312; c=relaxed/simple; bh=NnjK2MqU5nffK8egqTxIMASgUTDHt8S5nHUSvK3y1Kk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YdKoEH5/mOHXIR/fxonQnUkRBJyq4jrJ80C+s1iAVbys/ZkV89rPz63PpjwuQiH2M+Y3F25ofl/mfWGOoSsNPleqhqm5mbKCwKAGGkt2h+yU2lYxolgTmz/xb8e2hszrJaoWuZt1seiIDwNtzrthlFPnEwY1S3rPpg8wTaz2KWY= 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=ZXsQ6pAp; 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="ZXsQ6pAp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481308; bh=NnjK2MqU5nffK8egqTxIMASgUTDHt8S5nHUSvK3y1Kk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZXsQ6pApIGk7oYMoIKxlR28SO9u2Gebu0bgbjhQfO3CRPzZdGRx/XrrPlYPBnOKqW Jh3XPK8LSCUIxkZnNcilUYSPoppMXAd5QkUGt6WqbfH07PlYSBUGB+ACFthGPkDgJW KaEwznNZTn+55lvRuAoUbt3BmdxDgKl65XF8m9UoMBMwr/QyeKqGNqHTaIH+Fux1Qs /MI71M1igz9ll09Du8F3SUX+gPr0nTQml1bLWhLWzoY8dk5D0Lhl5nhLWhRmHlWash bon/rP1rEBPteQGhrJHdSPGjGpmyysv/laWlAha6SWC/JdP7XdEMRlamSi5a7ueYi+ SbI4vu0b8wVdA== 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 79F2617E1522; Sat, 26 Jul 2025 00:08:28 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:14 +0300 Subject: [PATCH v2 12/18] 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: <20250726-vhci-hcd-suspend-fix-v2-12-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 34ce2d70cfca6ba7fd3003b878036c8eb332eb81..96afb4242bf8bb7e9334d8dab08= eb77cbcf24924 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 01:23:47 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 EFC4C26E14D; Fri, 25 Jul 2025 22:08: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=1753481312; cv=none; b=UOzKl+3EYSLe083NPUyChyv52ydmXC1DCsz0Lr37a6u5uIGvZEHud2sgVffvZkd73PIICuuuer1Fw+Ofb8rJLqlmz3xCXsWqVxpYtbt+YEENrwvI8+MyNFJDkTM3P7lamsH5hyk2c28AkTpE7GYY53KF5eGPcXy4Na8xqCVIW4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481312; c=relaxed/simple; bh=/Ou+oa1iey0BvgnSouquG4mH7pnreZatXkUrThwjDoU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gGBN33pBbe9YABnmazodCDNtjdKIhcPqOoE4PtqIp0Ue6/WumGEziyEsWmWbcrOxCXsO4A0JhqhKPAeRUWln9QarIJgEEVu9lkxj6TOilRYFVc83OMcCCI3/ZOOdzALyJ5dwesl2DU41vMh2bBF/bg2PLTJICzXl+FTpiBrH5ww= 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=eAvMJj4q; 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="eAvMJj4q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481309; bh=/Ou+oa1iey0BvgnSouquG4mH7pnreZatXkUrThwjDoU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eAvMJj4q93R9yT81KSxfuqkKjVOEp/O0ltwFZQG6TR4NmH4yBm0oXYcaxdjUyyeJ+ NTVjXfv8Ktc4LCvZL+BEw2isoWb0kYk17IUPLB9TwxcDbUUuQkg/WRR5yc1tJZMz7k wG/nbJ5MrZyIjduXMxE4VUGo2jx3soSkV4u+11TO8r+BixW84acJw1rkyT85Ijenj8 jwZqV2al4h6iJs4hV9qQKSyY/79Skn0YR8lZhS4BErTOxvRidMmYkSvr0czY9n9W1q N1Kj4nuQmRhCLtkZuE8tWEpfHHwHGLX3M1LcNCzcrrzyEopNQ+alx9ghHT+fRZTmsA 48f9NFWHFAg8g== 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 535A817E1540; Sat, 26 Jul 2025 00:08:29 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:15 +0300 Subject: [PATCH v2 13/18] 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: <20250726-vhci-hcd-suspend-fix-v2-13-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 96afb4242bf8bb7e9334d8dab08eb77cbcf24924..0a552cf93be5d55409e2cffabce= 4c7a68e1360c4 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -905,8 +905,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 priv =3D urb->hcpriv; if (!priv) { - /* URB was never linked! or will be soon given back by - * vhci_rx. */ + /* URB was never linked! or will be soon given back by vhci_rx */ spin_unlock_irqrestore(&vhci->lock, flags); return -EIDRM; } @@ -962,8 +961,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 unlink->unlink_seqnum =3D priv->seqnum; =20 - /* send cmd_unlink and try to cancel the pending URB in the - * peer */ + /* Send cmd_unlink and try to cancel the pending URB in the peer */ list_add_tail(&unlink->list, &vdev->unlink_tx); wake_up(&vdev->waitq_tx); =20 --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 E2B0D26F44D; Fri, 25 Jul 2025 22:08: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=1753481313; cv=none; b=rivbdmTCmDD6z5vOtyJ7bW8NIkZ/+R4gXdD83PqaZP9O7BLzn1LawU3j47JnKRaW1yDiFQQs5fAH38+jEuQmS1ykxS6t0EqmutmxX549B12dNpCqUDixS8SMrQaF0ajDiACT/OQ8c3+fhGXpkypdO8dhzoxeEuxC9ypq2dZlfSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481313; c=relaxed/simple; bh=jBm6bfBaZCWVHi9mKVYcuIFQ5VRypBtpWf4Hy86neuw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PCxKiOq8+w1vjkt3pDqqzF3epOwcZB+25O4DkF7xE4kYd0LKW3jCSKHbvJYQKEG72v3VpAL/IvJEfqNMNh2pQ9SW/qW/ZJij0pfDX7lvLnk40upa2X3gBtWeXRJJwK06pUB/TOWvg04DD0GtN6REd4MsldooBapF/ilBCFiCbXo= 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=EDom1ztz; 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="EDom1ztz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481310; bh=jBm6bfBaZCWVHi9mKVYcuIFQ5VRypBtpWf4Hy86neuw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EDom1ztzVT2WY6NJmoIRWG36FHnr15NA4eNCaU+4SJZC550tJCitX2893yQ9JJGIq E2xaPcwkn798is/e++XWFAJUHb34j2vJ4g4V6KMyyT9EgOKzDRIhab5TL3Xs0+eMWW Ab2D0Lcez/+tyECttAuA0NOVTzpTxqFR8CLGW/8pToZhWvl0TLy0bhX3EVsUgn31Tb WDoUYpsj6+zcfrWGBm60lHyh7ak4Oszlpk7zUf5afPnY7HwuczdBLR7sRlLBFkSunV lfU12c+TyeoxcMM4gbhz7tWXPTSeXduehBWCHE8cmy7zFaWhSjUgeq8PI/wvfCK+aW kXS4tMbAjQHHA== 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 23A5A17E154C; Sat, 26 Jul 2025 00:08:30 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:16 +0300 Subject: [PATCH v2 14/18] 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: <20250726-vhci-hcd-suspend-fix-v2-14-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 0a552cf93be5d55409e2cffabce4c7a68e1360c4..f37f5f3680c2f1be8ed056d5c85= 79d75a0d0ad25 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1282,8 +1282,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); @@ -1297,8 +1295,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)) @@ -1450,8 +1446,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; @@ -1489,8 +1483,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 From nobody Mon Oct 6 01:23:47 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 B126026FD9B; Fri, 25 Jul 2025 22:08: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=1753481314; cv=none; b=LUMgEiF6dJMadT9izFYb4SegplCnDu7klnjhJLGcSZjdClb7BYPJxm9xTLy0jEaGssvZ6Xzg10dwGVvnW510xanw4CfkcWeUn0xPdQm6Tm4GxHw9QFnnxvDTWX+1Za4ffXEysozR3nuPDsnicQagRlVvubqisngG6L+OVRZaupA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481314; c=relaxed/simple; bh=YQ0KGzga0Mr7AcIpOzTtxyYlYq3Su9hRIwFF55+EwjI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ak1co1BrhbmHgNnAap3yVdZ7DFtmK7jkRgb3IaEstUdZ1eFvxqOew/GNx25P3n/T8lyYY7ZHDFX2ExPLusISHQW+SKszdrzPAb6HA7D0mWsn0J0vCxkzWpBBo/9X++DLkms2JI/+70kzYRHku1ky5Py2/fnFuvZZiA59FJcOCz4= 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=a/ly/gkN; 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="a/ly/gkN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481311; bh=YQ0KGzga0Mr7AcIpOzTtxyYlYq3Su9hRIwFF55+EwjI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=a/ly/gkNkMhC+ZeC9+1xdNle3YKy15Prl9SMum8uvplLyPN1hTRSCM0EnBwppqQ16 MeB7dtQtlsvodCPg45TdhEL9gr1sgvMAs+mfJ8c7rgAn/7YeMjJjV3Em/c+ib0bN/m I2FpVMuICZQRLrsU5cMr6N3zccY2BJPUmyuk0wZKH9nTu/LWCUrbZaCC7P0z4XyBcw aYsQQKt5lwU2bpaz6g/kU7ddMR+jRRpP2SKUHWg5+JB5+BFqHDbH0q7LKKAkmEJ+go iJiW298t1xawxu7YQ7VvhoUVoxvztrE6rrbMs7x/vPjqh/Rk11OnLnK1xfHhEswmPo gqX1QkiCy6asA== 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 E795E17E1553; Sat, 26 Jul 2025 00:08:30 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:17 +0300 Subject: [PATCH v2 15/18] 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: <20250726-vhci-hcd-suspend-fix-v2-15-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 In case of the usbip_dbg_*() helpers, which are wrappers over pr_debug(), the function names end up duplicated, hence replace the superfluous strings with some useful info or simply drop the log entries altogether if they become ftrace-like. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index f37f5f3680c2f1be8ed056d5c8579d75a0d0ad25..00377a7cbebd4e0de3f9a0fb756= d93c9cedac148 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -160,8 +160,6 @@ 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); - spin_lock_irqsave(&vhci->lock, flags); =20 status =3D vhci_hcd->port_status[rhport]; @@ -183,6 +181,8 @@ void rh_port_connect(struct vhci_device *vdev, enum usb= _device_speed speed) =20 spin_unlock_irqrestore(&vhci->lock, flags); =20 + usbip_dbg_vhci_rh("rhport: %d status: %u\n", rhport, status); + usb_hcd_poll_rh_status(vhci_hcd_to_hcd(vhci_hcd)); } =20 @@ -194,8 +194,6 @@ 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); - spin_lock_irqsave(&vhci->lock, flags); =20 status =3D vhci_hcd->port_status[rhport]; @@ -206,6 +204,9 @@ static void rh_port_disconnect(struct vhci_device *vdev) vhci_hcd->port_status[rhport] =3D status; =20 spin_unlock_irqrestore(&vhci->lock, flags); + + usbip_dbg_vhci_rh("rhport: %d status: %u\n", rhport, status); + usb_hcd_poll_rh_status(vhci_hcd_to_hcd(vhci_hcd)); } =20 @@ -1195,8 +1196,6 @@ static int vhci_start(struct usb_hcd *hcd) int id, rhport; int err; =20 - usbip_dbg_vhci_hc("enter vhci_start\n"); - if (usb_hcd_is_primary_hcd(hcd)) spin_lock_init(&vhci_hcd->vhci->lock); =20 @@ -1318,7 +1317,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 @@ -1327,7 +1326,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 01:23:47 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 55A352701D2; Fri, 25 Jul 2025 22:08: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=1753481315; cv=none; b=Qyzj95P9+JLBW+Tw7oiWnbC9ME0XjGHE/kiNEng3OiexZFu2hygjxnf/O+gfsZyBRHyAu7W2lXvZftHsqZa+lQ3TURUBY5ciAixWaDYqLuQFgEzkW8iqlT7U1uPBYZdFTNxcXbTkkMvQYiNE9UpvJ8vS2HURvK7LCardS6EbHQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481315; c=relaxed/simple; bh=WFxQT5F/weiZK3TGl9+364zxlnGP1pNFv66Myqb2rXY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DxZ/v52zqIryH0Gw3+GNAM8hQbacc+B7RaWCz689NXPkzo0UZm49AcduF/hkwR5zcuY0iIZvN6kcSYYvmPqgFUmc9lIx6U3lwLOvWWNjl33n625JrclEZt6NWUJLKKJgy62s1OG/0fYJkEmHEVdGSzOmAp3uBALBmBVN+QHR06w= 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=jSd2SE6s; 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="jSd2SE6s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481311; bh=WFxQT5F/weiZK3TGl9+364zxlnGP1pNFv66Myqb2rXY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jSd2SE6sjEut61xq8bbDQzGWrpACr5Yclm1hVIP6cfsCrxXocD/R1WiXoWNxNwfRB Mx9RfAS8k2P8CNvzI7A1uJtXF/lqEtlIiXiCje8FlPkut1yCMT+fcQkUC2cwRyQAbL 0x/76ekmIERDngrbZk3O/BKvvivfaIQRTiNx3gIBBdJN2LDLEXruiYISK/rIomRSxr nkmaYYp/8iuQzvUTn+bo6hFPzmzMJYOGcRZAnAh1/hEcNPANoFATSbJPer1sBZBAr2 DhwVvrh7AEd/OxbSWURsmMN+6UIoJBD0U/T/TFvC6CxWYEXfxqcavuF+0cwMo36a4B Uk21+jP2QboPQ== 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 B6C4817E156C; Sat, 26 Jul 2025 00:08:31 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:18 +0300 Subject: [PATCH v2 16/18] 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: <20250726-vhci-hcd-suspend-fix-v2-16-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 While at it, replace the affected pr_err() calls with dev_err(). Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 00377a7cbebd4e0de3f9a0fb756d93c9cedac148..73c5979fee3ce345ea2c212fea0= 3adabde55243a 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -377,8 +377,8 @@ 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"); + dev_err(hcd_dev(hcd), + "ClearPortFeature: USB_PORT_FEAT_SUSPEND req not supported for USB 3.= 0 roothub\n"); goto error; } =20 @@ -507,8 +507,8 @@ 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"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_LINK_STATE req not supported for USB 2.0 roothub\n"); goto error; } =20 @@ -524,8 +524,8 @@ 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"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_U1/2_TIMEOUT req not supported for USB 2.0 roothub\n"); goto error; } break; @@ -533,8 +533,8 @@ 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"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_SUSPEND req not supported for USB 3.0 roothub\n"); goto error; } =20 @@ -566,8 +566,8 @@ 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"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_BH_PORT_RESET req not supported for USB 2.0 roothub\n"= ); goto error; } fallthrough; @@ -621,8 +621,8 @@ 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"); + dev_err(hcd_dev(hcd), + "GetPortErrorCount req not supported for USB 2.0 roothub\n"); goto error; } /* We'll always return 0 since this is a dummy hub */ @@ -631,8 +631,8 @@ 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"); + dev_err(hcd_dev(hcd), + "SetHubDepth req not supported for USB 2.0 roothub\n"); goto error; } break; --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 70011270ED7; Fri, 25 Jul 2025 22:08:34 +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=1753481316; cv=none; b=bqQVNh1QEcM5F+QaBbxKsZcLj+ehleKqpZ+/kVt97aoi1Da4Op4OvjxZd+Tuyq8O5Xk1LtSS/qT3TK/GCGibNUOTQo/4rM8CtrSRB6cx7bU75koZdKXq5u9mnAaCcB+v1pg7wIdmB969QY56Xo4Cv5n3VwHXDi9gPfmiq7Etgu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481316; c=relaxed/simple; bh=ow1ljpmkv02H9hsOpbrXGJDs1A/a1CXp5uwQULajhsE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lw2rV/0TE5vjBfhRm6ryj7RcJkLj3m4M2boUsCnwg/BByuNcBLay2u4aS3zSM0sF1SU+CHOjtpgXcUxsIBOaJAYSVM5q/aJ7whGRqk9JzEjQ2/Ld8eDr0xQ4MpOPzVktXyOA2xpsy4ziWjEcphaz0O4bXgxqKwrVtX8adp4UNGw= 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=bZyF680x; 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="bZyF680x" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481312; bh=ow1ljpmkv02H9hsOpbrXGJDs1A/a1CXp5uwQULajhsE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bZyF680x2IUDuJPlQI0q7ZatJ/E7GTnx5ELWQd0hJxdRgSqngA9JCi3gbISX/VAZQ yYrJ23h5UZuSNCGf2ykzM7Vmg3uFBnrsiuPB79V3X3plwp5RDnehZu/DaUYl9/wG+J 2LtF0V8+fGpoBTVqB5f7kO7PxMLYmFQ8+3LY4b0ym0h73/K8XsdKVmY4G0LCbF205U 9REAjHk3y2+OfCgNdBqAbk9h1PPO9iIDtLSASKWc0gJu+o6W8mYjfQ3AqVe7geYSEP wFb6RvKjJtaeTCJKFE/j6CaeEYOE3QUK6FZk8jchvMxrD3E2hPY/p6d9EsrJ0zgOW+ Ub89R9zgqvjrA== 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 83A2517E157A; Sat, 26 Jul 2025 00:08:32 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:19 +0300 Subject: [PATCH v2 17/18] usb: vhci-hcd: Switch to dev_err_probe() in probe path 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: <20250726-vhci-hcd-suspend-fix-v2-17-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 pr_err() calls in vhci_hcd_probe() with dev_err_probe(), to simplify error handling a bit and improve consistency. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 73c5979fee3ce345ea2c212fea03adabde55243a..5d2983a6c2b05d2a769424e1595= b4212a806c2a2 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1369,10 +1369,8 @@ static int vhci_hcd_probe(struct platform_device *pd= ev) * Our private data is also allocated automatically. */ hcd_hs =3D usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->de= v)); - if (!hcd_hs) { - pr_err("create primary hcd failed\n"); - return -ENOMEM; - } + if (!hcd_hs) + return dev_err_probe(&pdev->dev, -ENOMEM, "create primary hcd failed\n"); =20 hcd_hs->has_tt =3D 1; =20 @@ -1381,22 +1379,21 @@ static int vhci_hcd_probe(struct platform_device *p= dev) * Call the driver's reset() and start() routines. */ ret =3D usb_add_hcd(hcd_hs, 0, 0); - if (ret !=3D 0) { - pr_err("usb_add_hcd hs failed %d\n", ret); + if (ret) { + dev_err_probe(&pdev->dev, ret, "usb_add_hcd hs failed\n"); goto put_usb2_hcd; } =20 hcd_ss =3D usb_create_shared_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev), hcd_hs); if (!hcd_ss) { - ret =3D -ENOMEM; - pr_err("create shared hcd failed\n"); + ret =3D dev_err_probe(&pdev->dev, -ENOMEM, "create shared hcd failed\n"); goto remove_usb2_hcd; } =20 ret =3D usb_add_hcd(hcd_ss, 0, 0); if (ret) { - pr_err("usb_add_hcd ss failed %d\n", ret); + dev_err_probe(&pdev->dev, ret, "usb_add_hcd ss failed\n"); goto put_usb3_hcd; } =20 --=20 2.50.0 From nobody Mon Oct 6 01:23:47 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 F06F0271470; Fri, 25 Jul 2025 22:08:34 +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=1753481317; cv=none; b=hFTCTu3fOKkaYa4fOZhKZteGbUn7vb8N7InypZaCDg+AYEijKTENjRr6WLIkTHHvNjBfgTsVj5kumLoGJgn4OSSc99+wWRWMC2/bmCAJgIC3yzOcfp5i5+AMS8jrVhh4xR/zq5C/rlanwDD8dVG6A1ADxZaVQQoApBHsyLrxxc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753481317; c=relaxed/simple; bh=ltAqzVc50U+Po3OUKy1W8MsDXuZqQh/NKCR+MlMUIZU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m/+YX5khyvpdQc9uP25f5VA47JED+EzVGRH82DuwecfNuRD9jJGNBPl/9oeqykBRbaA24FXStp9Ti069LEAtnkoRQcrYkBB5Yb4mOunHaXYigruEVzacYe9x/A165qcLFaWcL2S7Hpnq6pLLgdWfXGVFQemiFlAzximl/i8vsZg= 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=Dsnw0OAW; 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="Dsnw0OAW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753481313; bh=ltAqzVc50U+Po3OUKy1W8MsDXuZqQh/NKCR+MlMUIZU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Dsnw0OAW4oW9uxmYfd7ZEIpkO6va68kRZ04jKdCq35q44USbSfKVexyTxptulhHTz BNuX+ZHlyRs0sFiQVRqYVMPQaeXkHKcstHEzY1FaHhMPW3DD65jRfu7fmMciNbB884 LbeHv2pSdQceof+VZPB2OxJNkr+qL7OX9a2TUqLY0AKEzfCUwUwDzqL3CUYjR+cy9f fsfv++8qWavvYYc5VBHfLsaQanBAMaI9KfRTsf3dEbJ73nIyS0ahE7SavP25UmAluf Mc310c75aM4R2rmGs2UPJ4q/N/QU54nDzS5rZtzwAink9d6Aj4/qEkzwCRwDGFAmwv to/SDDoXBAQyg== 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 517F717E159B; Sat, 26 Jul 2025 00:08:33 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 26 Jul 2025 01:08:20 +0300 Subject: [PATCH v2 18/18] usb: vhci-hcd: Replace pr_*() with dev_*() 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: <20250726-vhci-hcd-suspend-fix-v2-18-189266dfdfaa@collabora.com> References: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@collabora.com> In-Reply-To: <20250726-vhci-hcd-suspend-fix-v2-0-189266dfdfaa@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 Where possible, use driver model logging helpers dev_*() instead of pr_*() to ensure the messages are always associated with the corresponding device/driver. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 43 +++++++++++++++++++++++-----------------= --- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 5d2983a6c2b05d2a769424e1595b4212a806c2a2..96c93e47fba131fc32c969adfaa= 8f425c55ea7ae 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -347,7 +347,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, if (wIndex < 1 || wIndex > VHCI_HC_PORTS) { invalid_rhport =3D true; if (wIndex > VHCI_HC_PORTS) - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); } else { rhport =3D wIndex - 1; } @@ -370,7 +370,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, break; case ClearPortFeature: if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -410,7 +410,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, 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))) { - pr_err("Wrong hub descriptor type for USB 3.0 roothub.\n"); + dev_err(hcd_dev(hcd), + "Wrong hub descriptor type for USB 3.0 roothub.\n"); goto error; } =20 @@ -436,7 +437,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case GetPortStatus: usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); retval =3D -EPIPE; goto error; } @@ -485,7 +486,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, USB_PORT_STAT_LOW_SPEED; break; default: - pr_err("vhci_device speed not set\n"); + dev_err(hcd_dev(hcd), "vhci_device speed not set\n"); break; } } @@ -539,7 +540,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -548,7 +549,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_POWER: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_POWER\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -560,7 +561,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_BH_PORT_RESET: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -574,7 +575,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_RESET: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_RESET\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -598,7 +599,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh(" SetPortFeature: default %d\n", wValue); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -637,7 +638,8 @@ 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", + dev_err(hcd_dev(hcd), + "default hub control req: %04x v%04x i%04x l%d\n", typeReq, wValue, wIndex, wLength); error: /* "protocol stall" on error */ @@ -645,7 +647,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 if (usbip_dbg_flag_vhci_rh) { - pr_debug("port %d\n", rhport); + dev_dbg(hcd_dev(hcd), "%s port %d\n", __func__, rhport); /* Only dump valid port status */ if (!invalid_rhport) { dump_port_status_diff(prev_port_status[rhport], @@ -705,7 +707,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag unsigned long flags; =20 if (portnum > VHCI_HC_PORTS) { - pr_err("invalid port number %d\n", portnum); + dev_err(hcd_dev(hcd), "invalid port number %d\n", portnum); return -ENODEV; } vdev =3D &vhci_hcd->vdev[portnum - 1]; @@ -958,7 +960,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 unlink->seqnum =3D atomic_inc_return(&vhci_hcd->seqnum); if (unlink->seqnum =3D=3D 0xffff) - pr_info("seqnum max\n"); + dev_info(hcd_dev(hcd), "seqnum max\n"); =20 unlink->unlink_seqnum =3D priv->seqnum; =20 @@ -1035,10 +1037,11 @@ static void vhci_device_unlink_cleanup(struct vhci_= device *vdev) static void vhci_shutdown_connection(struct usbip_device *ud) { struct vhci_device *vdev =3D container_of(ud, struct vhci_device, ud); + struct usb_hcd *hcd =3D vhci_hcd_to_hcd(vdev_to_vhci_hcd(vdev)); =20 /* need this? see stub_dev.c */ if (ud->tcp_socket) { - pr_debug("shutdown tcp_socket %d\n", ud->sockfd); + dev_dbg(hcd_dev(hcd), "shutdown tcp_socket %d\n", ud->sockfd); kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); } =20 @@ -1051,7 +1054,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) kthread_stop_put(vdev->ud.tcp_tx); vdev->ud.tcp_tx =3D NULL; } - pr_info("stop threads\n"); + dev_info(hcd_dev(hcd), "stop threads\n"); =20 /* active connection is closed */ if (vdev->ud.tcp_socket) { @@ -1059,7 +1062,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) vdev->ud.tcp_socket =3D NULL; vdev->ud.sockfd =3D -1; } - pr_info("release socket\n"); + dev_info(hcd_dev(hcd), "release socket\n"); =20 vhci_device_unlink_cleanup(vdev); =20 @@ -1085,7 +1088,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) */ rh_port_disconnect(vdev); =20 - pr_info("disconnect device\n"); + dev_info(hcd_dev(hcd), "disconnect device\n"); } =20 static void vhci_device_reset(struct usbip_device *ud) @@ -1219,7 +1222,7 @@ static int vhci_start(struct usb_hcd *hcd) =20 id =3D hcd_name_to_id(hcd_name(hcd)); if (id < 0) { - pr_err("invalid vhci name %s\n", hcd_name(hcd)); + dev_err(hcd_dev(hcd), "invalid vhci name %s\n", hcd_name(hcd)); return -EINVAL; } =20 @@ -1238,7 +1241,7 @@ static int vhci_start(struct usb_hcd *hcd) return err; } =20 - pr_info("created sysfs %s\n", hcd_name(hcd)); + dev_info(hcd_dev(hcd), "created sysfs %s\n", hcd_name(hcd)); } =20 return 0; --=20 2.50.0