Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp545276rwe; Wed, 24 Aug 2022 05:32:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR5BRqsqaxn4NQyVoqC4l6W4BI96syes6oDte3sRaWFsuxNVAX8Dm9ayTr/fT08ef6euI06p X-Received: by 2002:a17:902:694a:b0:16e:e270:1f84 with SMTP id k10-20020a170902694a00b0016ee2701f84mr28644569plt.89.1661344327405; Wed, 24 Aug 2022 05:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661344327; cv=none; d=google.com; s=arc-20160816; b=mq5uszrMEZUPaWf/Hcvh4sU/ML1lmywtNrOJJTJgQorFGXxHPcsC4hGWBfBG+i1nF5 R0C4vqika2gWlwir/zh8j5+QfOVk7uaubjXSp1jmhYd1fuuKGCM1U9M3vbPCi2HeXjp3 Xqz5GYR43lTNH8m8QUZ2OJwdfS5jDHv+ynaOdgzxdopga01ZE295U3n7IGN2p0GmiQHW FQxCMPxV46eupYJvJhOZabZaOQlCgMDrp+yY0k6z6xIfq9bnSXJSpwo+yW6828CSe/xH BFA75ULCzLZOYPhKqW9rfGczF8POSqRGijMEqfj/x6kMe066eIGn/Lg5jkwNOpKHsuho 6N0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WiNYaKVp7wOzKDtsl6Y8Vcq2NsSMvyNg9cu5/82R5Ns=; b=LsX1PlVzXGiRgwmS7wnu+IDBhY4uwUCY9855xToUKvz3k5SkQzXQ/znu1i+TUyVjK9 9m9yBQpUayJD/FbdxhVwMuTcqczvIczWXB76RzVdLBEl8kCZLGD87DL66zcFnosyMPiO PIdriXlEDVDPCrILXvrMMO8qkXOxfeZlgTYObaYQqsrb2ABbiOJ+VcUE0r636jY0p7uQ BBXnfH/4z2GWDsbBgmZrr0B4d7kJ/ed6KqipjZ0g+7+v+qmLTO/LeaQBwJOORoiJ7BVf 07pdojVOQZNLdyxH1aw794ZGD8M1e+bPdoXucCkKKv+jRYbYow1d6Gf/7S53p3rVzwy2 xOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N2UxpThX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6388c8000000b0041b642e8687si1316579pgd.8.2022.08.24.05.31.55; Wed, 24 Aug 2022 05:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N2UxpThX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237204AbiHXML5 (ORCPT + 99 others); Wed, 24 Aug 2022 08:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236904AbiHXMLx (ORCPT ); Wed, 24 Aug 2022 08:11:53 -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 DF30F4A13D; Wed, 24 Aug 2022 05:11:52 -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 7C7E561982; Wed, 24 Aug 2022 12:11:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4692DC433D6; Wed, 24 Aug 2022 12:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661343111; bh=steFNIiytTlb7li2LRYaxlt67aKuNkpqIloeKeT/MTQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N2UxpThX3/1pzpXFlYZZQW1U+l8U7SnZMzZOE1rs+FwdPmas8lGG1E+8IRcafHhaS Izg6nD3FZoB5ofp2UURQGzRcs5sjnOEEsbh4W6jzxoY488HYCvtpdwaueCzE481L/i VdCISNvX8t4F1X5Gm4C9NzQ7mMJY/FX2MrAoAszw= Date: Wed, 24 Aug 2022 14:11:48 +0200 From: Greg KH To: "Gupta, Nipun" Cc: "jgg@nvidia.com" , Robin Murphy , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "rafael@kernel.org" , "eric.auger@redhat.com" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "Gupta, Puneet (DCG-ENG)" , "song.bao.hua@hisilicon.com" , "mchehab+huawei@kernel.org" , "maz@kernel.org" , "f.fainelli@gmail.com" , "jeffrey.l.hugo@gmail.com" , "saravanak@google.com" , "Michael.Srba@seznam.cz" , "mani@kernel.org" , "yishaih@nvidia.com" , "jgg@ziepe.ca" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "kvm@vger.kernel.org" , "okaya@kernel.org" , "Anand, Harpreet" , "Agarwal, Nikhil" , "Simek, Michal" , "git (AMD-Xilinx)" Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver Message-ID: References: <20220803122655.100254-1-nipun.gupta@amd.com> <20220817150542.483291-1-nipun.gupta@amd.com> <20220817150542.483291-3-nipun.gupta@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Wed, Aug 24, 2022 at 08:50:19AM +0000, Gupta, Nipun wrote: > [AMD Official Use Only - General] > > > > > -----Original Message----- > > From: Greg KH > > Sent: Monday, August 22, 2022 7:00 PM > > To: Gupta, Nipun > > Cc: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; > > rafael@kernel.org; eric.auger@redhat.com; alex.williamson@redhat.com; > > cohuck@redhat.com; Gupta, Puneet (DCG-ENG) > > ; song.bao.hua@hisilicon.com; > > mchehab+huawei@kernel.org; maz@kernel.org; f.fainelli@gmail.com; > > jeffrey.l.hugo@gmail.com; saravanak@google.com; > > Michael.Srba@seznam.cz; mani@kernel.org; yishaih@nvidia.com; > > jgg@ziepe.ca; linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; > > kvm@vger.kernel.org; okaya@kernel.org; Anand, Harpreet > > ; Agarwal, Nikhil ; > > Simek, Michal ; git (AMD-Xilinx) ; > > jgg@nvidia.com; Robin Murphy > > Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver > > > > [CAUTION: External Email] > > > > On Mon, Aug 22, 2022 at 01:21:47PM +0000, Gupta, Nipun wrote: > > > [AMD Official Use Only - General] > > > > > > > > > > > > > -----Original Message----- > > > > From: Greg KH > > > > Sent: Wednesday, August 17, 2022 9:03 PM > > > > To: Gupta, Nipun > > > > Cc: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; > > rafael@kernel.org; > > > > eric.auger@redhat.com; alex.williamson@redhat.com; > > cohuck@redhat.com; > > > > Gupta, Puneet (DCG-ENG) ; > > > > song.bao.hua@hisilicon.com; mchehab+huawei@kernel.org; > > maz@kernel.org; > > > > f.fainelli@gmail.com; jeffrey.l.hugo@gmail.com; saravanak@google.com; > > > > Michael.Srba@seznam.cz; mani@kernel.org; yishaih@nvidia.com; > > > > jgg@ziepe.ca; linux-kernel@vger.kernel.org; > > devicetree@vger.kernel.org; > > > > kvm@vger.kernel.org; okaya@kernel.org; Anand, Harpreet > > > > ; Agarwal, Nikhil > > ; > > > > Simek, Michal ; git (AMD-Xilinx) > > > > > > Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver > > > > > > > > [CAUTION: External Email] > > > > > > > > On Wed, Aug 17, 2022 at 08:35:38PM +0530, Nipun Gupta wrote: > > > > > CDX bus driver manages the scanning and populating FPGA > > > > > based devices present on the CDX bus. > > > > > > > > > > The bus driver sets up the basic infrastructure and fetches > > > > > the device related information from the firmware. These > > > > > devices are registered as platform devices. > > > > > > > > Ick, why? These aren't platform devices, they are CDX devices. Make > > > > them real devices here, don't abuse the platform device interface for > > > > things that are not actually on the platform bus. > > > > > > CDX is a virtual bus (FW based) which discovers FPGA based platform > > > devices based on communication with FW. > > > > virtual busses are fine to have as a real bus in the kernel, no problem > > there. > > > > > These devices are essentially platform devices as these are memory > > mapped > > > on system bus, but having a property that they are dynamically discovered > > > via FW and are rescannable. > > > > If they are dynamically discoverable and rescannable, then great, it's a > > bus in the kernel and NOT a platform device. > > > > > I think your point is correct in the sense that CDX bus is not an actual bus, > > > but a FW based mechanism to discover FPGA based platform devices. > > > > > > Can you kindly suggest us if we should have the CDX platform device > > scanning > > > code as a CDX bus in "drivers/bus/" folder OR have it in "drivers/fpga/" or > > > "drivers/platform/" or which other suitable location? > > > > drivers/cdx/ ? > > I agree that the approach, which is correct should be used, just wanted > to reconfirm as adding a new bus would lead to change in other areas > like SMMU, MSI and VFIO too and we will need vfio-cdx interface for CDX > bus, similar to vfio-platform. > > On another mail Robin and Jason have suggested to use OF_DYNAMIC. > Can you please also let us know in case that is a suited option where we > use OF_DYNAMIC and have our code as part of "drivers/fpga" instead of > using the bus. (something like pseries CPU hotplug is using to add new > CPU platform devices on runtime: > https://elixir.bootlin.com/linux/v5.19.3/source/arch/powerpc/platforms/pseries/hotplug-cpu.c#L534). > We can share the RFC in case you are interested in looking at code flow > using the of_dynamic approach. Please no more abuse of the platform device. If your device can be discovered by scanning a bus, it is not a platform device. greg k-h