From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BAEEC433B4 for ; Tue, 18 May 2021 06:50:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC492611BD for ; Tue, 18 May 2021 06:50:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346834AbhERGvp (ORCPT ); Tue, 18 May 2021 02:51:45 -0400 Received: from muru.com ([72.249.23.125]:57008 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242305AbhERGvn (ORCPT ); Tue, 18 May 2021 02:51:43 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 3EFD780F5; Tue, 18 May 2021 06:50:29 +0000 (UTC) Date: Tue, 18 May 2021 09:50:22 +0300 From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Nishanth Menon , Suman Anna , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] bus: ti-sysc: Fix am335x resume hang for usb otg module Message-ID: References: <20210429074533.33355-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210429074533.33355-1-tony@atomide.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [210429 10:45]: > --- a/drivers/bus/ti-sysc.c > +++ b/drivers/bus/ti-sysc.c > @@ -1308,7 +1314,23 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev) > (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE)) > return 0; > > - return pm_runtime_force_resume(dev); > + /* Only enable module if it was on, or needs to be reinitialized */ > + if (ddata->needs_resume || > + ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME) { > + error = sysc_runtime_resume(dev); > + if (error) > + dev_warn(dev, "noirq_resume failed: %i\n", error); > + } > + > + /* Idle quirky module again if it was not on before suspend */ > + if (ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME && > + !ddata->needs_resume) { > + error = sysc_runtime_suspend(dev); > + } > + > + ddata->needs_resume = 0; > + > + return error; > } Best to set this up as a separate function, otherwise cpu_pm won't be able to use it eventually. I'll send out v2. Regards, Tony