From patchwork Wed Aug 7 12:46:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 170748 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7098064ile; Wed, 7 Aug 2019 05:46:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtP6af9AF0qFdgE9co9MKTWOU4eVQi6uCgUWwOXOF6yjPCu7SW8zr8ExGPU6dr9eB3e6AI X-Received: by 2002:a17:902:8a8a:: with SMTP id p10mr8232002plo.88.1565182000576; Wed, 07 Aug 2019 05:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565182000; cv=none; d=google.com; s=arc-20160816; b=ShVWr0Y+hbjVs5lSsBDlwtyLOQP/zD1Pmlnum/sQF8PqosinTkRMqydAaEsgDVYwKT 7lWVpMi0k/idMF2jTRJ8phd5JsUNXp16pl+cDO82q8i3rtDX7IzK97PDqqHXD4maDAVT cgP0BGXM1e7nitabHJTWroho9qYT9ienL4/agC/S00OIREKmcVSxC1oFnRwzka0MluS2 3DAfM/Uqn/LLUYawKFoia1IQeejGGXBBL6CNr3WP5CbYwaY0C6IZ6zdZQWkJYiL6arpb AIVapUcboUNNqnC5I30GT0N3vdYBDvW8O0yTN6H2kvY6bn9RzFbskUkQ8gExQ7cifIQM PAHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=go1rEFtGevssljUuoQMcTiduz8S4vZ6Y+2SOQxAcj8k=; b=NMPg2x7mgXEXXq0FiSByPHXqEVaZqmi+f8++CQaL7Gl+COBMsQuzDsUa5B2sp/jd7U fDk2wtmgx8DGnOo2BcpHZDJcTxNevGcBFnhJB1NO18fO+OQpusVrpxdMOTkl/o90yuxW o2qehutuen/qfmh0nl2RgAngPUHQsnW4k/H59bGHAj8wI3HiqAOibKLfDtkv52K/epAY WP5Gp45se0PsNpMgbO1p+nFlzLs0c4GrUzrRkpAHjlCEZ+49BSdDBvfZmUdzVmOr8fNJ qfFNRBk8zMGS4ycKeO1h61QI+8kOkET2rnyAWHFXvau8SlRb2RuKSLFtjH/9Y7yEoJDi VAkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=km6RONXq; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si18168285pjq.0.2019.08.07.05.46.40; Wed, 07 Aug 2019 05:46:40 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=km6RONXq; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387911AbfHGMqj (ORCPT + 28 others); Wed, 7 Aug 2019 08:46:39 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:42622 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387777AbfHGMqi (ORCPT ); Wed, 7 Aug 2019 08:46:38 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x77Cka81067113; Wed, 7 Aug 2019 07:46:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565181996; bh=go1rEFtGevssljUuoQMcTiduz8S4vZ6Y+2SOQxAcj8k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=km6RONXqRJ+XTbEbIiI0tfyl4ZxMxu4u+d4NbdUepxxw/t33a5Cqb4cqk2JpX4eC/ tP/OZWxpOxcsLo/Qms4b6umkMDIPo5SvDwFggSfKTMk84sEFAq1cLjaHLDum3LX3xh LRtFrub/2z8DKny+cHxbuTGc5u7paLX/KaMHFKsk= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x77CkaaS018291 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Aug 2019 07:46:36 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE111.ent.ti.com (10.64.6.32) 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:35 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE106.ent.ti.com (10.64.6.27) 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:35 -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 x77CkVoI016945; Wed, 7 Aug 2019 07:46:33 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 1/3] bus: ti-sysc: re-order the clkdm control around reset handling Date: Wed, 7 Aug 2019 15:46:03 +0300 Message-ID: <1565181965-21039-2-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Parenting clockdomain for the IP should be enabled during the reset handling logic, otherwise the reset may not finish properly. Re-order the clockdomain control logic to avoid this. Signed-off-by: Tero Kristo --- drivers/bus/ti-sysc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index e6deabd..ad9c6d3 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1091,11 +1091,11 @@ static int __maybe_unused sysc_runtime_suspend(struct device *dev) ddata->enabled = false; err_allow_idle: - sysc_clkdm_allow_idle(ddata); - if (ddata->disable_on_idle) reset_control_assert(ddata->rsts); + sysc_clkdm_allow_idle(ddata); + return error; } @@ -1109,11 +1109,12 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) if (ddata->enabled) return 0; - if (ddata->disable_on_idle) - reset_control_deassert(ddata->rsts); sysc_clkdm_deny_idle(ddata); + if (ddata->disable_on_idle) + reset_control_deassert(ddata->rsts); + if (sysc_opt_clks_needed(ddata)) { error = sysc_enable_opt_clocks(ddata); if (error) 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: 170749 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7098129ile; Wed, 7 Aug 2019 05:46:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/1uHtwf8HAgewer5WCFO/fbK66gAdVHOGvLe+q42+TPQ5PGpNonAT3vVnSbYg8Kw8bEGY X-Received: by 2002:a17:902:b696:: with SMTP id c22mr8000569pls.305.1565182003944; Wed, 07 Aug 2019 05:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565182003; cv=none; d=google.com; s=arc-20160816; b=o29dzk6bbGI4KIXBeyHCYVFlrzTGuJze2ixf2StFeQcPsPRJdLTtyHaOOavrf+dQPn q+6ZtsZBpSorUX6T6ayLFvi0VudG8SDRhOEf+yskCmOTpmdCrevIw4Q00Q1LQxezGD+i HzrwUAAoY1Bik3mfaUblk3Twf2crFYDXOsQLNbpJlgSkME6l09aeAHZRxx8gr/SDuAW4 aSIGETLhye/Q0l299PF3qbzfo6+v0c9Nv0fN0lCe+6lARqimphN+wz/KFfRjc8oBhC3w WdpdqsZNvQdyK/jg0HyIaZaEf7FfkMFQttRIrflE8rnoZaQJoNok42wr5EO0licIlrzl KZ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KAbZUDeuexNu3//QnTKuqxzTDirNtxOrFRB+0NLR58M=; b=cjNXMTMJymVszceZwhDh7Ra2MAuuR64982Ps7dAysbGf3EHcsQrVaWO5dmDtJe7YDe p7XejcCYkkdlEFtp7onzE57zNp1i2u90DKqCEcSz+jlcAyxDCf0s7Utub/OgzQCskmGn LvX8PI8qZ6xpLV7KSp6Grq36uEs0fN1o7Hq5Ofrl5sgP3WxKvRBoZaGy630oAGmytIE/ ZaWkuGg4v16685WtWPCrNzAIIQ8/M84ohGCHVgGfHPfScrJD46WVVTUadnkIq6i4XGJ9 NGUysCoVmn6UasxXPQ2ruu06XtA0p9i14AYzxDOAe2S9tU2b6ztahJJA/OzyIVv7n27H JwHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SpwAvxuu; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y192si50521972pfg.172.2019.08.07.05.46.43; Wed, 07 Aug 2019 05:46:43 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SpwAvxuu; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387935AbfHGMqm (ORCPT + 28 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki 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: From patchwork Wed Aug 7 12:46:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 170750 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7098179ile; Wed, 7 Aug 2019 05:46:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBU+2YpUVD1tQZiMYBj7csI13jfgIJMtlPD85F8iKp9SO6ywE5D1O3U7ZD05Ja8xCMpxIR X-Received: by 2002:a17:90a:1785:: with SMTP id q5mr8176330pja.106.1565182006234; Wed, 07 Aug 2019 05:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565182006; cv=none; d=google.com; s=arc-20160816; b=cq+gAoQMz3ArzEWNf61kE/5Jhg58kCaPKetcBJRMwGVrXa/P4bZ511Zne7kMKwfLxv ebIH7kfsblp9YNJYcMKAQgSillZr52UtLydmyceQB0PacNkFX3nuTzxHl5/EU2COzVuc 47mm39HMLK1fNYfeIV23UtjzDezSRMZYIjzOI530dwhk+l7x5mKjc+OKtyNOR4Oy0m+0 5Q0bSjAdV36Qb3ZDVI/ILhDgIx529gQyvYwHwneEi9RJXcQaVeKNL7Nciqp1kCduz/oU wIpDV6MRYLGfuC7UGrGw1ZFJ8EGCppYlLBVq+fvqX8aG/Mkaa/9eyXpLsl5NU4LJWBQC K2HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=6j1tOWSB2UPgBl42npaD6Kf9DQxoOqSNF3OrDL024iw=; b=PzQcx6+zE16NHr2AfdyjSpH6zvJWR6jhRBPeqQ+e5tHiQ0rW5SUnWRGcN7uHoaifd4 IQJhCJxgX1+YiVCMJD1qpWSv+H7IAQmbPu0SVdAGD3r/y6JDs7rUajl49q+9RG3wQp9o YzALgZs6CQXd/k0/uma1IzBR4lb1BEZBg53ijcwtwU2ujrbC0AtdfybCoTLYSSh3c3zO EAvdQcDmF6IdrynvH5bqKu71oOQCtQHem/Pj9Zyt2zrE20DSTsoyS9qOIPMvz2cSQL9P ljmFte/QyLpV8zkKiXja0N+hF5Lvx5MPeNcIy9wttyniW3eJclXqSe1LsAn+N6ucd9QP iUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aSwBKfGp; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y192si50521972pfg.172.2019.08.07.05.46.45; Wed, 07 Aug 2019 05:46:46 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aSwBKfGp; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387824AbfHGMqp (ORCPT + 28 others); Wed, 7 Aug 2019 08:46:45 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41258 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387845AbfHGMqn (ORCPT ); Wed, 7 Aug 2019 08:46:43 -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 x77CkfSv013152; Wed, 7 Aug 2019 07:46:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565182001; bh=6j1tOWSB2UPgBl42npaD6Kf9DQxoOqSNF3OrDL024iw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aSwBKfGp1HOoYHwfIjeet7kcE/DmNvsL3bMsOIHG1wmq8EIZji+mAfUjettcDGuPi cVyyx8wyM+eXxRftD2MpZorNJ1zjfgtMV96PH5aD8/s7G/KnfMhkZQ7G9pQeeisv0G lwHABsJlbHWeSojgtR/uRQ2H95s0PEkYUd9qqXv4= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x77CkfFO046199 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Aug 2019 07:46:41 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com (157.170.170.26) 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:41 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE114.ent.ti.com (157.170.170.25) 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:41 -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 x77CkVoK016945; Wed, 7 Aug 2019 07:46:39 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 3/3] bus: ti-sysc: allow reset sharing across devices Date: Wed, 7 Aug 2019 15:46:05 +0300 Message-ID: <1565181965-21039-4-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some devices need to share their reset signals, like DSP MMUs, thus drop the exclusive notation from reset request. Also, balance the init time reset count, otherwise the resets will never be applied post boot. Signed-off-by: Tero Kristo --- drivers/bus/ti-sysc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index e08125a..b30eb05 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -502,7 +502,7 @@ static void sysc_clkdm_allow_idle(struct sysc *ddata) static int sysc_init_resets(struct sysc *ddata) { ddata->rsts = - devm_reset_control_get_optional(ddata->dev, "rstctrl"); + devm_reset_control_get_optional_shared(ddata->dev, "rstctrl"); if (IS_ERR(ddata->rsts)) return PTR_ERR(ddata->rsts); @@ -1527,7 +1527,7 @@ static int sysc_legacy_init(struct sysc *ddata) */ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) { - int error, val; + int error; if (!ddata->rsts) return 0; @@ -1538,7 +1538,9 @@ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) return error; } - return reset_control_deassert(ddata->rsts); + reset_control_deassert(ddata->rsts); + + return 0; } /* @@ -2418,6 +2420,10 @@ static int sysc_probe(struct platform_device *pdev) goto unprepare; } + /* Balance reset counts */ + if (ddata->rsts) + reset_control_assert(ddata->rsts); + sysc_show_registers(ddata); ddata->dev->type = &sysc_device_type;