From patchwork Wed Aug 7 12:46:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 11082081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D05FF14F6 for ; Wed, 7 Aug 2019 12:46:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEEA728161 for ; Wed, 7 Aug 2019 12:46:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B33DC2898C; Wed, 7 Aug 2019 12:46:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5384828161 for ; Wed, 7 Aug 2019 12:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387912AbfHGMqm (ORCPT ); Wed, 7 Aug 2019 08:46:42 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41250 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387777AbfHGMql (ORCPT ); Wed, 7 Aug 2019 08:46:41 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x77CkdRw013138; Wed, 7 Aug 2019 07:46:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565181999; bh=KAbZUDeuexNu3//QnTKuqxzTDirNtxOrFRB+0NLR58M=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SpwAvxuujfFnZjCIwg2DXQfPoUvLDNcAxj8+0G9uPd9cqOrebjl7s/vmkNszoKWaJ vL5gDa4h2nbFXVU0uVqhHejPQIJQOUKwhUUnpV0OHr+I3VhuO9XG8XvSVu0hzFfY8c DSL1yJiPfn3hRxM7TpMNOF0F/UGiWZLf1BbMBtYQ= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x77CkcVe046188 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Aug 2019 07:46:39 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 7 Aug 2019 07:46:38 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 7 Aug 2019 07:46:38 -0500 Received: from gomoku.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x77CkVoJ016945; Wed, 7 Aug 2019 07:46:35 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 2/3] bus: ti-sysc: rework the reset handling Date: Wed, 7 Aug 2019 15:46:04 +0300 Message-ID: <1565181965-21039-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1565181965-21039-1-git-send-email-t-kristo@ti.com> References: <1565181965-21039-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If reset controllers are assigned to the ti-sysc target-module, only ti-sysc is going to be able to control these. Thus, remove all the disable_on_idle flag usage, and assert/de-assert the reset always in the idle path. Otherwise the reset signal will always just be de-asserted. Signed-off-by: Tero Kristo --- drivers/bus/ti-sysc.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index ad9c6d3..e08125a 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -95,7 +95,6 @@ struct sysc { unsigned int enabled:1; unsigned int needs_resume:1; unsigned int child_needs_resume:1; - unsigned int disable_on_idle:1; struct delayed_work idle_work; void (*clk_enable_quirk)(struct sysc *sysc); void (*clk_disable_quirk)(struct sysc *sysc); @@ -1031,8 +1030,7 @@ static int __maybe_unused sysc_runtime_suspend_legacy(struct device *dev, dev_err(dev, "%s: could not idle: %i\n", __func__, error); - if (ddata->disable_on_idle) - reset_control_assert(ddata->rsts); + reset_control_assert(ddata->rsts); return 0; } @@ -1043,8 +1041,7 @@ static int __maybe_unused sysc_runtime_resume_legacy(struct device *dev, struct ti_sysc_platform_data *pdata; int error; - if (ddata->disable_on_idle) - reset_control_deassert(ddata->rsts); + reset_control_deassert(ddata->rsts); pdata = dev_get_platdata(ddata->dev); if (!pdata) @@ -1091,8 +1088,7 @@ static int __maybe_unused sysc_runtime_suspend(struct device *dev) ddata->enabled = false; err_allow_idle: - if (ddata->disable_on_idle) - reset_control_assert(ddata->rsts); + reset_control_assert(ddata->rsts); sysc_clkdm_allow_idle(ddata); @@ -1112,8 +1108,7 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) sysc_clkdm_deny_idle(ddata); - if (ddata->disable_on_idle) - reset_control_deassert(ddata->rsts); + reset_control_deassert(ddata->rsts); if (sysc_opt_clks_needed(ddata)) { error = sysc_enable_opt_clocks(ddata); @@ -1543,14 +1538,7 @@ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) return error; } - error = reset_control_deassert(ddata->rsts); - if (error == -EEXIST) - return 0; - - error = readx_poll_timeout(reset_control_status, ddata->rsts, val, - val == 0, 100, MAX_MODULE_SOFTRESET_WAIT); - - return error; + return reset_control_deassert(ddata->rsts); } /* @@ -2449,9 +2437,6 @@ static int sysc_probe(struct platform_device *pdev) pm_runtime_put(&pdev->dev); } - if (!of_get_available_child_count(ddata->dev->of_node)) - ddata->disable_on_idle = true; - return 0; err: