From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796373681; b=vPC6kd1l5SSyyp69RjjDgK0FJEEzXKjGSaWb3lA5qQLBBlqN77bTY7Y/FmaRIChV4sRO /qhjjWgFg9+ogRGFrvQC1zm4TWGQ3MAhr+HHw/TiDwYm9WGsPW8hYJepwRCccH4Fd8c3i ja3G12jKedRaWzqUARzp+2PNUi3waEbie6DSVxwu60L6JzC7Us/WhThy8ck1G6urgPdtc haaVZ8D5CHU6hXVuOqx/b8mNvJ8uNp7i3zxj/n5gBA8VCDqIsCbsi/C4+Nnc7iRrIPL74 7ojLzp5EzJtEZnZG0VdbP7ew7/2WxT0ESwkGIt6gJLKbQZ7Auip0UXmdiO7H3IAV2qw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796373681; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=OLNUuP5Y1aEdZUH3rn8CboMJMgAGT2C785owWkk1Qck=; b=4dxn0/gPyMTikpZTTn2UdM9T5BpMfJpDAZISA2H3CDC/je3jwulIRqq5Iuu8jcQQmlBS qVvrS2eQNMTyQzgpismlHU6NTTQIEU7hvd2HA10i0crYkmf7z+LIZPR25TqOse5HyKRB/ vrIe5lwQg6Qhae8MkKcWzDs/ARbvtDhFVaaMReVlyHjZj6lBbQCFFc6gsUzmb0li0pCkz iA3k4RHkJBaN6sO2AbFUr9rar+m4T12MIioR9XQ0IEyWv7ltWeZxTu+eB0U+mL908aUwO 6T5CFU2cnwoqU2C40uGZzmVE35X0a+81ZeeXbLA6XcutjTvnvZCsmq9LnsUv+yEXsQw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fmXAInvM; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AF34606A69E for ; Fri, 4 Dec 2026 08:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fmXAInvM Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEF651F000C2; Fri, 4 Dec 2026 08:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796373681; bh=OLNUuP5Y1aEdZUH3rn8CboMJMgAGT2C785owWkk1Qck=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=fmXAInvM3akVSIo6bubQHLpYONppP12KtqWBrD2H2nmEI7r+gPZGCLTBS0kJTKxBt TLGMmMuvhmY5cqwpFXOnKg5NQ3/LFjveDvfOsN3RbWaHLpXfZR0xPfhrxko4zKELfo aSIVek+fWYGot/Z/EgH8JMJ9l6nphLUa/dSDofdPRp/SXw8hE4pzwnK7mzWrVdeQUw WSZ5K6FBrFIHBxfT9GNxDI9xvDbZwGQ5ff9uYTVL+mT4Ba34pXIiGRfXFu+BPivtZV r3TBh+TZC7ifBtdeXBbkaTg5UwfN5XjnTA5QzwIyTz0BQU8U6bcUb3SSR+apI4m26+ k5JzqOLlgq1iw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] USB: dwc2: shut down the wakeup timer before removing the HCD Reply-To: sashiko-reviews@lists.linux.dev To: "Yuming Hu" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261204082801.1382976-1-huyuming@kylinos.cn> References: <20261124024516.2621743-1-huyuming@kylinos.cn> <20261204082801.1382976-1-huyuming@kylinos.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:41:19 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > The wakeup timer is armed from hardirq context (WKUPINT, 71 ms) and its > callback dwc2_wakeup_detected() ends up calling > usb_hcd_resume_root_hub(hsotg->priv) when the port is suspended. >=20 > dwc2_hcd_remove() invokes usb_remove_hcd() and clears hsotg->priv before > it reaches dwc2_hcd_release(), where fd772af9512c ("USB: dwc2: shut down > wakeup timer before freeing HCD state") performs the > timer_shutdown_sync(). If the timer expires inside that window, or its > callback is in flight while hsotg->priv is being cleared, > dwc2_hcd_rem_wakeup() passes the NULL hcd to > usb_hcd_resume_root_hub(), which dereferences it without a NULL check > and oopses in softirq context. >=20 > Shut the timer down before usb_remove_hcd(), so that an in-flight > callback always observes a valid hsotg->priv and any later rearm attempt > is ignored by the timer core. The timer_shutdown_sync() call in > dwc2_hcd_release() is idempotent and keeps covering the probe error > path. >=20 > Fixes: 7359d482eb4d ("staging: HCD files for the DWC2 driver") > Cc: stable@vger.kernel.org > Signed-off-by: Yuming Hu Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204082801.1382= 976-1-huyuming@kylinos.cn?part=3D1