Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp973996pxb; Wed, 6 Apr 2022 05:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6Tq36dkO3TB0H0lI52a4neDk363cCVpMdT4hGGwqGYjyown5kSS235LVQKr6QkYhYhQTb X-Received: by 2002:a63:35c1:0:b0:386:3620:3c80 with SMTP id c184-20020a6335c1000000b0038636203c80mr6870889pga.327.1649249174546; Wed, 06 Apr 2022 05:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249174; cv=none; d=google.com; s=arc-20160816; b=D2z+QScnfF8z71PmuaqYem4DXKcVpBZFymNICFcla7OXG4LCKChpNAsQY7q7iqrdzU CCO5Xib3Ufa0Jul2aVULcJfYJD0+6ZaW9GyznGqWYiGf/OxXni+NhHkXnpBF2nHZbM4n wHorPm0ohTASevP9jKYmWr9iOdpWA+wzl4Itg1IBJKAXnZkSbu3ON9s9O1EBYudmmvRE kRCPG0Aq1lLCeDRERk/cWEGGgN5+pUq1kSP2Jjx31pA+TAvPgXaa/e2iMT0bu/8gP+IK nJ9t0rzb4eSu5iR692Yb5Wn5ptmgaiHUvaMvjIPkGBw9rMT9ASI36KciHxzc3hr35WTG 0LTQ== 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=dgxLB7KBPcoMWIp7zDjDHZFRjO0hDLRflaEpybns6pM=; b=XnlIM1A5PGgNZeq4F4SAdG0CISWEQH+BJ8BkMRaJpAlWaSVB3yKIbajqXVnN1grR2S gcfwSWkPj+8P0XwUJQ0w/igwSEoOYWHuHr5J6oaYCmX9Q9iFt7NGOXoBxyX2xbCjlDmT I0bHWYGiaKCw/Roe5OFG148G9NrwdCtC0uSQSSnJuiRKZtlrlsAIHG8YoEPucwNKXdj8 wDVwN6RGqBymw5glw96IYiEMsvzUKW6upXU/Wtk2ShEsHd1hzFFzH1ZwHhmUX+4OApXA n4ZvUNPXAnI3ZtvMAZ/SgBsq+qncEWE+2HxzBVBSb7y/FKH+POdO++q8Mq8In6iDrxGV z+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=btiVEPMn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l14-20020a170902f68e00b0015647a6fff3si16002431plg.78.2022.04.06.05.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:46:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=btiVEPMn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 841AC50800D; Wed, 6 Apr 2022 02:23:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849650AbiDFCjl (ORCPT + 99 others); Tue, 5 Apr 2022 22:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1453283AbiDEWct (ORCPT ); Tue, 5 Apr 2022 18:32:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB0217DA8C; Tue, 5 Apr 2022 14:28:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6EA23615C3; Tue, 5 Apr 2022 21:28:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD8F5C385A0; Tue, 5 Apr 2022 21:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649194094; bh=dgxLB7KBPcoMWIp7zDjDHZFRjO0hDLRflaEpybns6pM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=btiVEPMno2PRbyb8Ly/fD3AJOiiQO1/uEeojq7z8UtZ02Fq3z1MVU/xulx0tH7GYP f7lTLTl8W5jYza8Fp484gQGM1KfN1x/SUG2ob8Mj2lIynXN39eWJD+sTvlyLf2Pgbh SsaRN1gt1Zenj6nOGRRP1k97BAkhR++MsPEwy5gHUb+2IZup33qtL4a3O/Mx8TLVQF NJp81mxhklgT44e8z7/g1x5oWY2dRWC2dUg/hq9V8g4dbNbjdarKRBTSrjiM2Eiu/U dyPM0XsInN/ZimsPOXkBloJbnSSId84sLgEvbNY8P2iSD6TBRmjHhWU96ltEg5UjNh bG+m+n/zJ5AIw== Received: by mail-il1-f182.google.com with SMTP id y16so538411ilq.6; Tue, 05 Apr 2022 14:28:14 -0700 (PDT) X-Gm-Message-State: AOAM530Mc+MQ7T853Voa26KHy5LFC27FB5TuhWujV3eOzv2G7nMwyeOx OWun2lkgr7X45+B9huobgjJ72+v/zVgTCHL0Ig== X-Received: by 2002:a05:6e02:1685:b0:2c9:a9e9:846 with SMTP id f5-20020a056e02168500b002c9a9e90846mr2817768ila.273.1649194093891; Tue, 05 Apr 2022 14:28:13 -0700 (PDT) MIME-Version: 1.0 References: <20220324141237.297207-1-clement.leger@bootlin.com> <20220405092434.6e424ed4@fixe.home> <20220405175120.23fc6b2a@fixe.home> In-Reply-To: From: Rob Herring Date: Tue, 5 Apr 2022 16:28:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/3] add fwnode support to reset subsystem To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= Cc: Lizhi Hou , Sonal Santan , Philipp Zabel , Frank Rowand , Lars Povlsen , Steen Hegelund , Microchip Linux Driver Support , Thomas Petazzoni , Alexandre Belloni , Allan Nielsen , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, Stefano Stabellini , Hans de Goede Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, Apr 5, 2022 at 12:11 PM Rob Herring wrote: > > On Tue, Apr 5, 2022 at 10:52 AM Cl=C3=A9ment L=C3=A9ger wrote: > > > > Le Tue, 5 Apr 2022 09:47:20 -0500, > > Rob Herring a =C3=A9crit : > > > > > + some Xilinx folks > > > > > > On Tue, Apr 05, 2022 at 09:24:34AM +0200, Cl=C3=A9ment L=C3=A9ger wro= te: > > > > Le Mon, 4 Apr 2022 12:41:37 -0500, > > > > Rob Herring a =C3=A9crit : > > > > > > > > > On Thu, Mar 24, 2022 at 03:12:34PM +0100, Cl=C3=A9ment L=C3=A9ger= wrote: > > > > > > This series is part of a larger series which aims at adding fwn= ode > > > > > > support in multiple subsystems [1]. The goal of this series was= to > > > > > > add support for software node in various subsystem but in a fir= st > > > > > > time only the fwnode support had gained consensus and will be a= dded > > > > > > to multiple subsystems. > > > > > > > > > > The goal is describing a solution. What is the problem? > > > > > > > > > > What's the scenario where you have a reset provider not described= by > > > > > firmware providing resets to devices (consumers) also not describ= ed by > > > > > firmware. > > > > > > > > Hi Rob, there was a link attached to this series since there was a > > > > previous one that was sent which described the problem. Here is a l= ink > > > > to the same thread but to a specific message which clarifies the > > > > problem and the solutions that were mentionned by other maintainers > > > > (ACPI overlays, DT overlays, software nodes and so on): > > > > > > > > https://lore.kernel.org/netdev/20220224154040.2633a4e4@fixe.home/ > > > > > > Thanks, but your commit message should explain the problem. The probl= em > > > is not subsystems don't support fwnode. > > > > > > This is the exact same problem the Xilinx folks are trying to solve w= ith > > > their PCIe FPGA cards[1] (and that is not really a v1). They need to > > > describe h/w downstream from a 'discoverable' device. Their case is > > > further complicated with the dynamic nature of FPGAs. It's also not j= ust > > > PCIe. Another usecase is describing downstream devices on USB FTDI > > > serial chips which can have GPIO, I2C, SPI downstream. And then you w= ant > > > to plug in 10 of those. > > > > I also tried loading an overlay from a driver on an ACPI based system. > > Their patch is (I guess) targeting the specific problem that there is > > no base DT when using ACPI. However, Mark Brown feedback was not to > > mix OF and ACPI: > > I agree there. I don't think we should use DT bindings in ACPI tables > which is already happening. In this case, I think what's described by > ACPI and DT must be completely disjoint. I think that's the case here > as everything is downstream of the PCIe device. > > > "That seems like it's opening a can of worms that might be best left > > closed." > > > > But I would be interested to know how the Xilinx guys are doing that > > on x86/ACPI based system. > > They aren't, yet... > > > > > I don't think swnodes are going to scale for these usecases. We moved > > > h/w description out of the kernel for a reason. Why are we adding tha= t > > > back in a new form? The complexity for what folks want to describe is > > > only going to increase. > > > > > > I think DT overlays is the right (or only) solution here. Of course t= he > > > DT maintainer would say that. Actually, I would be happier to not hav= e > > > to support overlays in the kernel. > > > > DT overlay might work on DT based system. If I'm going to plug the card > > on an ACPI based platform (x86), I also want that card to work > > seamlessly without requiring the user to create an ACPI overlay. > > I agree, it should work the same way for the user. > > > If you proposal was to use DT overlays on an ACPI based system, doing > > so would also require to "plug" the PCI subystem when described with > > ACPI to "probe" DT overlays describing PCI devices, not sure this is > > something trivial and it would be PCI centric. > > Yes, this is the 2nd part I describe. I don't think there's any way to > avoid this being bus specific because bus specific nodes have to be > created. > > > > > I've told the Xilinx folks the same thing, but I would separate this > > > into 2 parts. First is just h/w work in a DT based system. Second is > > > creating a base tree an overlay can be applied to. The first part sho= uld > > > be pretty straightforward. We already have PCI bus bindings. The only > > > tricky part is getting address translation working from leaf device t= hru > > > the PCI bus to host bus, but support for that should all be in place > > > (given we support ISA buses off of PCI bus). The second part will > > > require generating PCI DT nodes at runtime. That may be needed for bo= th > > > DT and ACPI systems as we don't always describe all the PCI hierarchy > > > in DT. > > > > But then, if the driver generate the nodes, it will most probably > > have to describe the nodes by hardcoding them right ? > > No, the kernel already maintains its own tree of devices. You just > need to use that to generate the tree. That's really not much more > than nodes with a 'reg' property encoding the device and function > numbers. > > We already support matching a PCI device to a DT node. The PCI > subsystem checks if there is a corresponding DT node for each PCI > device created and sets the of_node pointer if there is. For > OpenFirmware systems (PPC), there always is a node. For FDT, we > generally don't have a node unless there are additional > non-discoverable properties. Hikey960 is an example with PCI device > nodes in the DT as it has a soldered down PCIe switch with downstream > devices and non-discoverable properties (e.g. reset GPIO for each > port). Here's a quick and dirty implementation creating DT nodes for PCI devices: git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git dt/pop-pci-nod= es Rob