Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1655583pxp; Thu, 17 Mar 2022 13:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNixgJbGyRd6e+hG5CnsR0D3FThyz8Q56nPJ978rgWZ8sz4PWoZOx7MdT36MDp2jrcWfCF X-Received: by 2002:a17:902:9043:b0:14f:aa08:8497 with SMTP id w3-20020a170902904300b0014faa088497mr6585554plz.109.1647549891717; Thu, 17 Mar 2022 13:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647549891; cv=none; d=google.com; s=arc-20160816; b=FABMgmpDwMa/8Ptja/1dW0Q+sNd95deG+pioj3WUb7k2sORq39EoN68GShf+yuNApX 0TRkQoEnBcuzI5Xz0SlOBBWI3XeGQEhvMzAYGMrsxpp+WCWVRN/p7u7vEPPUEnMB/PKS YkeJhhyu3TggM71qP/VbVn2AsTUPMTdAFcNFz5tnOiWxKB0yjmuijUIoyMY7rOeJTOn5 TTY7G05IG1mLtT8WtrC7ogAjMZyuGwaogQWky1vQ11pkaDBPhANpLFBClspdhTj6NIrD Af3QbMzxITl91UJ7cIPDEtON6EFvC+B7+RrbvHQOaGNJdprYOc4L9OQgOihUxkd6nlrc qG6Q== 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=84y/Ccc9cxwSidAyg+X70+z0E/CZvGSbQTrdAilc304=; b=eqtB1NMXnEKxh37IzwG3sBrsTcGdTBKYD3B4VzIa9hezQmZiWvQKRVb9lG88jVhetf mdYk6iLBaJjAqVZdsHLFwvpeMxeby5AjrxOFn12QLhEyHB3K2aBSHeLYH9oODG5yBe8E 0SWcq0qoRMNWXOjpsNuHHDOtWxMQgj7CAkxgVzEZ7bMcv5YWto+YoJdQSjw0elzGEna/ drru6LXgzWiIwRmXDghSDGpkQO+kMDodNOuebDaCcdRN7Kx64TcMieInESKpK/VX+QMx 1kGtj5u8LXRv5KmgEVa3GVTaZbDiZR0TEfc5XVfjkQBic8kxY/2Gb71gphTj1seopV30 ckkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Aat7q+Ua; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q22-20020a62ae16000000b004fa6c75e1casi425932pff.273.2022.03.17.13.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:44:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Aat7q+Ua; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EFA071C3908; Thu, 17 Mar 2022 13:12:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbiCQTi5 (ORCPT + 99 others); Thu, 17 Mar 2022 15:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbiCQTiz (ORCPT ); Thu, 17 Mar 2022 15:38:55 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8768F22E953; Thu, 17 Mar 2022 12:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647545856; x=1679081856; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Qo2D3TN6PoZ9wS60fZKZkGUnHxtz5zLGgEpjwbsjoIA=; b=Aat7q+Ua303aWmUlGVX6EFqUr5/znu6J4bwCxsHW2rmyq7ISZFd0v2S3 T2MGpeP/qX91UaSBs1sE07VHNm2acml6ua93ymG9+rJUk9qSFJfSm8zi2 VbxpWZEDPotTc9EoYt7SrudtY0KU3fg1BqZyyR1HoPp6YJrabO/tOSpFB vlxl6438S4TeFPzGxacDDyeg7qElyI8VgcavgyjOwLauRDL1KRHiWMk0f Efx8LfSZ8t+ya8CyMhCZFcNVtOeN95A02aQXKTTZUDJCaS86lGXYQak4X /fjI++rnajx/0svcvaoE/Jnalrqpq2ov4figRBY1OxNFIoJcyKhtiEjIk g==; X-IronPort-AV: E=McAfee;i="6200,9189,10289"; a="236909725" X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="236909725" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 12:37:36 -0700 X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="635486137" Received: from mgsalahu-mobl.amr.corp.intel.com (HELO localhost) ([10.212.119.201]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 12:37:36 -0700 Date: Thu, 17 Mar 2022 12:37:35 -0700 From: Ira Weiny To: Dan Williams Cc: Jonathan Cameron , Bjorn Helgaas , Alison Schofield , Vishal Verma , Ben Widawsky , Linux Kernel Mailing List , linux-cxl@vger.kernel.org, Linux PCI Subject: Re: [PATCH V6 03/10] PCI/DOE: Add Data Object Exchange Aux Driver Message-ID: References: <20220201071952.900068-1-ira.weiny@intel.com> <20220201071952.900068-4-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, Mar 16, 2022 at 03:50:55PM -0700, Ira Weiny wrote: > On Tue, Feb 08, 2022 at 04:59:39PM -0800, Dan Williams wrote: > > On Mon, Jan 31, 2022 at 11:20 PM wrote: [snip] > > > > > + > > > + return 0; > > > +} > > > + > > > +static void pci_doe_remove(struct auxiliary_device *aux_dev) > > > +{ > > > + struct pci_doe *doe = dev_get_drvdata(&aux_dev->dev); > > > + > > > + /* First halt the state machine */ > > > + cancel_delayed_work_sync(&doe->statemachine); > > > +} > > > + > > > +static const struct auxiliary_device_id pci_doe_auxiliary_id_table[] = { > > > + {}, > > > +}; > > > + > > > +MODULE_DEVICE_TABLE(auxiliary, pci_doe_auxiliary_id_table); > > > > Why is this empty table here? > > Filling the id table was done in the next patch. > > The split of the patches may have been a bit arbitrary here. This patch was > focused on the state machine and probing of the mailboxes. The next patch > provided the helper function to create all the DOE devices for a given > PCI device; pci_doe_create_doe_devices() > > > > > > + > > > +struct auxiliary_driver pci_doe_auxiliary_drv = { > > > + .name = "pci_doe", > > > + .id_table = pci_doe_auxiliary_id_table, > > > + .probe = pci_doe_probe, > > > + .remove = pci_doe_remove > > > +}; > > > > I expect that these helpers would be provided by the PCI core, but > > then a subsystem like CXL would have code to register their auxiliary > > devices and drivers that mostly just wrap the PCI core DOE > > implementation. > > Ah ok, I think I see what you are saying. That is not quite as straight > forward a use of the auxiliary bus but I _think_ it will work. I'll also > attempt to clarify with documentation how the above probe/remove functions are > to be used by those defining their own drivers. Ok looking at this again today I see why I did things the way I did. The question is: Is the DOE driver a PCI driver or a driver defined by the subsystems? The way I have it now the PCI core defines the driver and a couple of very small helper functions for the subsystems to use. What I think you are proposing is the PCI core supplies the helper functions to drive the protocol but the actual driver is defined as part of the subsystem? Is that correct? The implications are subtle but one thing about the way I have things is that subsystems don't really need to learn about auxiliary bus driver stuff. OTOH pushing the auxiliary bus code into the subsystem allows for a bit more flexibility around the use of the DOE protocol code within the PCI core. I'll keep looking. Ira