From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8311C280327; Thu, 15 Jan 2026 17:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768497572; cv=none; b=lONvDS4kbcLktbDGGHyLBq4DmGSqLqsISuieMp8sZcZJxzDZx4LZGgKQ9iCzaL10OOJSgBcHJk47RY4VTpgi0FyKm6YBZ70EerAfTnVrbVKk9tZgIeVfgdprhXVOYZYq0FNonfy2Ks+LJhk/X2/EUa8IcyTzpO7sJMMNTxZdmEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768497572; c=relaxed/simple; bh=hIv3jP5rmacrzTrvazKCtT69CfDXKOM4YcwZQdoEr/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AHYXxNy+CzR7vHB8h8WYr151d1TJeqh1+Pt/d/BUWTV8bZ+7m0BE6ULbfsh4pZxecomV18hbKJvlVMCnzae7ybKUYHUmsy13rmXu67RxL7tBsxrOpx5U1MV+9O6B0SSM+RDqAeU6H8ZRAIEfBKjOWw8ZweLOuPMxQsTene4NBhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0wMisd77; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0wMisd77" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D966FC116D0; Thu, 15 Jan 2026 17:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768497572; bh=hIv3jP5rmacrzTrvazKCtT69CfDXKOM4YcwZQdoEr/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0wMisd77klvdZZeGjh8DHKRlGpmSr4uwummLMcR4vx5mhWeoqyxEm6cfItyEX8Y9c X3QiaG5TBTfKkiBu/jzmDnnwhbcyHdgY+4b8YyXUSnAE8c+tU+K5dB97VtPcQNaPjP /vOSKKwmxJnoQsiKMvaQ7otzqRR5mNwAkv831jqk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jisheng Zhang , Sasha Levin Subject: [PATCH 5.15 127/554] usb: dwc2: fix hang during shutdown if set as peripheral Date: Thu, 15 Jan 2026 17:43:13 +0100 Message-ID: <20260115164250.842810652@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164246.225995385@linuxfoundation.org> References: <20260115164246.225995385@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jisheng Zhang [ Upstream commit b6ebcfdcac40a27953f052e4269ce75a18825ffc ] dwc2 on most platforms needs phy controller, clock and power supply. All of them must be enabled/activated to properly operate. If dwc2 is configured as peripheral mode, then all the above three hardware resources are disabled at the end of the probe: /* Gadget code manages lowlevel hw on its own */ if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) dwc2_lowlevel_hw_disable(hsotg); But dwc2_driver_shutdown() tries to disable the interrupts on HW IP level. This would result in hang during shutdown if dwc2 is configured as peripheral mode. Fix this hang by only disable and sync irq when lowlevel hw is enabled. Fixes: 4fdf228cdf69 ("usb: dwc2: Fix shutdown callback in platform") Signed-off-by: Jisheng Zhang Link: https://patch.msgid.link/20251104002503.17158-2-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc2/platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 8bdbae4c77b0a..ae2d73c5aa811 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -384,11 +384,11 @@ static void dwc2_driver_shutdown(struct platform_device *dev) { struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); - dwc2_disable_global_interrupts(hsotg); - synchronize_irq(hsotg->irq); - - if (hsotg->ll_hw_enabled) + if (hsotg->ll_hw_enabled) { + dwc2_disable_global_interrupts(hsotg); + synchronize_irq(hsotg->irq); dwc2_lowlevel_hw_disable(hsotg); + } } /** -- 2.51.0