Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3613256rwb; Fri, 30 Sep 2022 06:08:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WGzOTubJbj+x7z5LDE14NOvBFE21mAu3jgw/dDNrtGQKrK0JHHrW4UaYnHHKHSV362OXh X-Received: by 2002:a17:907:2ccb:b0:77b:bdab:674a with SMTP id hg11-20020a1709072ccb00b0077bbdab674amr6304424ejc.241.1664543298240; Fri, 30 Sep 2022 06:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664543298; cv=none; d=google.com; s=arc-20160816; b=qA0M5lr/2nuNyVNpr9IXBNi+Eg6+4uSgVi2ctr13oqeaeANbKhMJ/Yg7KuU9rgPxFn QH3uCJzLq4n6L1xv7Gfkk586SfdYW5HtXCKkw01iqd5DDvEL1keTT5AC0YsdghSKm8Bs JLfeJWN4TWMHIhKTlAj13YUaxN2nJGMZExSmXVGfpQxinmNDpatspUYLRh19sEDHH5au f7MswYdv/qHsO01MLzov3WTK/fE6g/ZDkDFOZUXUQF9y1yyBlMz1VeSrQGMOl2ABAXgR yJdbSjz9gquCoM15BuaA36N0J4qGgB3M5VYOzGoaMqhXkx3nU5G8fTBhRMnyGHyjYlmv et0g== 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=ET5mvZIqjXRGHQSopF1AmeRnkOgfQbb5cxnlq1P/xfk=; b=gADqE167bNCufbyYwvNomxSicfcwD1XQhTANg0RWm0TEynj28aek7/mPJ1SWzolzWT ZO3dixCnx8ki3tB+3xoNN1omKRR5vW7ghQoXKUVI9RHo3Q/1JdinCgC+as0QFh5TlSc3 e9fv8xoxmXofMm3Wk7gq+B353TsB8HwnU1BvBcgbFoizIu7BbfCNJEJvcrGFScEsuGY5 8A9jaIEG9SFWjNIBe+5FfHG5YbxcCZWd6pqsLY7Qsz3PknaIhcetRzhgJ4XzBQS0RCiB jwsxuhlAD/vjmNDdQs9mVXu3geGPNE+XwgMweZXVslKzhXytaNwCIHvBphW26NlPM/E7 eyaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PWQRzdEc; 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 g2-20020a1709067c4200b007805f59299dsi1579127ejp.291.2022.09.30.06.07.50; Fri, 30 Sep 2022 06:08:18 -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=PWQRzdEc; 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 S231615AbiI3MTV (ORCPT + 99 others); Fri, 30 Sep 2022 08:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbiI3MTR (ORCPT ); Fri, 30 Sep 2022 08:19:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1CA617B509; Fri, 30 Sep 2022 05:19:16 -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 ams.source.kernel.org (Postfix) with ESMTPS id 95D6AB82795; Fri, 30 Sep 2022 12:19:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF9D8C433C1; Fri, 30 Sep 2022 12:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664540354; bh=nVR4dEDGuhHyPbGE1LbJ0tXE+TXxgnaQVIcG0EZELq0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PWQRzdEc5zZ6iirLoyIKxTSZZvRv0ziAVOPNDkX3YIJME1oW/kvMTpIe8Rez2giEg Z9D7LUrsDVmrpDGb9rHFtSCZO3e+wH+FmJcbeWktV1YKoclUx/VSt+88y+ZnJG59n4 XgMbE/gh34wl6yRYMdOmc3RqGvudZIEi6QVA1680= Date: Fri, 30 Sep 2022 14:19:11 +0200 From: Greg Kroah-Hartman To: Elliot Berman Cc: Bjorn Andersson , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Andy Gross , Dmitry Baryshkov , Jassi Brar , linux-arm-kernel@lists.infradead.org, Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Will Deacon , Catalin Marinas , Arnd Bergmann , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 13/14] gunyah: rsc_mgr: Add auxiliary devices for console Message-ID: References: <20220928195633.2348848-1-quic_eberman@quicinc.com> <20220928195633.2348848-14-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220928195633.2348848-14-quic_eberman@quicinc.com> X-Spam-Status: No, score=-7.2 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 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, Sep 28, 2022 at 12:56:32PM -0700, Elliot Berman wrote: > Gunyah resource manager exposes a concrete functionalities which > complicate a single resource manager driver. I am sorry, but I do not understand this sentance. What is so complicated about individual devices being created? Where are they created? What bus? Use auxiliary bus > to help split high level functions for the resource manager and keep the > primary resource manager driver focused on the RPC with RM itself. > Delegate Resource Manager's console functionality to the auxiliary bus. > > Signed-off-by: Elliot Berman > --- > drivers/virt/gunyah/Kconfig | 1 + > drivers/virt/gunyah/rsc_mgr.c | 21 +++++++++++++++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/drivers/virt/gunyah/Kconfig b/drivers/virt/gunyah/Kconfig > index 78deed3c4562..610c8586005b 100644 > --- a/drivers/virt/gunyah/Kconfig > +++ b/drivers/virt/gunyah/Kconfig > @@ -17,6 +17,7 @@ config GUNYAH_RESORUCE_MANAGER > tristate "Gunyah Resource Manager" > select MAILBOX > select GUNYAH_MESSAGE_QUEUES > + select AUXILIARY_BUS > default y > help > The resource manager (RM) is a privileged application VM supporting > diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c > index 7f7e89a6436b..435fe0149915 100644 > --- a/drivers/virt/gunyah/rsc_mgr.c > +++ b/drivers/virt/gunyah/rsc_mgr.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -98,6 +99,8 @@ struct gh_rsc_mgr { > struct mutex send_lock; > > struct work_struct recv_work; > + > + struct auxiliary_device console_adev; > }; > > static struct gh_rsc_mgr *__rsc_mgr; > @@ -573,13 +576,31 @@ static int gh_rm_drv_probe(struct platform_device *pdev) > > __rsc_mgr = rsc_mgr; > > + rsc_mgr->console_adev.dev.parent = &pdev->dev; > + rsc_mgr->console_adev.name = "console"; > + ret = auxiliary_device_init(&rsc_mgr->console_adev); > + if (ret) > + goto err_msgq; > + ret = auxiliary_device_add(&rsc_mgr->console_adev); > + if (ret) > + goto err_console_adev_uninit; > + > return 0; > + > +err_console_adev_uninit: > + auxiliary_device_uninit(&rsc_mgr->console_adev); > +err_msgq: > + gunyah_msgq_remove(&rsc_mgr->msgq); > + return ret; > } Why can't you just have individual platform devices for the individual devices your hypervisor exposes? You control the platform devices, why force them to be shared like this? thanks, greg k-h