Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4413259pxb; Tue, 5 Oct 2021 02:35:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcimWaWa5ASGmhqlUdK+qcQAZ7nQMG8409+PRf+OkDlmavDVven44gdhFwWzpS7pYF7nsS X-Received: by 2002:a17:902:7246:b0:138:a6ed:66cc with SMTP id c6-20020a170902724600b00138a6ed66ccmr4383002pll.22.1633426537370; Tue, 05 Oct 2021 02:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633426537; cv=none; d=google.com; s=arc-20160816; b=EowaDCcMEB2VQHPlW+z2cbJnUF2R5Erobgodh+XDQdZ8xBc6eOPPSpV1hbOERHo+8q LLJUxM2oWif1XT9BQmUDCgl7hKA5/hy9O7g86f7k5WBJKDEUvT7iJwCVy/tPYEvc0TRM j+Y9iDfBefcmDo6ywXPimb5kjfAbXb2pxfhlygBcXHSSZXjRnI/6AtWgPWHAdPSUV8+v vHQlcSdEsZYa9R8dbZzj/0dS8IVINooAembxuCzjF5SmFpHfNwASChvYhkPWD9gqZODk Ic9kA/RaiT1GzdPJ1FuL27C/F1HhzO3S5gUaE+TO87zlzObRicNBRHmBOuawob5Co9UP sfTg== 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:cc:to:from :subject:message-id; bh=NtTpMEcvneBKT6PjabOSZdhixpP2WSC7T3FTe4uIoRU=; b=A2i1bAKdZCkMW6tMqOXegBHNs57/deJkoA2BXk85c0az2M/fsH6idrfFObat0DaKd6 tBCpE1QARaUZknnQAbldtMHzlO0N0oWaR/to5pFJ3P8+xKF2ekCmevxg4IJMFlohHHi1 sEF97ASmRTdqiLLEVeria0ikoNB6IgwQ8uJSfEMzN25QVNBlGxNCw9QkSjJfu4eF8pFq 2Vs1ePu1RLu8oeme5K3U42oi9DEOKnSYESXhrAO7V6/UNlxCpKaZwL+77zrUQ+KXwuAB mSwGB0sly+bVR/IIlHsZsTaz6icSK8z6Tml4Uj7gGrKXVX+ccOSYDhqnlZXpQlHj0m19 hDew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si20655532pfb.223.2021.10.05.02.35.24; Tue, 05 Oct 2021 02:35:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbhJEJgL convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Oct 2021 05:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbhJEJgK (ORCPT ); Tue, 5 Oct 2021 05:36:10 -0400 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 019F2C061749 for ; Tue, 5 Oct 2021 02:34:19 -0700 (PDT) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXgpt-0004TB-7y; Tue, 05 Oct 2021 11:34:09 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1mXgpr-0003p8-Es; Tue, 05 Oct 2021 11:34:07 +0200 Message-ID: Subject: Re: [PATCH 3/3] reset: socfpga: add empty driver allowing consumers to probe From: Philipp Zabel To: =?UTF-8?Q?Pawe=C5=82?= Anikiel , miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, arnd@arndb.de, olof@lixom.net, soc@kernel.org, dinguyen@kernel.org Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tn@semihalf.com, ka@semihalf.com, jam@semihalf.com Date: Tue, 05 Oct 2021 11:34:07 +0200 In-Reply-To: <20210920124141.1166544-4-pan@semihalf.com> References: <20210920124141.1166544-1-pan@semihalf.com> <20210920124141.1166544-4-pan@semihalf.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paweł, On Mon, 2021-09-20 at 14:41 +0200, Paweł Anikiel wrote: > The early reset driver doesn't ever probe, which causes consuming > devices to be unable to probe. Add an empty driver to set this device > as available, allowing consumers to probe. > > Signed-off-by: Paweł Anikiel > --- > drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c > index 2a72f861f798..8c6492e5693c 100644 > --- a/drivers/reset/reset-socfpga.c > +++ b/drivers/reset/reset-socfpga.c > @@ -92,3 +92,29 @@ void __init socfpga_reset_init(void) > for_each_matching_node(np, socfpga_early_reset_dt_ids) > a10_reset_init(np); > } > + > +/* > + * The early driver is problematic, because it doesn't register > + * itself as a driver. This causes certain device links to prevent > + * consumer devices from probing. The hacky solution is to register > + * an empty driver, whose only job is to attach itself to the reset > + * manager and call probe. > + */ > +static const struct of_device_id socfpga_reset_dt_ids[] = { > + { .compatible = "altr,rst-mgr", }, > + { /* sentinel */ }, > +}; > + > +static int reset_simple_probe(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static struct platform_driver reset_socfpga_driver = { > + .probe = reset_simple_probe, > + .driver = { > + .name = "socfpga-reset", > + .of_match_table = socfpga_reset_dt_ids, > + }, > +}; > +builtin_platform_driver(reset_socfpga_driver); If we can just let devlink delay all consumers until the empty driver is probed, does the reset controller have to be registered early at all? regards Philipp