Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp803755ybl; Wed, 14 Aug 2019 06:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxqh2/q2yz20t9GBdE6RRiuh0Cmk8l7o0k+FBcdnLa9bCR2dukq5CXku+PAZxIKHa1bccf X-Received: by 2002:a17:90a:b894:: with SMTP id o20mr7245295pjr.41.1565788562089; Wed, 14 Aug 2019 06:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565788562; cv=none; d=google.com; s=arc-20160816; b=txW7DLU1QCzOrUOCAuKH+qIaEXo+9VAjkUKz7gtt3eX0e5eOTHqlcp+vbMtNnf/6WI Rf+TkjpfwwSAfKWlnauI9YcBHv5+loWbg6eRD1LhWUF0u9oAAeqTRMj4G44JZXL3Ep2Z WF6NUCTE3OWfCyDbPMrJDy2Mtf8+drom/uI3G/O3JFvF3Tosmxtm31ihbZck4VE7WLZI S7nRjC3TqC8VA++t4Mt1A+9Jf940MNQG4F4c4Bzyo818IeX7VZUzugquSiIGez/MaZAI a/8EiehsKqdEQuu4EnbPiaD4HGbUojpUfXdPpKBqzApn11w/YiP76Hbv3sMBRb7/L7q9 RpyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :references:in-reply-to:message-id:mime-version:date:subject:cc:to :from:dkim-signature; bh=l+DBXb28UlWmpaDB+1JSMKN1QA0f4oxNynDruzjGeUQ=; b=uPUZ6PxsK79js90dWllG8LJr53/pEB7rras5G+omTyfXIkGUQVudQEh/4iBMZ1v77R ByiBCQH2AlrV2DhHGpgavPBBAExj244CheMgOKaf1uok5AxebsceIPCkYJhNs526XDJU rYAlelwqZCuYtACb2tgYMlz7inIbqKJJDHlBnrazzBcxdVd60w9vnovE6Y4rabdij5k1 7mC6eiokDTSbChakDm/BmHTA/4dhW4whLja4yqB91UIj/kxzh+Fqyn3N3Ex/4zE2A1nw nnY8H/pPKZCZCf5oEdqk4ACxHdH76iFGUnFEQp3CczLAwVzmacM2hLHANUu3ZK/LSf+8 YfmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uPlsGHb9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si12926285plj.246.2019.08.14.06.15.45; Wed, 14 Aug 2019 06:16:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uPlsGHb9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727997AbfHNNPH (ORCPT + 99 others); Wed, 14 Aug 2019 09:15:07 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40060 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfHNNPG (ORCPT ); Wed, 14 Aug 2019 09:15:06 -0400 Received: by mail-wr1-f65.google.com with SMTP id c3so2797654wrd.7; Wed, 14 Aug 2019 06:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:mime-version:message-id:in-reply-to :references:user-agent:content-transfer-encoding; bh=l+DBXb28UlWmpaDB+1JSMKN1QA0f4oxNynDruzjGeUQ=; b=uPlsGHb95cC8NgoZoj0H0Ac8di2gv5OtlJm6ZAeD2k/toyaIqSch32S62gmsQqyz8v 1xE3G75L/vUVfvltuFbCYmSzwItVFwU/qyu8z46VC5XgeYFzaXphBvF6CimOHmnQAwdf Nzk+TnXfgc0ImLDv7UjLIQnrYAxHJIj4EKKKrjUSYGAvSwpsOasj/MhR8t1Qe4b/zlq/ fzwTzeir3WtY/zIldQ+t2Myu1D0vBMc9n6sVeogMaeoI3VzOUPghP6IUbFCH8418qwaU Nr6HZvVduLlXln5Z8/7DTubX6ukCVMhNKteiGq9/inC2/rkoUvoOqfEArE1iKJfJKzoS aQ0Q== 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:mime-version:message-id :in-reply-to:references:user-agent:content-transfer-encoding; bh=l+DBXb28UlWmpaDB+1JSMKN1QA0f4oxNynDruzjGeUQ=; b=Z2rCvnRKU9oWfWo55M1SfBYfMJvRANGLuG8HHIPXVKcAobhnWuSmGXAYnmPnd1uNev 0RFt4IEqv5vnEwHP4OEkZiafXy6uqdGLeE6wez2VKxOKQfgR/Xi5MTKD4SfxJ8HIpSgV IGFWNV3hmaHAVSyxI8TVjbbn/mATwMa7lVzQ5EiwrIGnkn78k/MMwWJeGi3PsNZXuGfL 0xcnnptQStcjVqw95YXEQz16TYseN8LG6BRQzQvYbJawn6p6frD3N4tVJf4OMfiQq44f 9t3C9uwpzUH1o56bGf+132bL7g/CIOpllza+YrT9uK4OE+t4CV5Mmza88YhqYGLLac4e mgUw== X-Gm-Message-State: APjAAAWAAtHAihG1+Yxnm0T7Uh5TXScsdOGK+IdmO+8EanY3rt1lAfft vP0sAmE5+iCLRXw8jYrZna4= X-Received: by 2002:adf:dfc8:: with SMTP id q8mr23712313wrn.121.1565788504202; Wed, 14 Aug 2019 06:15:04 -0700 (PDT) Received: from localhost ([92.59.185.54]) by smtp.gmail.com with ESMTPSA id t19sm4622137wmi.29.2019.08.14.06.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 06:15:03 -0700 (PDT) From: Vicente Bergas To: Felipe Balbi Cc: Robin Murphy , Heiko Stuebner , Will Deacon , Marc Zyngier , Catalin Marinas , Matthias Brugger , Greg Kroah-Hartman , , , , Subject: Re: kexec on rk3399 Date: Wed, 14 Aug 2019 15:15:02 +0200 MIME-Version: 1.0 Message-ID: <4fc3e5b5-31fe-41f6-8031-b37454f21437@gmail.com> In-Reply-To: <87v9uzaocj.fsf@gmail.com> References: <87v9uzaocj.fsf@gmail.com> User-Agent: Trojita Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, August 14, 2019 3:06:04 PM CEST, Felipe Balbi wrote: > Hi, > > Vicente Bergas writes: >> On Monday, July 22, 2019 4:31:27 PM CEST, Vicente Bergas wrote: >>> Hi, i have been running linux on rk3399 booted with kexec fine until 5.2 >>> From 5.2 onwards, there are memory corruption issues as reported here: >>> http://lkml.iu.edu/hypermail/linux/kernel/1906.2/07211.html >>> kexec has been identified as the principal reason for the issues. >>>=20 >>> It turns out that kexec has never worked reliably on this platform, ... >>=20 >> Thank you all for your suggestions on where the issue could be. >>=20 >> It seems that it was the USB driver. >> Now using v5.2.8 booted with kexec from v5.2.8 with a workaround and >> so far so good. It is being tested on the Sapphire board. >>=20 >> The workaround is: >> --- a/drivers/usb/dwc3/dwc3-of-simple.c >> +++ b/drivers/usb/dwc3/dwc3-of-simple.c >> @@ -133,6 +133,13 @@ >> =09return 0; >> } >> =20 >> +static void dwc3_of_simple_shutdown(struct platform_device *pdev) >> +{ >> +=09struct dwc3_of_simple *simple =3D platform_get_drvdata(pdev); >> + >> +=09reset_control_assert(simple->resets); >> +} >> + >> static int __maybe_unused dwc3_of_simple_runtime_suspend(struct device=20= >> *dev) >> { >> =09struct dwc3_of_simple=09*simple =3D dev_get_drvdata(dev); >> @@ -190,6 +197,7 @@ >> static struct platform_driver dwc3_of_simple_driver =3D { >> =09.probe=09=09=3D dwc3_of_simple_probe, >> =09.remove=09=09=3D dwc3_of_simple_remove, >> +=09.shutdown=09=3D dwc3_of_simple_shutdown, >> =09.driver=09=09=3D { >> =09=09.name=09=3D "dwc3-of-simple", >> =09=09.of_match_table =3D of_dwc3_simple_match, >>=20 >> If this patch is OK after review i can resubmit it as a pull request. > > not a pull request, just send a patch using git send-email > >> Should a similar change be applied to drivers/usb/dwc3/core.c ? > > Is it necessary? We haven't had any bug reports regarding that. Also, if > we have reset control support in the core driver, why do we need it in > of_simple? Seems like of_simple could just rely on what core does. the workaround has been tested patching only core.c with --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1561,6 +1561,13 @@ =09return 0; } =20 +static void dwc3_shutdown(struct platform_device *pdev) +{ +=09struct dwc3 *dwc =3D platform_get_drvdata(pdev); + +=09reset_control_assert(dwc->reset); +} + #ifdef CONFIG_PM static int dwc3_core_init_for_resume(struct dwc3 *dwc) { @@ -1866,6 +1873,7 @@ static struct platform_driver dwc3_driver =3D { =09.probe=09=09=3D dwc3_probe, =09.remove=09=09=3D dwc3_remove, +=09.shutdown=09=3D dwc3_shutdown, =09.driver=09=09=3D { =09=09.name=09=3D "dwc3", =09=09.of_match_table=09=3D of_match_ptr(of_dwc3_match), and leaving dwc3-of-simple.c as is, the issue persisted. Regards, Vicen=C3=A7.