Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7152609rwb; Tue, 6 Dec 2022 01:45:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6bFxXvWNEhk4MKFy+p2E6LsZi5HMW9b1SWenssuKZXLPFUGP1F+kGHy/5duuNPdFRXpulI X-Received: by 2002:a05:6a00:2183:b0:574:2104:5657 with SMTP id h3-20020a056a00218300b0057421045657mr66570150pfi.58.1670319957776; Tue, 06 Dec 2022 01:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670319957; cv=none; d=google.com; s=arc-20160816; b=A0zq8JSDaiKMOMeuQ9vTTGQ4xib+L+HiER8JSqeF26Cp5RnmuU9y4Dz/jmjTQC8fEH zuhoAvCU42KOJj15bu5WzowWSWg48F6f66t+ggWDx7ll5ECX6qyMpIBvzMH8mm0INWEU MFmmiUhAXgmVsuBtsfQL5jnEzVlntQLBWPXqgFsF+a5h7tHDH9HAYEOhsoA7k9/U7OQO R+ZsgZxRUfx+/z30DGF4b4gju8BKObxbZGuqHS+yD1EXv2+Millex6pyi2YIX++8ieJR FpoP25Sd6t2M1q45Y1sNC5j+u8gaEaCb9UmglKDxom1dVYYAsnO6UFaFh6LFhppebj99 NIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id; bh=NxYyoaFJ4yElxYJs1RWmmHBMXKPOo9bkIOIAGlOCQps=; b=jR27MS9OypDa/8VHPW7Nc5ZfHxD3Cf61HvmEJdG5bX72jeNW4pGkaLnIWWYEfMI04Z 0iBJtxBw3wtgQKMOkZtlisQHBM6SG7WwIFQpdwKIZ4iBwp4stjtDpls2ri7M0+OnuYef 2SvG1c9+UDxv1toJjcFfUbqJ/WE4aYi7CNUxBDb68d/pVgj7ihWpLCz3AfeHramF/cwQ nl13jwWK3qWGD7E2fWnnCmdRMXrZqixZ55b+6T5GDBjOboGPa9KIVzMMsJlbUKmb95lI impiU7buo2F6yOqzSfGbr7ovCjXak8qBYQBLhukxqUIY+TTBrpMIrNsGEVBkHTbWoTyz wxVg== ARC-Authentication-Results: i=1; mx.google.com; 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 mw17-20020a17090b4d1100b0020d457c5083si21919080pjb.147.2022.12.06.01.45.47; Tue, 06 Dec 2022 01:45:57 -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; 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 S234823AbiLFJ0C convert rfc822-to-8bit (ORCPT + 79 others); Tue, 6 Dec 2022 04:26:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbiLFJZk (ORCPT ); Tue, 6 Dec 2022 04:25:40 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEBB1DF77 for ; Tue, 6 Dec 2022 01:25:36 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2UCh-000107-DT; Tue, 06 Dec 2022 10:25:31 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1p2UCe-002fDd-8C; Tue, 06 Dec 2022 10:25:29 +0100 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1p2UCe-0002Fh-EA; Tue, 06 Dec 2022 10:25:28 +0100 Message-ID: Subject: Re: [RFC PATCH 2/2] mfd: syscon: allow reset control for syscon devices From: Philipp Zabel To: Arnd Bergmann , Jeremy Kerr , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Krzysztof Kozlowski Date: Tue, 06 Dec 2022 10:25:28 +0100 In-Reply-To: References: <20221206073916.1606125-1-jk@codeconstruct.com.au> <20221206073916.1606125-3-jk@codeconstruct.com.au> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,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 Di, 2022-12-06 at 09:41 +0100, Arnd Bergmann wrote: > On Tue, Dec 6, 2022, at 08:39, Jeremy Kerr wrote: > > Simple syscon devices may require deassertion of a reset signal in order > > to access their register set. Rather than requiring a custom driver to > > implement this, we can use the generic "resets" specifiers to link a > > reset line to the syscon. > > > > This change adds an optional reset line to the syscon device > > description, and code to perform the deassertion/assertion on > > probe/remove. > > > > Signed-off-by: Jeremy Kerr > > I see that this will only work after the device has been registered, > but not for early users of the syscon framework that bypass the > device logic and just call device_node_to_regmap() or > syscon_regmap_lookup*() during early boot. > > It should be possible to solve this by adding the reset logic > into the of_syscon_register() function and using the > of_reset_control_get*() helpers instead of the devm_* ones, > but I'm not sure if that causes other problems with probe > order, or if that helps at all, if reset drivers already > require the device subsystem to be running. > > Philipp, what is the earliest point at which > reset_controller_register() can be called? Is that > possible before postcore_initcall() or driver_register()? 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. However, reset controllers that choose to register early without creating a platform device may run into issues with devlink inhibiting reset consumers' probe [1]. [1] a1467faa1041 ("ARM: imx: register reset controller from a platform driver") https://lore.kernel.org/linux-arm-kernel/20211005100618.730907-1-p.zabel@pengutronix.de/ regards Philipp