Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1702017ybl; Wed, 14 Aug 2019 23:10:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz34lsarDCmLqbyfAmo79mKqAVD5LeN0xOVsI3Edjc0WbP3XS5d4pqh2gbzxLJgIKfsRcSq X-Received: by 2002:a63:c246:: with SMTP id l6mr2366016pgg.210.1565849437494; Wed, 14 Aug 2019 23:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565849437; cv=none; d=google.com; s=arc-20160816; b=ncT7K8csCzawgQylN9uazGtN+Hl28Trmz52WPN/r3Pze35sqqmjGjwMz9EI1lDOon3 SObSOG5ingZKhxITap5bWoO5m0OtETkFGlGm7DW+A45jToELwE6No3Kqq2Ligpq7wHSp V+pXtBaY9IqW97o/mOVGKmbxr2HvUy8Oq/1oTWCGpJ1WiN59vUrDBapTV+os5i5tsY6i xmcoL+KbBdumHCtPhUYJHEKII4EAZyfOoNE41jXpo8sSc96BgEbaTlSFjWICZApBCKG2 nY0Q8E/arYhUcIObeKwFbj9SSouxlALKjZnp/otDGXzClMzTdVcoJTdCeVaJFQqp412s RjZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=TyTtORCQH3kY0WUc4EwUdCl2nZBoYa31cJcTB8ppuXA=; b=XzDtgQCtqiv3GYoRFvBN0U3jAA8pVxo1tO041VYdLZ4F9G9S8bXoE2jezCZhl4EDIF jrxHUP+HunVJI7ZGj332IU9b7E3KXUyIrBe04iGwlmz8sdrnoSs1Gpmp8UaS3Lt9uuzB IQt1F8yzyRjGcwiYSJPtgB3ZnPBBtDjiDyXxpU3eaGgoX4MNm84W2kc2KiROXpwKKZBq 2yojkInkLzXaa12YO8r73tNJWRpm7d0TscfzW/zN5u7eWEHLehpyXPjqqkEFh8ZA/D18 h+STGe/AYdbPwJ8pxUAGloW99drOz+fSvO+19b//eEV8pFA/NW6vmxl/yxd70/lXXo2m gCJg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si363428pjq.104.2019.08.14.23.10.21; Wed, 14 Aug 2019 23:10:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729927AbfHOGAV (ORCPT + 99 others); Thu, 15 Aug 2019 02:00:21 -0400 Received: from mga18.intel.com ([134.134.136.126]:39804 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfHOGAV (ORCPT ); Thu, 15 Aug 2019 02:00:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 23:00:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,388,1559545200"; d="scan'208";a="352148825" Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by orsmga005.jf.intel.com with ESMTP; 14 Aug 2019 23:00:17 -0700 From: Felipe Balbi To: Vicente Bergas Cc: Robin Murphy , Heiko Stuebner , Will Deacon , Marc Zyngier , Catalin Marinas , Matthias Brugger , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: kexec on rk3399 In-Reply-To: <4fc3e5b5-31fe-41f6-8031-b37454f21437@gmail.com> References: <87v9uzaocj.fsf@gmail.com> <4fc3e5b5-31fe-41f6-8031-b37454f21437@gmail.com> Date: Thu, 15 Aug 2019 09:00:16 +0300 Message-ID: <87sgq3t1cf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Vicente Bergas writes: >> 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. >>>> >>>> It turns out that kexec has never worked reliably on this platform, ... >>> >>> Thank you all for your suggestions on where the issue could be. >>> >>> 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. >>> >>> The workaround is: >>> --- a/drivers/usb/dwc3/dwc3-of-simple.c >>> +++ b/drivers/usb/dwc3/dwc3-of-simple.c >>> @@ -133,6 +133,13 @@ >>> return 0; >>> } >>> >>> +static void dwc3_of_simple_shutdown(struct platform_device *pdev) >>> +{ >>> + struct dwc3_of_simple *simple = platform_get_drvdata(pdev); >>> + >>> + reset_control_assert(simple->resets); >>> +} >>> + >>> static int __maybe_unused dwc3_of_simple_runtime_suspend(struct device >>> *dev) >>> { >>> struct dwc3_of_simple *simple = dev_get_drvdata(dev); >>> @@ -190,6 +197,7 @@ >>> 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, >>> >>> 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 @@ > return 0; > } > > +static void dwc3_shutdown(struct platform_device *pdev) > +{ > + struct dwc3 *dwc = platform_get_drvdata(pdev); > + > + reset_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 = { > .probe = dwc3_probe, > .remove = dwc3_remove, > + .shutdown = dwc3_shutdown, > .driver = { > .name = "dwc3", > .of_match_table = of_match_ptr(of_dwc3_match), > > and leaving dwc3-of-simple.c as is, the issue persisted. That's because your reset controller is not passed to dwc3 core, only to your glue layer. -- balbi