From patchwork Sat Aug 17 17:41:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vicente Bergas X-Patchwork-Id: 11099179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5516C1399 for ; Sat, 17 Aug 2019 17:42:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43E2E27CAF for ; Sat, 17 Aug 2019 17:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3772E28961; Sat, 17 Aug 2019 17:42:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 895DB27CAF for ; Sat, 17 Aug 2019 17:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fOK8CHlLiCMJZzZ5lauMB/VaXDq07O+Luwm7YlhnXP4=; b=eq/CzcJfNFCb/z GN35hijumwOyTlA+657OJfrBiaz5S4BIVhsJPuShtw69YEG37XBxkeDsAjLaS3sh8+KYkri4fcTwJ vyJL2YBk9Fn34J5J3nDH/FJGdhFUJ0ZT9+B/zt3L7ucHedXF/LrmivwZMASG4T12vSYFumSgpwCQb moZz07/GL9X8FdQT4WG/61PVR3Uw4FNjvdRQkfAkeBOs77F0F0Hlet8jkchK8nXUeGRMEi3d9d69L wREviPDYSCk2y1IMiEEc3IBBYnQCI980SM4ktJk7/5sTO6X+7aB/0qv6w9xplRzkSrjMpgzrZQQdA Nu3EOZe0HCwNjwnwYG6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hz2ik-0001Ps-N6; Sat, 17 Aug 2019 17:42:30 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hz2ih-0001PQ-Bp; Sat, 17 Aug 2019 17:42:29 +0000 Received: by mail-wm1-x344.google.com with SMTP id i63so6560303wmg.4; Sat, 17 Aug 2019 10:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8BvRZzNwicLE/z69UjSGTGXsbcr/fKjBl5Vh3tEDe5E=; b=j0hYbZ96LX4H5j/7zgd5rcfxEfejgdQ/b3Z3lITb1rDiOz+pmpdDHibAGDilR0flpI 0WqNSoZUHOM0zp94G6hvFGixz/r8qegZ8eMUsT+WoXpcJiqi3P/HYMZbec391bcLLqM9 bvMHWcpEqu0+0B70ai/uKjLUnWIFNSIhPWSrM0arLx60w4/gS5VQTufbP721yWk1cEI7 3cQGfYIGFlwYld047aS3/5YgQ0HJXE/9xMaieEq8o8XWUq/6cJlFfDodQ49jDZ2OCNsX C58m58eoOHH5BDA7qJxepz2d+pWPrxIWG4UrUG+Ue/3DtZLfyVGoKFvWZm4ooYzwr8zA dEzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8BvRZzNwicLE/z69UjSGTGXsbcr/fKjBl5Vh3tEDe5E=; b=N59T7wkdQASUytejeB062Iyr+rMkrkc4IfskuwiRldcCzq1dSrPwHpGXTX8Z/CvRAe FLh+E4p8PoyMvLRFxpNZT7fZF1lF4cFNpjgbm1xgnPtrksVmJd5IxpkJP26bal0Bus8q bse7mCpmEiUEW6HhT/qznMIqqm8beq2fmVeH4SxhTF7vGK88yYoHb2XKlSI7KKjfoLj8 C3CU+ZVq7+x3D6lXOJy5YApFs/P1CfMaW0gn3MNl6e2rTpCOj0mqcxOH73SRCXGmXrIP z/ccahcqXmonLzNowYUFukg1SP0PGRtVXjLYY74igY7dJGoUqT0+JhTunWjNJNvociiY MHnQ== X-Gm-Message-State: APjAAAVZC+qkMxrRXkmY+ktG5Jq64dh490fhz0/GCCFpexv1d0z9OvTa OTvLdAANUU+rW691dD/Aqlo= X-Google-Smtp-Source: APXvYqxv2eAKy6wC5/B6NqHIhQmJQf/sbwr5KaaeCSiu5f34DWh1zJuYU6TFxW662W79bfdW9CZ7MQ== X-Received: by 2002:a1c:a957:: with SMTP id s84mr12487811wme.65.1566063744693; Sat, 17 Aug 2019 10:42:24 -0700 (PDT) Received: from localhost.localdomain ([92.59.185.54]) by smtp.gmail.com with ESMTPSA id t8sm23681659wra.73.2019.08.17.10.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Aug 2019 10:42:23 -0700 (PDT) From: Vicente Bergas To: Felipe Balbi , Robin Murphy Subject: [PATCH] usb: dwc3: Add shutdown to platform_driver Date: Sat, 17 Aug 2019 19:41:40 +0200 Message-Id: <20190817174140.6394-1-vicencb@gmail.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <4d18d4f7-a00e-bd60-6361-51054eba3bca@arm.com> References: <4d18d4f7-a00e-bd60-6361-51054eba3bca@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190817_104227_599581_0EA1FDA8 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Heiko Stuebner , MarcZyngier , Catalin Marinas , linux-usb@vger.kernel.org, Will Deacon , Vicente Bergas , linux-rockchip@lists.infradead.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Otherwise the device keeps writing to memory after kexec and disturbs the next kernel. Signed-off-by: Vicente Bergas --- drivers/usb/dwc3/dwc3-of-simple.c | 6 ++++++ 1 file changed, 6 insertions(+) Hi Felipe, Robin, this version calls 'remove' from 'shutdown' instead of just asserting a reset because it looks like a cleaner way to stop the device. Calling remove from shutdown in core.c instead of dwc3-of-simple.c does not fix the issue either. It has been tested on the sapphire board, a RK3399 platform. Regards, Vicenç. diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index bdac3e7d7b18..d5fd45c64901 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -133,6 +133,11 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) return 0; } +static void dwc3_of_simple_shutdown(struct platform_device *pdev) +{ + dwc3_of_simple_remove(pdev); +} + static int __maybe_unused dwc3_of_simple_runtime_suspend(struct device *dev) { struct dwc3_of_simple *simple = dev_get_drvdata(dev); @@ -190,6 +195,7 @@ MODULE_DEVICE_TABLE(of, of_dwc3_simple_match); static struct platform_driver dwc3_of_simple_driver = { .probe = dwc3_of_simple_probe, .remove = dwc3_of_simple_remove, + .shutdown = dwc3_of_simple_shutdown, .driver = { .name = "dwc3-of-simple", .of_match_table = of_dwc3_simple_match,