Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1757936pxu; Thu, 17 Dec 2020 18:55:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaSfnT/Nnq25bj6jEnYW0/96YHVxn+aiTIIerDSNHie3Vb96ZauVNXVeKIYJBxQOP+UM7d X-Received: by 2002:aa7:cb49:: with SMTP id w9mr2368463edt.357.1608260135755; Thu, 17 Dec 2020 18:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608260135; cv=none; d=google.com; s=arc-20160816; b=G3PtxZR7iMf6oqaAOLCkWrvZlrLdimumdtRy+mm0U0n0myI72VhW6dlho4aDQMjcno 5LV2skBI0YtMoCZpDN99oSrB4NU4DivAaSaL3bF2lgNQfViVlUR5yIH+i4ANC30Q/Dx0 WwS436oCd19lA5hTsX7JdUiolNz2ETa4tyfGmVoY5/pvGVzPClHn4FABl5O0NZmu3a17 TuROnIoYU2pAKmOe+m0lllyOcW2P0Q0Px2d0mzHwFq5V1hL/nF0a2H8fGte+LovSv24R yrw3ucZOb1lvTjTjQ+1tyydeu2OdLgGQj8kj7F4BVXlnn/oGI98kYq40UQ7Gfqmd1hVv /XWQ== 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=9dgG7qudFm2M5ITbimg/EWCzHwUSe9U+CunlE6/jL+E=; b=jd/QXg4dYu2bVeVlPFqKTKduCiQ/ZguFMC+XiyqhuhddeHcI/pcwJDI8b+uzOYUFDE 8SSGo2QrA3/8NH9POp5Tbvdbp0CHmyVROCvKN1GXS/Ue/ZkvxnmkPN2YNhsZtb/mdUNx sDu5im/ukdT/u49W4lKdNEt2gb3dDY0WEpd4EP9/YYz8ZaMB+Wg0r8S3FQiX10WtAQ8L pjJXQIXIXo2IIfPJCrMxOoKlAaQBjdC88H51k9LUK3huSt55G7bxYClLXMrtTIknPYkP vGvffMoUTvEyU+NEIwiCRGeqqaGCZR1xGe1IaGQPjUYT3kGioxIRuFcygWHTI4QE+dko 30Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=K0iNceVw; 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 bz23si3561861ejc.600.2020.12.17.18.55.13; Thu, 17 Dec 2020 18:55:35 -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=K0iNceVw; 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 S1732314AbgLRCkr (ORCPT + 99 others); Thu, 17 Dec 2020 21:40:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731526AbgLRCkr (ORCPT ); Thu, 17 Dec 2020 21:40:47 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11FBBC0617B0 for ; Thu, 17 Dec 2020 18:40:07 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id b9so1066798ejy.0 for ; Thu, 17 Dec 2020 18:40:06 -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=9dgG7qudFm2M5ITbimg/EWCzHwUSe9U+CunlE6/jL+E=; b=K0iNceVwSaWAQkyefoafIL+r7jjBCygPntMyHwd3POvZ8g7YT3AyjHi/gqQvjRrJPp AQWvJ6QTr8tSOFjOEiKecyu618xXLtEzB37NYJTRWPBWh/iiWfJ5t/SN0pDlfSIXxTnW 8XQzV9vnsOMuQsRKnQA5Jq590u5DiEXtzkdJCh1ysSLMrEsG1R56M1pUe8CrRCb+AcvC cnxem06FxnKPRYauImA7ZiEd5hlHlH70gZYuIdvcL9ybSDCFbUcFzjRNwwgZivcciosw 8TUurj7TkNKk9PaAy3cONHdKYvZ8nYXBh9cejLzDWsfKSSXwUBWfA9pr0ceTS+6Hcm7W xQxA== 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=9dgG7qudFm2M5ITbimg/EWCzHwUSe9U+CunlE6/jL+E=; b=MBK8CqmNIAfoB+/46OfJoFrgWCRTA3Ika4rJILpn+2OUx8Ba+eEj5oc+c3HzA+91mn xuSkuV2V9pxJKoosb6JOC2IQM+DWIsy1uknKqhoibylryDceKWutqoWlRP4iDHTWBF99 7oTn1JU8eJYbfj02QBgvGppY6s9qNYvWdOUEmnSNBJihRbT5sytmcpO4iIMi26JfviS+ jBZ3FzXaOw2iuYtfIiaDv5Qa4Hci7k3CVqs98Wk2Yc9fyxq8rRyt80zRBy2Z4BpmRso1 V24vNa/QudTA9fdagUK5R/U/uNSKREu3lPxI0cCLePg8UsvYy5BBtynHZvSWZocVw1WL VJzg== X-Gm-Message-State: AOAM5309rm5TmtkLkGegzn0b5kxEAmURDvIGCEjSDUDG2oAajAGW/FEE CpuUDF0eesRUMFpwaw9PC8dkfTEhkI254Ya0D0oFEQ== X-Received: by 2002:a17:906:2707:: with SMTP id z7mr1965646ejc.418.1608259205621; Thu, 17 Dec 2020 18:40:05 -0800 (PST) MIME-Version: 1.0 References: <160695681289.505290.8978295443574440604.stgit@dwillia2-desk3.amr.corp.intel.com> <20201217211937.GA3177478@piout.net> In-Reply-To: <20201217211937.GA3177478@piout.net> From: Dan Williams Date: Thu, 17 Dec 2020 18:39:55 -0800 Message-ID: Subject: Re: [resend/standalone PATCH v4] Add auxiliary bus support To: Alexandre Belloni Cc: Greg KH , Pierre-Louis Bossart , alsa-devel@alsa-project.org, Kiran Patil , linux-rdma , Shiraz Saleem , Martin Habets , Liam Girdwood , Ranjani Sridharan , Fred Oh , Mark Brown , Jason Gunthorpe , Dave Ertman , Jakub Kicinski , Netdev , Leon Romanovsky , David Miller , Linux Kernel Mailing List , Parav Pandit Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 1:20 PM Alexandre Belloni wrote: > > Hello, > > On 05/12/2020 16:51:36+0100, Greg KH wrote: > > > To me, the documentation was written, and reviewed, more from the > > > perspective of "why not open code a custom bus instead". So I can see > > > after the fact how that is a bit too much theory and justification and > > > not enough practical application. Before the fact though this was a > > > bold mechanism to propose and it was not clear that everyone was > > > grokking the "why" and the tradeoffs. > > > > Understood, I guess I read this from the "of course you should do this, > > now how do I use it?" point of view. Which still needs to be addressed > > I feel. > > > > > I also think it was a bit early to identify consistent design patterns > > > across the implementations and codify those. I expect this to evolve > > > convenience macros just like other parts of the driver-core gained > > > over time. Now that it is in though, another pass through the > > > documentation to pull in more examples seems warranted. > > > > A real, working, example would be great to have, so that people can know > > how to use this. Trying to dig through the sound or IB patches to view > > how it is being used is not a trivial thing to do, which is why > > reviewing this took so much work. Having a simple example test module, > > that creates a number of devices on a bus, ideally tied into the ktest > > framework, would be great. I'll attach below a .c file that I used for > > some basic local testing to verify some of this working, but it does not > > implement a aux bus driver, which needs to be also tested. > > > > There is something I don't get from the documentation and it is what is > this introducing that couldn't already be done using platform drivers > and platform devices? There is room for documentation improvement here. I realize reading it back now that much of the justification for "why not platform bus?" happened on the list, but only a small mention made it into the document. It turns out that platform-bus has some special integrations and hacks with platform-firmware implementations. For example, the ACPI companion magic and specific platform firmware integrations in platform_match(). It's also an awkward bus name to use because these devices do not belong to the platform. The platform bus is for devices that do not have an enumeration mechanism besides board files or firmware descriptions. So while many of the auxiliary device use cases might be able to be squeezed into a platform-bus scheme it further overloads what is already a wide responsibility. In comparison, the auxiliary-bus is tailored to the "sub-function of a parent device/driver" use case. It lets the host driver be the root of a namespace of sub-functionality in a standard template way. > We already have a bunch of drivers in tree that have to share a state > and register other drivers from other subsystems for the same device. > How is the auxiliary bus different? There's also custom subsystem buses that do this. Why not other alternatives? They didn't capture the simultaneous mindshare of RDMA, SOF, and NETDEV developers. Personally my plans for using auxiliary-bus do not map cleanly to anything else in the tree. I want to use it for attaching an NPEM driver (Native PCIE Enclosure Management) to any PCI device driver that opts-in, but it would be overkill to go create an "npem" bus for this.