Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4440870pxb; Tue, 5 Oct 2021 03:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzV9kiBe0DgxW4yIaplELr5ocAgDoguYZTxyvlQGx173OPXP8celtmHuM9opX1V/QBStIW X-Received: by 2002:a05:6a00:22c3:b0:447:b30c:ed36 with SMTP id f3-20020a056a0022c300b00447b30ced36mr31105939pfj.82.1633428804373; Tue, 05 Oct 2021 03:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633428804; cv=none; d=google.com; s=arc-20160816; b=NZ9fpxQkMVzBwqzbSr+0jK1Ou3uUYLGOEvbh7r2kBpKzOW8MCW7qjQYMRbpsX6xk5f YvmqFjSGMTX+kH1k2fvLdLxGQbCSW4VS9VCz6AmfJpBx0P51E2ZF7dHZpD70R7boq33b Y4+cryrceAtg+A+fd0r7NIea2PiVry6SM3xxBZ8kLi1O/vabuniUpD5pU71MjVi/JHaQ od+8rCb3psyfj/c3REsMSTp2uFT3o4yiEAAF47fBDkfNqsrsAGzOkzA8nefrwZiowNzy fph/LhxJWiMuOR7+s0w6AoR/7RKJwZiPi7Arg7QqgdnJEPAur8JnbtnlvTnjOw7Qc+p+ 04vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Fd2bVG3T2aDLLsUGg65DNy9VZxuxLh/QslDXMizwJK8=; b=PlO89N7v6NMASmocS0GvmzrohcSGnFkof9PwAbTao/+M+ztso55SOjO68/LXOTNcQT GXJHs4Ndbrzzw/vt4+YVWXcC7b3o+cpKCxVwS9Qz9N41yj4py5T+N86ph9Gpx9++QFGb 7m+F9sIZX5pcw1ebPTEnyljXJ4KQ91hpvCYafkzIaJPrDqxKxwWQVKkQReIUWOd+bDys QMbnGdQlvgqfsEwBBVQOgm+PYvWRb/kwbzPUY5OHvB1FC9TzoMyManeKPnmE9i5jDQrN J24m72XKsNB5PgQ8i1T3iw9g/grrStdOwoGrbUw2/Ck0xIhWw/rJtsvtJ5ZhynHrxBHA P2JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=Ez5mYoeE; 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 a186si20932679pfa.2.2021.10.05.03.13.09; Tue, 05 Oct 2021 03:13:24 -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; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=Ez5mYoeE; 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 S233732AbhJEKOJ (ORCPT + 99 others); Tue, 5 Oct 2021 06:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233365AbhJEKOI (ORCPT ); Tue, 5 Oct 2021 06:14:08 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34987C061745 for ; Tue, 5 Oct 2021 03:12:18 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id y15so18337460lfk.7 for ; Tue, 05 Oct 2021 03:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Fd2bVG3T2aDLLsUGg65DNy9VZxuxLh/QslDXMizwJK8=; b=Ez5mYoeEnxP72wgv6au1eWbZZvt7siRLWpI9GsKBKBLepayHvuXHhoBFqZfseuORyY h1HA3jABRlKS8tuWaG2UUN4XzRb4Jizd3n+k9ryDkBNUpWyPDxOui77+S9ZqKc3aD0eI IhRttz3xOc3IW3LwIjPPFZxivXeffhFA5txSbttH+iOS9g7NO3HrB8pvutVsiiQaPsIG 1ySZ3kqO9o7Bd1T6MoTMLAQEKlN8iKHV+m5My4Owt13LGlpQFTv1OWpU6AdxUVVKm/bP 7UXovG3irUPeGNxrJ6iwxCqh0qKa2utVcRhWtScOoJ2MkJj+6XNlVCKFmGij7agmbAVh KBXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Fd2bVG3T2aDLLsUGg65DNy9VZxuxLh/QslDXMizwJK8=; b=DDCfB0W1oKF4o0kOF7xE9RvuhqKy6gm0TABJZ9icWbzilhU29yrULq67db7kDHbrRv f3+pr3A0N+93QYjUXwl6OY+aCb3zK+aIuwfG14UE3HDtdRjgiTFOS2oicG/jvSOxWCT8 PdLSLOS5epoF1vcOFsNPaScUXXy0wYdxRDd6wfvV9CYSgYAmHQcdO1if+xHEI6AUI3sm 2sgg4Bx8kqmXnLciRkLSuxdgdKSw2wjviS3hgTA30ZSUo5G/jiJogD0xb47Qc1/0lkcM vXsqtwyBWLyKK9FwRt5ekqA2WsdQLTE4xe7bV77MivkLGB+pIdCe2UV0IusbJT4SnjCz NuJw== X-Gm-Message-State: AOAM532VlsciScJaTYNWn3LClYMktQnVF8r02ICZLJR14fu+55InDtyR HF3409hnptfN1QMenreVeHAMSQdjV8327RQRU+BpVA== X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr21300509ljp.44.1633428736539; Tue, 05 Oct 2021 03:12:16 -0700 (PDT) MIME-Version: 1.0 References: <20210920124141.1166544-1-pan@semihalf.com> <20210920124141.1166544-4-pan@semihalf.com> In-Reply-To: From: =?UTF-8?Q?Pawe=C5=82_Anikiel?= Date: Tue, 5 Oct 2021 13:12:05 +0200 Message-ID: Subject: Re: [PATCH 3/3] reset: socfpga: add empty driver allowing consumers to probe To: Philipp Zabel , 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, Tomasz Nowicki , Konrad Adamczyk , Jacek Majkowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 5, 2021 at 11:34 AM Philipp Zabel wrot= e: > > Hi Pawe=C5=82, > > On Mon, 2021-09-20 at 14:41 +0200, Pawe=C5=82 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=C5=82 Anikiel > > --- > > drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpg= a.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[] =3D { > > + { .compatible =3D "altr,rst-mgr", }, > > + { /* sentinel */ }, > > +}; > > + > > +static int reset_simple_probe(struct platform_device *pdev) > > +{ > > + return 0; > > +} > > + > > +static struct platform_driver reset_socfpga_driver =3D { > > + .probe =3D reset_simple_probe, > > + .driver =3D { > > + .name =3D "socfpga-reset", > > + .of_match_table =3D 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 I asked Dinh if the reset controller code needs to be called early: >That's correct. It's for one of the SP timers. > >On 9/16/21 6:13 AM, Pawe=C5=82 Anikiel wrote: >> Hi, >> >> I would like to ask you about the following commit: >>> commit b3ca9888f35fa6919569cf27c929dc0ac49e9716 >>> Author: Dinh Nguyen >>> Date: Tue Nov 13 12:50:48 2018 -0600 >>> >>> reset: socfpga: add an early reset driver for SoCFPGA >>> >>> Create a separate reset driver that uses the reset operations in >>> reset-simple. The reset driver for the SoCFPGA platform needs to >>> register early in order to be able bring online timers that needed >>> early in the kernel bootup. >>> [...] >> Which online timers is this commit message referring to? I couldn't find >> any information about this. Without this patch the kernel seems to work >> fine on an Arria 10 (with Mercury AA1 module). What's the exact reason >> a regular platform driver isn't sufficient? >> >> Best regards, >> Pawe=C5=82 >>