From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A46F3CCA0A; Wed, 4 Mar 2026 19:06:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772651174; cv=none; b=UXI9C7xG3f3eZ6fxPGpbVjee1UxsUv/cfTyGKNjaOZwo21hpPyjysIbea5JyMTpGltSD/5HwbP8gc8Cn90P8YCLEMA9na/RTcmlPkwYA6MP7bBrM9SvV3FOPbbYl8Cjw89/uXighX2WoW4PKk3o/gVHq+1qOA3cd8NRVIR/aoAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772651174; c=relaxed/simple; bh=RFBv8YwuEATNPVoLbeOgyN1xp695KYra6Xxis5eFQaA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N4PTC1U/UotLFg2GJjOVfnL5CId9kWypBNnRRkvz6ckoMpTknUf0eHQCRZx57iG6veLNIR4TzRKajdrycu3VYPe0IJmcTHxv8UHMG6ltusfpGjaX2u0SzfDWEMRR+lb/frC5iDWjw4tIEOpWkVNB1MKsEyYhO8X0YOEb+mqsom0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=J5cGG0Qn; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=s6nzvTtp; arc=none smtp.client-ip=202.12.124.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="J5cGG0Qn"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="s6nzvTtp" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1711B7A01F3; Wed, 4 Mar 2026 14:06:12 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 04 Mar 2026 14:06:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1772651171; x=1772737571; bh=qCX0fETb7LppqJFm0Ooo/gF9iA4aj4iETpmuW38yLUo=; b= J5cGG0QnjYNIJbFY9/QFzTx/LoiA7Hekl8JrlfBF/u91a4htaCeH7cWMh4oGYeYL uegAvOocPdLI9Wavp8nEQpCCwaLiHnZn9ToTnfC7HlGOGRkPgyLX1SJqIBdExOnB hPR5548qbFe2zuX+Y+SbhNqM/cCM7tXz98a5xCTZ80QX7XTXueu7CG4XXiAmPmS9 wKRwWoLsL4lPDlzPWjC/vqUoPbZJIP/lujah/1RMOzYWuJ6mAYM6MAf9Gtn6psSp FNhEDsZOGA3L2rcWb5FR9sZDLdQ4pePh24iq6NoaXWIct3eiapHAiOAeCpXgtQPB hMsBZADJa8IHRzXi3si/fw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1772651171; x= 1772737571; bh=qCX0fETb7LppqJFm0Ooo/gF9iA4aj4iETpmuW38yLUo=; b=s 6nzvTtpBqH82ivNYLovM4VSInHyVAhTS9x9CZI4bUO4nrSO0pfkvMET/J+zq0dEH IP9kWOiGGPMXQQRV3+3W0HAjfsPtuAC5uD5niGiwZzw6e8nM1dTrrz+2BP0HY5I7 BMBe3hGrhf/kQOU5Yh0gaOQPMzR1JWRoGLhNKLHLrPlBl80J6LOPVUTs4JQTtwg3 Ub7uiSGwdh4PsjvFdYgEFPsT8m/OnDPw9RLfWvmvOQjAG2qeI6VwNq0akS0qfyHA kMZjUvQyMQsrVBXGLVdLFSfU2iK/ILyk2dUfZzqlKjEsAUBuGdnW5QtwtWc+odSr LMlsAMLIWrYrhhJJ9wm6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvieegfedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfgjfhfogggtgfesthejre dtredtvdenucfhrhhomheptehlvgigucghihhllhhirghmshhonhcuoegrlhgvgiesshhh rgiisghothdrohhrgheqnecuggftrfgrthhtvghrnhepvdekfeejkedvudfhudfhteekud fgudeiteetvdeukedvheetvdekgfdugeevueeunecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprghlvgigsehshhgriigsohhtrdhorhhgpdhnsg gprhgtphhtthhopedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnkhhi thgrsehnvhhiughirgdrtghomhdprhgtphhtthhopehvshgvthhhihesnhhvihguihgrrd gtohhmpdhrtghpthhtohepjhhgghesnhhvihguihgrrdgtohhmpdhrtghpthhtohepmhho tghhshesnhhvihguihgrrdgtohhmpdhrtghpthhtohepjhhgghesiihivghpvgdrtggrpd hrtghpthhtohepshhkohhlohhthhhumhhthhhosehnvhhiughirgdrtghomhdprhgtphht thhopegtjhhirgesnhhvihguihgrrdgtohhmpdhrtghpthhtohepiihhihifsehnvhhiug hirgdrtghomhdprhgtphhtthhopehkjhgrjhhusehnvhhiughirgdrtghomh X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Mar 2026 14:06:10 -0500 (EST) Date: Wed, 4 Mar 2026 12:06:08 -0700 From: Alex Williamson To: Cc: , , , , , , , , , , , , alex@shazbot.org Subject: Re: [PATCH RFC v2 07/15] vfio/nvgrace-egm: Register auxiliary driver ops Message-ID: <20260304120608.141f6c90@shazbot.org> In-Reply-To: <20260223155514.152435-8-ankita@nvidia.com> References: <20260223155514.152435-1-ankita@nvidia.com> <20260223155514.152435-8-ankita@nvidia.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 23 Feb 2026 15:55:06 +0000 wrote: > From: Ankit Agrawal > > Setup dummy auxiliary device ops to be able to get probed by > the nvgrace-egm auxiliary driver. > > Both nvgrace-gpu and the out-of-tree nvidia-vgpu-vfio will make > use of the EGM for device assignment and the SRIOV vGPU virtualization > solutions respectively. Hence allow auxiliary device probing for both. But only one is added? Can you point to any other in-tree drivers that include out-of-tree device entries in their ID table? Isn't this ID table what should make the module soft-dep unnecessary? > > Signed-off-by: Ankit Agrawal > --- > drivers/vfio/pci/nvgrace-gpu/egm.c | 38 +++++++++++++++++++++++++++--- > 1 file changed, 35 insertions(+), 3 deletions(-) > > diff --git a/drivers/vfio/pci/nvgrace-gpu/egm.c b/drivers/vfio/pci/nvgrace-gpu/egm.c > index 6bab4d94cb99..6fd6302a004a 100644 > --- a/drivers/vfio/pci/nvgrace-gpu/egm.c > +++ b/drivers/vfio/pci/nvgrace-gpu/egm.c > @@ -11,6 +11,29 @@ > static dev_t dev; > static struct class *class; > > +static int egm_driver_probe(struct auxiliary_device *aux_dev, > + const struct auxiliary_device_id *id) > +{ > + return 0; > +} > + > +static void egm_driver_remove(struct auxiliary_device *aux_dev) > +{ > +} > + > +static const struct auxiliary_device_id egm_id_table[] = { > + { .name = "nvgrace_gpu_vfio_pci.egm" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(auxiliary, egm_id_table); > + > +static struct auxiliary_driver egm_driver = { > + .name = KBUILD_MODNAME, > + .id_table = egm_id_table, > + .probe = egm_driver_probe, > + .remove = egm_driver_remove, > +}; > + > static char *egm_devnode(const struct device *device, umode_t *mode) > { > if (mode) > @@ -35,17 +58,26 @@ static int __init nvgrace_egm_init(void) > > class = class_create(NVGRACE_EGM_DEV_NAME); > if (IS_ERR(class)) { > - unregister_chrdev_region(dev, MAX_EGM_NODES); > - return PTR_ERR(class); > + ret = PTR_ERR(class); > + goto unregister_chrdev; > } > > class->devnode = egm_devnode; > > - return 0; > + ret = auxiliary_driver_register(&egm_driver); > + if (!ret) > + goto fn_exit; This is not a good success oriented flow. The error condition should goto the unwind, the success condition can just fall through to return. Thanks, Alex > + > + class_destroy(class); > +unregister_chrdev: > + unregister_chrdev_region(dev, MAX_EGM_NODES); > +fn_exit: > + return ret; > } > > static void __exit nvgrace_egm_cleanup(void) > { > + auxiliary_driver_unregister(&egm_driver); > class_destroy(class); > unregister_chrdev_region(dev, MAX_EGM_NODES); > }