Received: by 10.223.176.46 with SMTP id f43csp48626wra; Fri, 19 Jan 2018 13:35:30 -0800 (PST) X-Google-Smtp-Source: ACJfBotn9RP9DFO8fJ5Dn/Wmh1hPXeaqQARw5Ifm4Jj/Iyfil5TdkWjOT8M88FWuD+eYEwhc/k7r X-Received: by 10.98.64.208 with SMTP id f77mr18106482pfd.157.1516397730845; Fri, 19 Jan 2018 13:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516397730; cv=none; d=google.com; s=arc-20160816; b=oZBs9+xPlfzutRFAKR8XawPU04xlHADWnzfFTaD2TgFAo9kAFQjba9nLmtuZjFbjF7 GHh1S+auVZXPRPVZ/TJ58Lx3rBYh5zO9ijNpQcrq9bS1hBSUlXSHdUcXTfiKOVvIggtZ qmkx98cyLLKc20C9oUDUgt2QZYLrbeuz7ACiGKieZEkQuisGvdD6b5vojoV2iB5I7rUG cAuVhaB/fa+Wu2TamVxxla2+i/qHKx8g1JYwYtD/b/aKZ6cYO83rXOxjNDhYhIM5mNLE ag3knOfDfz9WjhbXQOAdHCkXK8mfIZMm6bjXYf1AtiZKZHeJbx1nfTh9T5qMeloLyWAu KUYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=KsG5Sr4nGSSI49liA1BAGi6aDceUjr4RJVhIc6kwWYQ=; b=w0xSTMsLnMQPJQoMkK427+rlZc1jzqq8doAUSUaHk8y56H/hKGInKcAb3BrUpQRF9q JqL5E5/khKR1BkVVt91vo83hUR+/LHrDHg4KVZUbfaIcvOgJn5Rxpl+JVKnPppOAU9Qa wDrrwtzSNxFamK5IFwol449CmDNIqMo79AuAnJA06/0pbLBzVJN+jsqNCe1YOq7N3Ucl Ku5fNNeHfX+fiv0F7PGdz2gecIPhdTTRiEfoGWo1GxdP0yJNpBpZdtVkpxnn8PW6ZXBG ebep86TugXRi2xiqIK3KvFQwf5Cz56p13UsM15sasghoHy8clPPaWF9zrQMWUCFyk8Kz KAWA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si8807664pgn.325.2018.01.19.13.35.16; Fri, 19 Jan 2018 13:35:30 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756562AbeASVd1 (ORCPT + 99 others); Fri, 19 Jan 2018 16:33:27 -0500 Received: from muru.com ([72.249.23.125]:50368 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754263AbeASVdU (ORCPT ); Fri, 19 Jan 2018 16:33:20 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 93EAB80B8; Fri, 19 Jan 2018 21:33:26 +0000 (UTC) Date: Fri, 19 Jan 2018 13:33:10 -0800 From: Tony Lindgren To: Suman Anna Cc: Philipp Zabel , Philipp Zabel , Paul Parsons , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, Dave Gerlach , Mark Rutland , Nishant Menon , Rob Herring , Tero Kristo Subject: Re: [PATCH] reset: ti-rstctrl: use the reset-simple driver Message-ID: <20180119213310.GA4180@atomide.com> References: <20180116011159.1386-1-tony@atomide.com> <1516095054.9022.1.camel@pengutronix.de> <20180116150314.GC4042@atomide.com> <20180116232243.GD4042@atomide.com> <10dab35c-9c79-5a77-0654-1e99621e4c0f@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10dab35c-9c79-5a77-0654-1e99621e4c0f@ti.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Suman Anna [180119 20:23]: > On 01/16/2018 05:22 PM, Tony Lindgren wrote: > > The RSTST registers mostly tell the device internal reset reason > > like watchdog reset for an accelerator. I'm not sure how the > > API for those would look like, do you have some ideas? > > There are multiple RSTST registers, each of which with different bits. . > The PRM_RSTST is the one where you can catch the reset reasons (along > with few others), but otherwise most of the other IP-specific RSTST > registers capture the local reset status. The RSTST behavior is somewhat > similar to how the softreset status is tracked on each IP's SYSC/SYSS > registers. It does tell the reset status for some software triggered > resets in RSTCTRL, and can have additional bits as well for some PRCM > triggered h/w resets (like RETention reset). Hmm so are you using these "additional" software status bits? If the other bits don't matter, and the RSTCTRL reset bit has a matching RSTST bit, then we could just read that bit back in reset_simple_status and have a separate compatible value for those like "ti,rstctrl-rstst". > > Hmm, aren't you currently just reading the RSTST registers > > directly for remoteproc etc? > > Nope, all the PRCM related registers are hidden away underneath the > hwmod layer, so the only code that I use is pm_runtime_{get/put}_sync() > directly and omap_device_{assert/deassert}_reset() through pdata-quirks. > Take a look in drivers/iommu/omap-iommu.c and > arch/arm/mach-omap2/pdata-quirks.c (functional in mainline for OMAP4 and > OMAP5 DSP/IPU MMUs). OK, sorry I was thinking of the CLKCTRL IDLEST that are directly accessed :) > > And then we also have the CONTEXT register that tells if module > > context was lost during idle :) The API for that could simply be > > bool device_context_lost(struct device *dev) to describe that > > kind of reset. Or it could maybe also use reset_control_status() > > that returns -ECONNRESET? But then what resets the context lost > > state as we don't need to reset the device? > > I am not sure why the CONTEXT register belongs to the same discussion as > the reset registers. In any case, I don't think any of the current code > relies on this (other than incrementing the debug counters). Well they are in the same PRM instance, and behave the same way as RSTST :) They are like interrupt status registers where you can read the state and write to clear it. I wonder if we do really have a proper PRM interrupt for these too, Tero? > The OMAP IOMMU would be a better test given that there's no in-kernel > sgx module and we are not sure if the out-of-tree driver is functional > with these changes. > > I have some unit-test code at > https://github.com/sumananna/omap-test-iommu.git > > You would need to add a test node to DTS with reference to the MMU you > want to test. OK let's do some tests on that, I'll take a look at doing a dts file over next few weeks. > If we are exposing all the other registers directly to client drivers, > then the client drivers can use the reset API directly. But if other > registers are hidden away underneath various frameworks, then we have > some sequencing issues. Right that needs to be checked. For ti-sysc driver we only need to care about the rests that are needed to read and configure the interconnect target module. The rest can be handled directly by the child device drivers hopefully. > Tero had done a series sometime back using notifiers to take care of > these sequencing steps, but that was deferred pending the other hwmod > cleanup. Last reference that touches it is here, > https://marc.info/?l=linux-omap&m=147279610902646&w=2 Yeah the resets can all be device driver(s) now that we have the clkctrl clocks usable and should have ti-sysc usable for v4.17. Regards, Tony