From nobody Sat Sep 26 06:24:21 2026 Received: from mail-m49197.qiye.163.com (mail-m49197.qiye.163.com [45.254.49.197]) (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 92BB238F941; Fri, 4 Sep 2026 06:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788504821; cv=none; b=usTVemswAZct3i1htEwA/7PLCN9z79QCS1k4nQNHOLB5X5GaQ8ocKFp4L/kgRZDyHnucqLWXqtS1T3AVjTvVELwPyrpyWxPoZ4+QgoWmBw5YnFRo7H2TGTFIOfgd3vAlCMT7WmZg9i47mbqh6W3QCpKQgCq12UkXr5tfOWnuMwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788504821; c=relaxed/simple; bh=PyZTJnul0WRyhv14NAjINWVE7rJwhKbtgWZSTSi/sZQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=bOQMhO1RT782dmPbFeK2JRRoPie8Ts6r/+pS/34RBbO6ZEGaZJuX/99/qxnUT5eKywp2csJApkqAAai7U6ilL0wtbfuQLk4cPVNC8HUIW+IyJ6//WClH6OoRfw/y8eX2rylyxhzmlG27x3IIw5AHGYa75kUpDwH6+vcZj9qOjFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=seu.edu.cn; spf=pass smtp.mailfrom=seu.edu.cn; dkim=pass (1024-bit key) header.d=seu.edu.cn header.i=@seu.edu.cn header.b=nznidqa8; arc=none smtp.client-ip=45.254.49.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=seu.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seu.edu.cn Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=seu.edu.cn header.i=@seu.edu.cn header.b="nznidqa8" Received: from PC-202605011814.localdomain (unknown [222.191.246.242]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c86de951; Fri, 4 Sep 2026 14:53:29 +0800 (GMT+08:00) From: Runyu Xiao To: Minas Harutyunyan Cc: Greg Kroah-Hartman , Paul Zimmerman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Runyu Xiao , Jianhao Xu Subject: [PATCH] USB: dwc2: shut down wakeup timer before freeing HCD state Date: Fri, 4 Sep 2026 14:53:23 +0800 Message-Id: <20260904065323.4047026-1-runyu.xiao@seu.edu.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-HM-Tid: 0aa06b319ecb03a1kunm14fe40e82cded X-HM-MType: 10 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZS0NNVh0fGUxDSU9MGkMaT1YeHw 5VEwETFhoSFyQUDg9ZV1kYEgtZQVlJSUlVSkJKVUlPTVVJT0lZV1kWGg8SFR0UWUFZT0tIVUpLSE pPSExVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=nznidqa8kJUPoCpnbLZBdILMXOlzlFYYuTk8NOIiFqeab/OwY6D56ffJ98IGZuFwU1O6CPU0keCjV2RqB3mW6i+MA1/WcT3IHqfSPqRGbhWu27EyhhCpVgsh5vio7399wNur+pkTKr6271fb73pRpwZfbsv8XzNKawGFYMeJD+s=; c=relaxed/relaxed; s=default; d=seu.edu.cn; v=1; bh=WrhANauzQUvCaiGOaK1awVnmFxHTAanmgw0npzHV8YA=; h=date:mime-version:subject:message-id:from; Content-Type: text/plain; charset="utf-8" dwc2_wakeup_detected() accesses the DWC2 host state and can rearm the wakeup timer. dwc2_hcd_free() currently deletes the timer only after freeing host-owned state, and timer_delete() does not synchronize a callback or prevent it from being queued again. Stop and shut down the timer in dwc2_hcd_release(), before the HCD resources are freed. This covers both the HCD initialization error path and normal HCD removal. Fixes: 7359d482eb4d ("staging: HCD files for the DWC2 driver") Cc: stable@vger.kernel.org Assisted-by: Codex:GPT-5 Signed-off-by: Runyu Xiao diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 2414291aa..cd0dc876b 100644 Reviewed-by: Thinh Nguyen --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5082,14 +5082,13 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg) } =20 cancel_work_sync(&hsotg->phy_reset_work); - - timer_delete(&hsotg->wkp_timer); } =20 static void dwc2_hcd_release(struct dwc2_hsotg *hsotg) { /* Turn off all host-specific interrupts */ dwc2_disable_host_interrupts(hsotg); + timer_shutdown_sync(&hsotg->wkp_timer); =20 dwc2_hcd_free(hsotg); } --=20 2.34.1