Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1547595pxj; Wed, 19 May 2021 08:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxndNO8Fo950muRPziI+P2NJbu4EvmTSIzW2UzvHaMGy7SmvaID0M47VJRHM3CUfEgD39XT X-Received: by 2002:a05:6402:2681:: with SMTP id w1mr1207840edd.223.1621437709402; Wed, 19 May 2021 08:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621437709; cv=none; d=google.com; s=arc-20160816; b=VE2FhzC7Z6UKMI7Ec1erhVf3hrLgaGzHoet+Ji0LXURsmjECalWAzn2Z7DKubkZwl3 Tuxto0xH6VgC/UgnjTO/gYnc4NZ/RhMBW7+MJs9u5MHT3+6OPRBFN6dQYFXfHDnwGajm 7+HV36Sk1L7ybhY8QZKa8jq1wrvHqpxYcQ+s5hEBCEb+KdcvcZJ2vNAYg/CiMB4+9scg Gpm/a9lmb61uh5LGM4zH9F7b0x1F8wZXMXPFPU+sCXGQHWymTLAF+6MJnfddhzycZifT hKIZtem9IUuEhzc1HSbOpDIarwGwy0Th6NmX+JaJB6psCmRMuKjZ7n8ZHfKqDgO1ZcJe r3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ZWWjHvoaTJQ9cyc4qapbzXR2W6/TWAiuJvQoDfogItk=; b=tHShXezRHskoKAjTGXVYZBljFkK0he94XB7MNijJHUIDDOpqL7ruLx3h1G1mqI60wO Wptksi3IS1RrvUDDxgpf38YNIOe4eCXrB4AmIgkuGCT0FGzc3qdo+2c6yoT3tRLChMB5 f5BRZWAgAkSnMx+bwKd58Go1XwSdckiJPnfSlrHsFrf+ELZYK5epheX6NPfgOk7kvU9t 7dpxdLteEol4pTkK3xAeK9DvI4zTeQtecunxSWZIz7vZfQMHXFDWdFA6T+fo1R7/Cnul l39hZMBlj9Cd0M3Yyp8WvaRCFnPhYPom3jJggRBNLdRdRSpciLcRdhpx52Yf99kvaZAs bZNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si14592884edr.585.2021.05.19.08.21.21; Wed, 19 May 2021 08:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244425AbhERGvo (ORCPT + 99 others); Tue, 18 May 2021 02:51:44 -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