Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2482414pxu; Fri, 18 Dec 2020 14:37:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAqm6RxBPQiIG5v/rC3qshN/gYZ66J3Wbt459iVudJjE+4lw1/jPleiIHzmYzd36X1EAKU X-Received: by 2002:a17:906:d93c:: with SMTP id rn28mr6172192ejb.50.1608331074098; Fri, 18 Dec 2020 14:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608331074; cv=none; d=google.com; s=arc-20160816; b=Wkv9rRPlRi+YtEllGPTFV1hDNUV69QkhS32soS8n5HdJ7TbtaYx206r9NDuaBzuOuM JGBomm9nwLuXuwxcKbOwy6kjHPASVMt4eY1Inv3n3v10I3rJAVHdvS5fV5jAybrTQOql dSuC3l9aXVy8CUYK5Y+HSm/ZhrU/tlf17KSEddcVIlCkZOHaHkkOtTZJazQ3cW0cOURE NXaC/nijXn1uzv64XVqzf06VI3gkSBDloEtzX/ktzA+EdxRRhADvwg13TV0h3O/lFBxh hWyrhzQT5dBFFmFGq+lNwzPwePbwa2c8c7ClkSMsavRq3iXWk51KenScfe2Rd2imWByc X7Pg== 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=xTXy3XpNAms3ekkwQw/otErW5WULs88likHcciGFXeM=; b=U/d70NP3CH9hJa5nuy5pLUaaXYONIw3nHrHVs4yNGhe2NKX9UzDA7WaPiQQh06Ko03 oeXKdk4Qsguru8ncsQKSfihlFD7U3x++iqtoNjIvIIFdQ7rYt5I/NiaNRBKtH3SgXHIK rcB8mmelFQKTUl8E4V/nS5vPJ0UpaKixv7o188kR49g4SleX9KWttVtmghJ0tfd0qWRx wqUOzcK5Qmb/TlhZDOv54Pw8VXvBkyHINt6CCo8ZRQ9ckXu00hgEOqxXAFSFjh1mfQbq 7HIwX2SV97NsaQsIYzv+NP8aueGq2RDAHF+tc3hz5F97eZ4ybBQsUVM0durcS4CGLiOy p7eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=m3zOHE0w; 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 f15si5332029ejr.2.2020.12.18.14.37.30; Fri, 18 Dec 2020 14:37:54 -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=m3zOHE0w; 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 S1726058AbgLRWhH (ORCPT + 99 others); Fri, 18 Dec 2020 17:37:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgLRWhH (ORCPT ); Fri, 18 Dec 2020 17:37:07 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91D1C06138C for ; Fri, 18 Dec 2020 14:36:26 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id qw4so5392342ejb.12 for ; Fri, 18 Dec 2020 14:36:26 -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=xTXy3XpNAms3ekkwQw/otErW5WULs88likHcciGFXeM=; b=m3zOHE0w3r6ahzpcAgQfVzAPl2i6KJvip2SKXyaczrJEGZnlHaHWDc6Y6e6Ue/Fk3w conhoHW1dPczYVsQmj2eLqr1B0wAyqCg0qSM7LzF0bAk5x3WGRvz9e63oJoCLrRPxcAo NCup3hmGffugX6i074UpCmza+m0e4URw20OviQ33kIumJ5YVLEwK+806pVpfQefsT2xX +qBOFn99wzNCn8q6eC1jAdUSPLxRJcloKOs+Xtbapw/PIX8mOrEx3E5skNWYliCtMaLN OEAidGbLkRLvVIrKn49ZsuMwTg+JPymV16f3E3Q1jq0ujaCjujl+6wptrt/7u45O2l8Y TryQ== 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=xTXy3XpNAms3ekkwQw/otErW5WULs88likHcciGFXeM=; b=jfkJ7yG1YjX4bIu18Tx49E+s02DeJF1nt8ZbR63sP2IzlhVAEGH/mD/vJsjPnRFwy8 jSeBYramSQMvOVYkflUH9J7JafIg0K30cC3xEvn1uoy1MvvfaYZk31/HykVlGkfujquw 6HII8sMFYwsrTPpOuDGIjV0RgiYwp87jX8tdBI8PNP8jhfGFPXTGnm8igH6wJKIf3bsJ ThWSkktHmdHLhsMdXPMKK94XF4GULYODqqkCIr9QSPCZlxnsff/T1v4ck3O4SeZfyKJ+ 6jq9lvJVnAe6uN+DGQj1BIIpOFRxKtbzqHcuXxgliFjUxX8bhDRlWcq7guVcSOj6yB88 8Q0w== X-Gm-Message-State: AOAM532ua33lhJmbkA1UQCZJYe1fR8cjM+bHdSLEXOnBUBrMetRAr+p1 F8POxAyhiCEEx9FM3hoodDKyKiQHX7Q/Q87tQ0ZzYA== X-Received: by 2002:a17:906:a29a:: with SMTP id i26mr6063250ejz.45.1608330985195; Fri, 18 Dec 2020 14:36:25 -0800 (PST) MIME-Version: 1.0 References: <20201217211937.GA3177478@piout.net> <20201218131709.GA5333@sirena.org.uk> <20201218140854.GW552508@nvidia.com> <20201218155204.GC5333@sirena.org.uk> <20201218162817.GX552508@nvidia.com> <20201218180310.GD5333@sirena.org.uk> <20201218184150.GY552508@nvidia.com> <20201218203211.GE5333@sirena.org.uk> <20201218205856.GZ552508@nvidia.com> <20201218211658.GH3143569@piout.net> In-Reply-To: <20201218211658.GH3143569@piout.net> From: Dan Williams Date: Fri, 18 Dec 2020 14:36:14 -0800 Message-ID: Subject: Re: [resend/standalone PATCH v4] Add auxiliary bus support To: Alexandre Belloni Cc: Jason Gunthorpe , Mark Brown , Greg KH , 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 Fri, Dec 18, 2020 at 1:17 PM Alexandre Belloni wrote: > > On 18/12/2020 16:58:56-0400, Jason Gunthorpe wrote: > > On Fri, Dec 18, 2020 at 08:32:11PM +0000, Mark Brown wrote: > > > > > > So, I strongly suspect, MFD should create mfd devices on a MFD bus > > > > type. > > > > > > Historically people did try to create custom bus types, as I have > > > pointed out before there was then pushback that these were duplicating > > > the platform bus so everything uses platform bus. > > > > Yes, I vaugely remember.. > > > > I don't know what to say, it seems Greg doesn't share this view of > > platform devices as a universal device. > > > > Reading between the lines, I suppose things would have been happier > > with some kind of inheritance scheme where platform device remained as > > only instantiated directly in board files, while drivers could bind to > > OF/DT/ACPI/FPGA/etc device instantiations with minimal duplication & > > boilerplate. > > > > And maybe that is exactly what we have today with platform devices, > > though the name is now unfortunate. > > > > > I can't tell the difference between what it's doing and what SOF is > > > doing, the code I've seen is just looking at the system it's running > > > on and registering a fixed set of client devices. It looks slightly > > > different because it's registering a device at a time with some wrapper > > > functions involved but that's what the code actually does. > > > > SOF's aux bus usage in general seems weird to me, but if you think > > it fits the mfd scheme of primarily describing HW to partition vs > > describing a SW API then maybe it should use mfd. > > > > The only problem with mfd as far as SOF is concerned was Greg was not > > happy when he saw PCI stuff in the MFD subsystem. > > > > But then again, what about non-enumerable devices on the PCI device? I > feel this would exactly fit MFD. This is a collection of IPs that exist > as standalone but in this case are grouped in a single device. > > Note that I then have another issue because the kernel doesn't support > irq controllers on PCI and this is exactly what my SoC has. But for now, > I can just duplicate the irqchip driver in the MFD driver. > > > This whole thing started when Intel first proposed to directly create > > platform_device's in their ethernet driver and Greg had a quite strong > > NAK to that. > > Let me point to drivers/net/ethernet/cadence/macb_pci.c which is a > fairly recent example. It does exactly that and I'm not sure you could > do it otherwise while still not having to duplicate most of macb_probe. > This still feels an orthogonal example to the problem auxiliary-bus is solving. If a platform-device and a pci-device surface an IP with a shared programming model that's an argument for a shared library, like libata to house the commonality. In contrast auxiliary-bus is a software model for software-defined sub-functionality to be wrapped in a driver model. It assumes a parent-device / parent-driver hierarchy that platform-bus and pci-bus do not imply.