Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1090386pxm; Wed, 23 Feb 2022 17:53:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0iqUwjvezzLAvm/wh/XfGRxQP8uezSQsTEqHT7HVT8ghcZY3OZcRS2y81iwEmAZyqbxKL X-Received: by 2002:a17:903:3093:b0:14f:b5f7:45aa with SMTP id u19-20020a170903309300b0014fb5f745aamr300060plc.121.1645667595447; Wed, 23 Feb 2022 17:53:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645667595; cv=none; d=google.com; s=arc-20160816; b=ybBpHJqcs67OonYCGgE9tQoHCBV558zuPxi5jZt6YWjfCkkcVHC1duRhZtf44bahZW wdiVZx7i9s+5YKLiVOZP0Kdf2jica+GFP4aLJ6VQZmCVvBBZtrsP7A7/+kJ6BoMXAGn+ uWjMH03hPfr1g2HVxXp79GjEqIS/i0kxjDwaTx6DpjspqHu8WGYOScwwz3pqF5LGfjD9 /tTHUPr/nKcajjrzNspNP1dTyiSHspcuZ1/4cZro1ZRfFlOUEW7qpTRXjgcHhpt8vpcP O2KLW6GtnLAiU9HiRm9WGBnT7ia+6PdogSA7Ze/RAGMp0nWAaJgYCnSyRgUT4ALU2/ad PEcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=kY1Ql5jNd8+akOYr5MJM/nVmbSk1hVMt1XjyszBBYhg=; b=bcHwfE7WCTwHqI4JuYENoj0UlcuVSnpWQBfNjoN3URgdxX2O5e8hfdU/JDXXVEWA8b VLCpEdFTRVpMiaBryg3lrKoUSDba/CzOAqqyHTnAXlKaQSdcvkvp4xODr6+H198u8urX yoxtn4q4XFtYBmM/znl4Xms7fSE/7AVSodHNAplD5iwAG2T0p3T7VSivrv+Biw3thzdl dTFF8ztxWVf3qoV/IG2WVM7rNVKoOQgSiVGh55iG7CSLQRzF+r39YDMHqgDcvtHB+1QI X4EOUGYysDMoQ63jxQ88aVMLlPdq5QWjkanDjIbrS35it9iN2ptiPksp1f5fZYQS7wWM tpVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cxfiBDzV; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bc24si1299581pgb.462.2022.02.23.17.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:53:15 -0800 (PST) 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=@bootlin.com header.s=gm1 header.b=cxfiBDzV; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 382D320A94B; Wed, 23 Feb 2022 17:24:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243718AbiBWSBi (ORCPT + 99 others); Wed, 23 Feb 2022 13:01:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241790AbiBWSBe (ORCPT ); Wed, 23 Feb 2022 13:01:34 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057DB3E0DB; Wed, 23 Feb 2022 10:00:55 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6D5F5C0004; Wed, 23 Feb 2022 18:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1645639254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kY1Ql5jNd8+akOYr5MJM/nVmbSk1hVMt1XjyszBBYhg=; b=cxfiBDzVbh20mJFblTgbgSuxY4x1UQqa55dIjZA3KwnE3ugwHGCGW5i7Z7Ta3Cq93by9HE fxlU0Ng8WdMipwMjR5WjIXDUv17//5FECXpN8jH5TfPhCSrSoBEgpKfwRj2t9LVyLmuDvu kDAB8XZzuEZ25ksvEgj9oeomavBtwq4crhCfDGAkQ0wfR52RV7TF+PFpYJr2+h2uOEDa3i Kl8+OEgNIOQLmniGi/oUkjUYQ+cjf1ZZGURQEMvdhLux0Ny/NDS5RBJbwrcgDHBCIcTR1a k1PsYUP9FYxVeXkn+TuG7OpYUlCioSUWQxFQdp8tcgo9Y7PfrhKCgWqyOEc3xA== Date: Wed, 23 Feb 2022 18:59:27 +0100 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Mark Brown Cc: Andy Shevchenko , Hans de Goede , Enrico Weigelt , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Wolfram Sang , Peter Rosin , Russell King , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org, netdev@vger.kernel.org, Thomas Petazzoni , Alexandre Belloni Subject: Re: [RFC 00/10] add support for fwnode in i2c mux system and sfp Message-ID: <20220223185927.2d272e3a@fixe.home> In-Reply-To: References: <20220221162652.103834-1-clement.leger@bootlin.com> <20220222173019.2380dcaf@fixe.home> <20220223161150.664aa5e6@fixe.home> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Le Wed, 23 Feb 2022 17:41:30 +0000, Mark Brown a =C3=A9crit : > On Wed, Feb 23, 2022 at 05:24:37PM +0200, Andy Shevchenko wrote: > > On Wed, Feb 23, 2022 at 04:11:50PM +0100, Cl=C3=A9ment L=C3=A9ger wrote= : =20 > > > Le Wed, 23 Feb 2022 16:46:45 +0200, > > > Andy Shevchenko a =C3=A9crit : =20 >=20 > > > > And here is the problem. We have a few different resource providers > > > > (a.k.a. firmware interfaces) which we need to cope with. =20 >=20 > > > Understood that but does adding fwnode support means it should work > > > as-is with both DT and ACPI ? ACPI code is still in place and only the > > > of part was converted. But maybe you expect the fwnode prot to be > > > conformant with ACPI. =20 >=20 > > Not only me, I believe Mark also was against using pure DT approach on > > ACPI enabled platforms. =20 >=20 > I'm not 100% clear on the context here (I did dig about a bit in the > thread on lore but it looks like there's some extra context here) but in > general I don't think there's any enthusiasm for trying to mix different > firmware interfaces on a single system. Certainly in the case of ACPI > and DT they have substantial differences in system model and trying to > paper over those cracks and integrate the two is a route to trouble. > This doesn't look like it's trying to use a DT on an ACPI system though? Ideally no, but it is a possibility mentionned by Andrew, use DT overlays on an ACPI system. This series did not took this way (yet). Andrew mentionned that it could potentially be done but judging by your comment, i'm not sure you agree with that. >=20 > There's been some discussion on how to handle loadable descriptions for > things like FPGA but I don't recall it ever having got anywhere concrete > - I could have missed something. Those are dynamic cases which are more > trouble though. For something that's a PCI card it's not clear that we > can't just statically instanitate the devices from kernel code, that was > how the MFD subsystem started off although it's now primarily applied to > other applications. That looks to be what's going on here? Yes, in this series, I used the MFD susbsytems with mfd_cells. These cells are attached with a swnode. Then, needed subsystems are modified to use the fwnode API to be able to use them with devices that have a swnode as a primary node. >=20 > There were separately some issues with people trying to create > completely swnode based enumeration mechanisms for things that required > totally independent code for handling swnodes which seemed very > concerning but it's not clear to me if that's what's going on here. The card is described entirely using swnode that in a MFD PCI driver, everything is described statically. The "enumeration" is static since all the devices are described in the driver and registered using mfd_add_device() at probe time. Thus, I don't think it adds an enumeration mechanism like you mention but I may be wrong. >=20 > > > As I said in the cover-letter, this approach is the only one that I d= id > > > found acceptable without being tied to some firmware description. If = you > > > have another more portable approach, I'm ok with that. But this > > > solution should ideally work with pinctrl, gpio, clk, reset, phy, i2c, > > > i2c-mux without rewriting half of the code. And also allows to easily > > > swap the PCIe card to other slots/computer without having to modify t= he > > > description. =20 >=20 > > My proposal is to use overlays that card provides with itself. > > These are supported mechanisms by Linux kernel. =20 >=20 > We have code for DT overlays in the kernel but it's not generically > available. There's issues with binding onto the platform device tree, > though they're less of a problem with something like this where it seems > to be a separate card with no cross links. Indeed, the card does not have crosslinks with other devices and thus it might be a solution to use a device-tree overlay (loaded from the filesystem). But I'm not sure if it's a good idea to do that on a ACPI enabled platform. --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com