From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbdK2IVl (ORCPT ); Wed, 29 Nov 2017 03:21:41 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:12251 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751676AbdK2IVh (ORCPT ); Wed, 29 Nov 2017 03:21:37 -0500 X-IronPort-AV: E=Sophos;i="5.44,471,1505746800"; d="scan'208";a="264877814" From: Yoshihiro Shimoda To: Ulf Hansson CC: Geert Uytterhoeven , "Rafael J. Wysocki" , Linux PM , LKML , Greg Kroah-Hartman , Alan Stern , "USB list" , Linux-Renesas Subject: RE: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status() Thread-Topic: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status() Thread-Index: AQHTaDfS0q/eL1h6GUu734kOFriem6MpuB9wgABSgACAAPMO0A== Date: Wed, 29 Nov 2017 08:21:32 +0000 Message-ID: References: <1713438.irjm9MTSvo@aspire.rjw.lan> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@renesas.com; x-originating-ip: [211.11.155.139] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;TY1PR06MB0991;20:WFXltNJAs2me44BcBJHrIkP+MOStpCQAuMk/Kooj3ni1P/qdRcimINKGnNb0aJyGycv/MZHewsC47Nv4oG1bNZM1blnnVoqAyFPigS+SfKEcGT7w5f5OTaNp//6cwML/ozaCWt32dUIsj+8G7+/Zu8hsdbu/Rt1snURItSGOoHM= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 6d729f6f-25bb-4fc1-e4e3-08d5370232e8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603267);SRVR:TY1PR06MB0991; x-ms-traffictypediagnostic: TY1PR06MB0991: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231022)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011);SRVR:TY1PR06MB0991;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:TY1PR06MB0991; x-forefront-prvs: 05066DEDBB x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(39860400002)(366004)(50834003)(24454002)(129404003)(199003)(189002)(74316002)(5660300001)(14454004)(2900100001)(55016002)(6246003)(2950100002)(6916009)(102836003)(6116002)(4326008)(54356999)(3846002)(50986999)(99286004)(76176999)(305945005)(189998001)(25786009)(101416001)(7736002)(9686003)(77096006)(33656002)(6306002)(229853002)(68736007)(105586002)(106356001)(316002)(53546010)(6506006)(8936002)(66066001)(6436002)(8676002)(966005)(54906003)(93886005)(86362001)(575784001)(7696005)(2906002)(3280700002)(81156014)(97736004)(81166006)(478600001)(3660700001)(345774005)(53936002);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR06MB0991;H:TY1PR06MB0992.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d729f6f-25bb-4fc1-e4e3-08d5370232e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2017 08:21:32.4347 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR06MB0991 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAT8Lk3W026782 Hi, > From: Ulf Hansson, Sent: Wednesday, November 29, 2017 2:23 AM > > On 28 November 2017 at 13:48, Yoshihiro Shimoda > wrote: > > Hi Geert-san, > > > >> From: Geert Uytterhoeven, Sent: Tuesday, November 28, 2017 7:58 PM > >> > >> Hi Rafael, Shimoda-san, > >> > >> On Sun, Nov 12, 2017 at 1:27 AM, Rafael J. Wysocki wrote: > >> > From: Rafael J. Wysocki > >> JFTR, this triggered before during system resume on e.g. Salvator-XS with > >> R-Car H3: > >> > >> ohci-platform ee080000.usb: runtime PM trying to suspend device > >> but active child > >> phy_rcar_gen3_usb2 ee080200.usb-phy: runtime PM trying to suspend > >> device but active child > >> ohci-platform ee0c0000.usb: runtime PM trying to suspend device > >> but active child > >> ohci-platform ee0a0000.usb: runtime PM trying to suspend device > >> but active child > >> phy_rcar_gen3_usb2 ee0c0200.usb-phy: runtime PM trying to suspend > >> device but active child > >> phy_rcar_gen3_usb2 ee0a0200.usb-phy: runtime PM trying to suspend > >> device but active child > >> > >> so this was an existing issue with USB before. > > > > Thank you for the report! > > I know that, but since this didn't cause any trouble until now, > > I postponed to investigate the issue... But, I investigate it today. > > I don't find the root cause yet. However, it seems related to usb host and/or usb core. > > --> USB host related devices' child_count will be 1 in suspend timing. > > --> I guess remote wakeup feature is enabled? But, I don't find the point yet. > > I am guessing the issue is triggered by genpd in the suspend noirq > phase (genpd_suspend_noirq()). In there, there is a call to > pm_runtime_force_suspend() (which calls pm_runtime_set_suspended() and > which triggered the earlier error messages being printed). > > The reason why genpd calls pm_runtime_force_suspend(), is because when > validating wakeup configurations for the device "if > (dev->power.wakeup_path && genpd_is_active_wakeup(genpd))", it's > thinks wakeup isn't configured while it probably should be. > > An additional note, only when genpd has the GENPD_FLAG_PM_CLK set, > which makes the genpd->dev_ops.stop|start() being assigned, genpd > calls pm_runtime_force_suspend() - else it doesn't. > > Perhaps try out the series I recently posted improving the code > dealing with wakeups in genpd and the PM core: > https://www.spinics.net/lists/linux-renesas-soc/msg20122.html > To that, you need to set the new flag (invented in the above series) > DPM_FLAG_IN_BAND_WAKEUP in the driver that configures wakeup of its > device. > > Hope this helps! Thank you for the comments! I tried DPM_FLAG_IN_BAND_WAKEUP, but the issue still exists. I added the flag in the [eo]hci-platform driver and usb/core/driver.c. I also added the flag in the phy_rcar_gen3_usb2 driver except usb host drivers. > > The renesas_usbhs also uses the phy_rcar_gen3_usb2 driver. > > --> If I only used the renesas_usbhs driver (in other words, I don't install > > [eo]hci-{hcd,platform} drivers), the issue disappeared. > > --> So, I think the phy_rcar_gen3_usb2 driver doesn't cause this issue. > > (But, it is possible to be related though.) > > > > I'll continue to investigate this issue tomorrow. > > Please keep me posted, I am interested about the why the problem exists. :-) Sure! :) Best regards, Yoshihiro Shimoda > Kind regards > Uffe