Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14283536pxu; Mon, 4 Jan 2021 19:14:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwePYACNU84Ws8xerPuF+lyN/JJiWAZHYC3F0MQX2Vm/cw2xLmQt+E1egycvn6/5ffP/vFr X-Received: by 2002:aa7:c253:: with SMTP id y19mr73074341edo.179.1609816490857; Mon, 04 Jan 2021 19:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609816490; cv=none; d=google.com; s=arc-20160816; b=Z/7+SbmIzKOe6G0pH3RHGIykkZOuPJdf9dqKk0eaJ3r/0ciPifzAj4j0VhXiXnXM5s ot/qJBgzOvf3jg53lNaQVeAPekPGV/5bbzcgcNmFXqIXXj18GdwpR/KTLBivZ6swHHlg 7rwxYGmDmTRWgFbU2ot81f4Lvzb6nkDk6LM9WacqgxOZWsKSRwCqYNuCNSwUpkavlhiR 2wZDOWBuERCn8mU6TDN8IbKzBJ5Te2NaJsgxnb7q54zpIQ79Gb2FMSJO1rCgCxRwlJxj YGjdtsheyY3lp6voFHt2Z9R2X72NWiK2Fd6Azz2d8lNetjF1Ou74YsLWlIxrWf8mJaAb 8O9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yvoSzg344dN/N+DqfiYgrY7pc/I34P5dAbpEpkhBIJI=; b=kH+UyiqyFSlqP5sRLLicE++4TpG8xNSqqDgrjA35kjOuSd7cD+Giom4Exc2YgOl0F0 Kmcmv7Pbhz2kNFhDsscfRxowzoblBEvdmVVBMksrYyx9sKvrjJG7Ck5O3Nws8AOTC+0d bO88nH09zb8D01UUA2NL1c57i/tFd8bMICIYXS1gfeeEFgCXp0w1IgPfUi0Dc2jEXSHB CrcZ3VdFqOcp6JHmZm2N5IFfksAEXUS9qpiMdORjYZvh+EJlsAP/XqeqeKTH7MK72bBQ T9X9e72yQESdmeit7o3ru0HhUM5nABVHj4g2KGtxovmopCrCSjM71yfO8B7XVYyuFp1C +NUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=rQJxNXH+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm5si31739610edb.21.2021.01.04.19.14.27; Mon, 04 Jan 2021 19:14:50 -0800 (PST) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=rQJxNXH+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbhAEDNh (ORCPT + 99 others); Mon, 4 Jan 2021 22:13:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727716AbhAEDNg (ORCPT ); Mon, 4 Jan 2021 22:13:36 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24134C061794 for ; Mon, 4 Jan 2021 19:12:55 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id jx16so39416709ejb.10 for ; Mon, 04 Jan 2021 19:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yvoSzg344dN/N+DqfiYgrY7pc/I34P5dAbpEpkhBIJI=; b=rQJxNXH+GsHO6zvvAN5QlpD7RI9zvbxjhJhWT5bkV5oIVVbWJZULG+2WWV/lEPCGPb 5LE9xwHUQp0sZ1hLMQf29jNLuIQZzVSzp8+Us0QEWtzd8y1GcaQ94MRaxCxsNS9qwF8U arYIf7Qri4YXmEU4dAVC5ouH+3+/w53ZK0cRc2Zgz5k5cI89Vmc2Bwn1F4cqsfRs7nHN ACSKhEPrnZS9J6vx+5lKjYWXuQ1gG6FXAXPsdtyEqEvKfkAacpVqZ1MHVWBPbOXHi7Zv an26E0lvekKWUDEGvpluK3itPhuYNM9RJIs9AkkkeMyy7TOAKGTfbWMrOsacHHDv4UP5 FGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yvoSzg344dN/N+DqfiYgrY7pc/I34P5dAbpEpkhBIJI=; b=seNLWIpl4MN2BS6phdPesIG9ZzSN3tzhRBoCgqvfZd1IsWJQKXyDvQzYDMk/MfdBdQ 2dH8elPV1HlOHkwHNcwBVcpLIV7DBqe6QMG9rTHcpKw9J/ECVRKqVaGIYRahII+qrqnQ +PhGFx5JozJ2axq/xm37hmcVYjBWx5uWy4FI+lXUgBC4/TFwx/LMh18zS3MwgMqxwulB cIXnReZKpmCon8uhvuarI+S0aiNzy4ZzGxF1SVppog8XKFx8IrYLJdE7T6mk99tN45XH qfe4Zoz3LiYCMFAWU8UwfgtK1nAVgdQKNJLpzv3/xr3nCEGAroqYMHmAPyyllhIYVIPF qu7A== X-Gm-Message-State: AOAM533JMgu1SUVTPmdEKZZWah4Bx6192/TL78I95/xRMFAdo3Ct9fk7 GHATnh+gUhAe/XawORIHW6mvfyXIMkiDxr3cDxgWZQ== X-Received: by 2002:a17:906:a3c7:: with SMTP id ca7mr71056515ejb.523.1609816374613; Mon, 04 Jan 2021 19:12:54 -0800 (PST) MIME-Version: 1.0 References: <20201218162817.GX552508@nvidia.com> <20201218180310.GD5333@sirena.org.uk> <20201218184150.GY552508@nvidia.com> <20201218203211.GE5333@sirena.org.uk> <20201218205856.GZ552508@nvidia.com> <20201221185140.GD4521@sirena.org.uk> <20210104180831.GD552508@nvidia.com> <20210104211930.GI5645@sirena.org.uk> <20210105001341.GL552508@nvidia.com> <20210105015314.GM552508@nvidia.com> In-Reply-To: <20210105015314.GM552508@nvidia.com> From: Dan Williams Date: Mon, 4 Jan 2021 19:12:47 -0800 Message-ID: Subject: Re: [resend/standalone PATCH v4] Add auxiliary bus support To: Jason Gunthorpe Cc: Mark Brown , Greg KH , Alexandre Belloni , Pierre-Louis Bossart , alsa-devel@alsa-project.org, Kiran Patil , linux-rdma , Shiraz Saleem , Martin Habets , Liam Girdwood , Ranjani Sridharan , Fred Oh , Dave Ertman , Jakub Kicinski , Netdev , Leon Romanovsky , David Miller , Linux Kernel Mailing List , Parav Pandit , Lee Jones Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 4, 2021 at 5:53 PM Jason Gunthorpe wrote: > > On Mon, Jan 04, 2021 at 04:51:51PM -0800, Dan Williams wrote: > > On Mon, Jan 4, 2021 at 4:14 PM Jason Gunthorpe wrote: > > > > > > On Mon, Jan 04, 2021 at 09:19:30PM +0000, Mark Brown wrote: > > > > > > > > > > > Regardless of the shortcut to make everything a struct > > > > > platform_device, I think it was a mistake to put OF devices on > > > > > platform_bus. Those should have remained on some of_bus even if they > > > > > > > > Like I keep saying the same thing applies to all non-enumerable buses - > > > > exactly the same considerations exist for all the other buses like I2C > > > > (including the ACPI naming issue you mention below), and for that matter > > > > with enumerable buses which can have firmware info. > > > > > > And most busses do already have their own bus type. ACPI, I2C, PCI, > > > etc. It is just a few that have been squished into platform, notably > > > OF. > > > > > > > I'll note that ACPI is an outlier that places devices on 2 buses, > > where new acpi_driver instances are discouraged [1] in favor of > > platform_drivers. ACPI scan handlers are awkwardly integrated into the > > Linux device model. > > > > So while I agree with sentiment that an "ACPI bus" should > > theoretically stand on its own there is legacy to unwind. > > > > I only bring that up to keep the focus on how to organize drivers > > going forward, because trying to map some of these arguments backwards > > runs into difficulties. > > > > [1]: http://lore.kernel.org/r/CAJZ5v0j_ReK3AGDdw7fLvmw_7knECCg2U_huKgJzQeLCy8smug@mail.gmail.com > > Well, this is the exact kind of thing I think we are talking about > here.. > > > > It should be split up based on the unique naming scheme and any bus > > > specific API elements - like raw access to ACPI or OF data or what > > > have you for other FW bus types. > > > > I agree that the pendulum may have swung too far towards "reuse > > existing bus_type", and auxiliary-bus unwinds some of that, but does > > the bus_type really want to be an indirection for driver apis outside > > of bus-specific operations? > > If the bus is the "enumeration entity" and we define that things like > name, resources, gpio's, regulators, etc are a generic part of what is > enumerated, then it makes sense that the bus would have methods > to handle those things too. > > In other words, the only way to learn what GPIO 'resource' is to ask > the enumeration mechnism that is providing the bus. If the enumeration > and bus are 1:1 then you can use a function pointer on the bus type > instead of open coding a dispatch based on an indirect indication. > I get that, but I'm fearing a gigantic bus_ops structure that has narrow helpers like ->gpio_count() that mean nothing to the many other clients of the bus. Maybe I'm overestimating the pressure there will be to widen the ops structure at the bus level.