Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 943C1C433F5 for ; Wed, 2 Feb 2022 23:09:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 798F4838FE; Thu, 3 Feb 2022 00:09:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=akkea.ca header.i=@akkea.ca header.b="eT/6aXC7"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="DqaTb4/7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B89D3838FD; Thu, 3 Feb 2022 00:09:23 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3FFA583903 for ; Thu, 3 Feb 2022 00:09:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 16F264E2006; Wed, 2 Feb 2022 23:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1643843356; bh=o/Z9UucDhLmWbrYYdHDkx9wk+pAKqxJUZIRfxu4rPJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eT/6aXC7EtazOMgxb545Tcd+sn+2fOR3IaDRwWnrTYujMYnjc4ndU7AYLejYG1kG2 Aq8I7KD4fzUdqNChEB5rlfQ2lYmK6tJvtRxRZNrCNWxdCmmG/CN60a2t5QxPmiDn2q 4uxpcMtq9sBAiHVdUzgbf/tjAYwrd/wuh9f/szGY= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EJsyeZootdBT; Wed, 2 Feb 2022 23:09:15 +0000 (UTC) Received: from midas.localdomain (S0106788a2041785e.gv.shawcable.net [24.108.106.191]) by node.akkea.ca (Postfix) with ESMTPSA id 6BE504E200C; Wed, 2 Feb 2022 23:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1643843355; bh=o/Z9UucDhLmWbrYYdHDkx9wk+pAKqxJUZIRfxu4rPJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DqaTb4/7zNOgwO0RNYCQaWM0GtpzLD0C9b6VIdUGjbaaecWFz02KEMVAJPAyUq67K Krn8cwXO/1/mw6gZK4mnoaYvg97UY7u/oorl1gfMJUwUC8iChCGsHb7fM2a++MgKOy 18vj6eBrs1m1Fqcia7KvUpGWhydOzcDFcjeo95kM= From: Angus Ainslie To: uboot-imx@nxp.com Cc: Marek Vasut , Simon Glass , Angus Ainslie , Kunihiko Hayashi , u-boot@lists.denx.de, kernel@puri.sm Subject: [PATCH 2/2] usb: dwc3: core: stop the core when it's removed Date: Wed, 2 Feb 2022 15:08:55 -0800 Message-Id: <20220202230855.2080973-3-angus@akkea.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202230855.2080973-1-angus@akkea.ca> References: <20220202230855.2080973-1-angus@akkea.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean If u-boot doesn't stop the core when it's finished with it then linux can't find it. Signed-off-by: Angus Ainslie --- drivers/usb/dwc3/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ce1c0e88c2..b592a487e0 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -706,6 +706,14 @@ static void dwc3_gadget_run(struct dwc3 *dwc) mdelay(100); } +static void dwc3_core_stop(struct dwc3 *dwc) +{ + u32 reg; + + reg = dwc3_readl(dwc->regs, DWC3_DCTL); + dwc3_writel(dwc->regs, DWC3_DCTL, reg & ~(DWC3_DCTL_RUN_STOP)); +} + static void dwc3_core_exit_mode(struct dwc3 *dwc) { switch (dwc->dr_mode) { @@ -1128,6 +1136,7 @@ void dwc3_remove(struct dwc3 *dwc) dwc3_core_exit_mode(dwc); dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); + dwc3_core_stop(dwc); dwc3_core_exit(dwc); kfree(dwc->mem); } -- 2.25.1