Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp561649rwb; Wed, 7 Dec 2022 02:03:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ILW/11p2s6T375KkmFAOmtWLqzePwOIX4BHuPGLLYEvK6jg9ZQ1uetiOY4TpuLaUXh1Y6 X-Received: by 2002:aa7:dac9:0:b0:46a:be65:4906 with SMTP id x9-20020aa7dac9000000b0046abe654906mr49381121eds.207.1670407396551; Wed, 07 Dec 2022 02:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670407396; cv=none; d=google.com; s=arc-20160816; b=IN6kAnUZqHdYV4dpXP1p3q99MeuX/uyTGSxOWPvWReg5VL1raLwJ/Tx+qujhLr8s/F Ygycq8MczkMNBnDpNU8HZ9+80nrjELI3jVtLUas9Q1JLX3/vut2lixDUDPwwsIoIH/ao ciMWJzRh/pl3LLPghkxYBQV9AO5V9NpclqViXfQ4BC72MhAz4ATuc9fQVkfNY3JU4+aK ITfdWFvqIlJMgPmPtKum/xMWK2kcMQ+7nfQJE4GBDlqFvO0fkJUUEjNZB/jMgycxeIs6 ghYovMnhzrvxRdrr8P5JagcuaJs/AfTLo7TOr5CljN5V+COPjNQT4kIH4MCcVv3b7HEA lPOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=nlpaUoviu+Qxrq04vf4bc0HEZWMsaQTQBqwbNWHZ6ms=; b=iQAsmrOde3ZWxOiiazc2vmXVW569vC2zQRQf7k2SSf64FjfjFJvIyMKtsuD71yghi0 Zs4gwiBi9oDhd6xUIESvIFCzxfQghbOhdgwPRkKDaKTcZFQ9MlQFaUPVQzu3tN4y/wAs ThiTEUVZWLXzbatOAL+bWRzG9AsPbemlwn4zgP3IT/iEmrHYUFbQcCqu+lLMLbND+JyK Wf5hVJUn24DFZG4tuZWb3F1dRM2JsyZZEdG+Wftq1himUV/RMoRuWPW0opokgMyZbj7H mnHOaOGY9ZyFSFRN6+GbGHWlcrPRj61cEKpx6ksr9sV7qj6VBgbXOgEhQEyXVoXMfEvy /gyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=MpfQHCTP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XswPz6dv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht15-20020a170907608f00b007c0e7acd184si7317578ejc.507.2022.12.07.02.02.57; Wed, 07 Dec 2022 02:03:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=MpfQHCTP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XswPz6dv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiLGJA3 (ORCPT + 76 others); Wed, 7 Dec 2022 04:00:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbiLGI75 (ORCPT ); Wed, 7 Dec 2022 03:59:57 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3DE1D0F2; Wed, 7 Dec 2022 00:59:55 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id E11FC32009BE; Wed, 7 Dec 2022 03:59:54 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 07 Dec 2022 03:59:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1670403594; x=1670489994; bh=nlpaUoviu+ Qxrq04vf4bc0HEZWMsaQTQBqwbNWHZ6ms=; b=MpfQHCTPCVZ5PMA1MVdiTU4cpL b7hcJcR7JCZTCagfZKygFWH01hsgklXSN1ZtnT1WDYjQtHT8aUdFb1jsnL9PBOFf s01MGjPswaQDgg4boZsMBQeGNESofWLOUpFYL3tWm0aE6Xo16VK24uyao0p/6Lka NNvRlrCHpbW8SPX+egI1onJVJ6BVTIxh43Dbw3TzVGyEBjFCQPVxuZK8eVEzwPmk hU9A+diO31bx1q014tEJLy6eAJ5rOQtYAl+2ADb/Ie+Up7rXXQ39I9XcvXKv8rC2 jWbomNz7RXwS6vaBdHjKPykdkJ743aDNhuDP0pgxkjQHuPJIkAnh2algjznw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1670403594; x=1670489994; bh=nlpaUoviu+Qxrq04vf4bc0HEZWMs aQTQBqwbNWHZ6ms=; b=XswPz6dvx8NTWZqmrWKFxTUZoCvqW0jR48oaFW4gXXIZ vk05CIx8hEmrOCGShjag31JtgCv8JVHI7Hhlj6IPkM2UZkItbPGvcFlCfquFVGfd mz5afEL7EQVeVxuyM2VQt9IXnN0y/dtbrFhvsaQ2oZpoL0B5tyK2rFaPFxN6WU/u Kfigz9sbn40/ozpuLi+LQlZ+4/lh5/OR2h475rxwQ/uwKTot1BG1cq1cGbGOj9xM MHYI3/UsL6FDi9BAeeKvL1X9y6CnJ3eHYWfEX/e/yGJS5n+ySlyokRrnJMvXAyIB 0QdcrSDAqFYJ+X/uVqILG3f3JcJVkTI0YQc3IRC+DA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejgdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffgeffuddtvdehffefleethfejjeegvdelffejieegueetledvtedtudelgfdu gfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D690AB60086; Wed, 7 Dec 2022 03:59:53 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <5a57e163-c705-4308-93ac-11e0cea2804b@app.fastmail.com> In-Reply-To: References: <20221206073916.1606125-1-jk@codeconstruct.com.au> <20221206073916.1606125-3-jk@codeconstruct.com.au> Date: Wed, 07 Dec 2022 09:59:32 +0100 From: "Arnd Bergmann" To: "Jeremy Kerr" , "Philipp Zabel" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee Jones" , "Rob Herring" , "Krzysztof Kozlowski" Subject: Re: [RFC PATCH 2/2] mfd: syscon: allow reset control for syscon devices Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 7, 2022, at 08:56, Jeremy Kerr wrote: > Hi Arnd, > > Thanks for taking a look a this. Just a question about the early > approach; I'm not too familiar with the internals of the syscon/regmap > infrastructure: > >> > reset_controller_register() only initializes a few fields in the >> > passed rcdev structure and adds it to a static list under a static >> > mutex, so there's not much of a limit. >> >> Ok, in that case I think we should at least leave the option of >> doing the reset from an early syscon as well. > > OK, sounds good - I'll add a direct of_reset_control_get_() in > the early of_syscon_register path, which should work in a similar way to > the clocks properties. > > However: this may conflict with the later platform_device syscon; if the > late syscon tries to of_reset_control_get_exclusive() the same reset > controller (because it's the same syscon node), that will (of course) > fail. > > Hence a question about the syscon infrastructure: how are the late- and > early- syscon registrations supposed to interact? Should I allow for > there to be two syscons registered (one through of_syscon_register(), > the other through the platform device probe), or do we expect that to > never happen? > > In case of the former, I can just grab a shared handle to the reset > controller instead, but I want to make sure that's the correct thing to do. Hmm, it's clearly not doing what I was remembering it to do ;-) Before 2014 commit bdb0066df96e ("mfd: syscon: Decouple syscon interface from platform devices"), it was supposed to be the same regmap in both cases, with the linked list being maintained to ensure we never get more than one instance for device_node. After this commit, I see that the platform_driver no longer matches syscon nodes from devicetree, but only those nodes that have platform_device.dev.name="syscon" and are created from board files. The only user of manually created syscon devices at the time was mach-clps711x, but that has been converted to DT a long time ago, so I don't even see anything using the platform_device at all. This would in turn indicate that we can completely remove the platform_driver code, but I don't see how your RFC patch then had any effect because it wouldn't actually perform the reset for any devices in mainline kernels. Arnd