From: "David E. Box" <david.e.box@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
srinivas.pandruvada@linux.intel.com,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
tony.luck@intel.com, xi.pardee@linux.intel.com,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH 04/15] platform/x86/intel/vsec: Add device links to enforce dependencies
Date: Mon, 16 Jun 2025 09:04:38 -0700 [thread overview]
Message-ID: <f50a036f94000bad3de9f10e8a26240a2306c638.camel@linux.intel.com> (raw)
In-Reply-To: <31ed1609-5da1-722e-5182-5c199a3bcb1f@linux.intel.com>
Hi Ilpo,
On Tue, 2025-05-20 at 16:51 +0300, Ilpo Järvinen wrote:
> On Wed, 30 Apr 2025, David E. Box wrote:
>
> > New Intel VSEC features will have dependencies on other features, requiring
> > certain supplier drivers to be probed before their consumers. To enforce
> > this dependency ordering, introduce device links using device_link_add(),
> > ensuring that suppliers are fully registered before consumers are probed.
> >
> > - Add device link tracking by storing supplier devices and tracking their
> > state.
> > - Implement intel_vsec_link_devices() to establish links between suppliers
> > and consumers based on feature dependencies.
> > - Add get_consumer_dependencies() to retrieve supplier-consumer
> > relationships.
> > - Modify feature registration logic:
> > * Consumers now check that all required suppliers are registered before
> > being initialized.
> > * suppliers_ready() verifies that all required supplier devices are
> > available.
> > - Prevent potential null consumer name issue in sysfs:
> > - Use dev_set_name() when creating auxiliary devices to ensure a
> > unique, non-null consumer name.
> > - Update intel_vsec_pci_probe() to loop up to the number of possible
> > features or when all devices are registered, whichever comes first.
> > - Introduce VSEC_CAP_UNUSED to prevent sub-features (registered via
> > exported APIs) from being mistakenly linked.
> >
> > Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> > ---
...
>
> > + return ret;
> > + }
> > +
> > ret = auxiliary_device_add(auxdev);
> > if (ret < 0) {
> > auxiliary_device_uninit(auxdev);
>
> Don't you need to tear down the device link on failure?
Not necessary according to the doc:
* If DL_FLAG_STATELESS is set in @flags, the caller of this function is
* expected to release the link returned by it directly with the help of either
* device_link_del() or device_link_remove().
*
* If that flag is not set, however, the caller of this function is handing the
* management of the link over to the driver core entirely and its return value
* can only be used to check whether or not the link is present.
I've tested this with repeat modprobe [-r] and kmemleak detect.
I addressed the rest of you comments across the series and will send V2 shortly.
Thanks.
David
next prev parent reply other threads:[~2025-06-16 16:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 21:20 [PATCH 00/15] Intel VSEC/PMT: Introduce Discovery Driver David E. Box
2025-04-30 21:20 ` [PATCH 01/15] MAINTAINERS: Add link to documentation of Intel PMT ABI David E. Box
2025-04-30 21:20 ` [PATCH 02/15] platform/x86/intel/vsec: Add private data for per-device data David E. Box
2025-04-30 21:20 ` [PATCH 03/15] platform/x86/intel/vsec: Create wrapper to walk PCI config space David E. Box
2025-04-30 21:20 ` [PATCH 04/15] platform/x86/intel/vsec: Add device links to enforce dependencies David E. Box
2025-05-20 13:51 ` Ilpo Järvinen
2025-06-16 16:04 ` David E. Box [this message]
2025-04-30 21:20 ` [PATCH 05/15] platform/x86/intel/vsec: Skip absent features during initialization David E. Box
2025-04-30 21:20 ` [PATCH 06/15] platform/x86/intel/vsec: Skip driverless features David E. Box
2025-04-30 21:20 ` [PATCH 07/15] platform/x86/intel/vsec: Add new Discovery feature David E. Box
2025-05-20 14:01 ` Ilpo Järvinen
2025-04-30 21:20 ` [PATCH 08/15] platform/x86/intel/pmt: Add PMT Discovery driver David E. Box
2025-05-20 14:32 ` Ilpo Järvinen
2025-05-20 20:59 ` David E. Box
2025-04-30 21:20 ` [PATCH 09/15] docs: Add ABI documentation for intel_pmt feature directories David E. Box
2025-05-20 14:51 ` Ilpo Järvinen
2025-04-30 21:20 ` [PATCH 10/15] platform/x86/intel/tpmi: Relocate platform info to intel_vsec.h David E. Box
2025-05-20 14:54 ` Ilpo Järvinen
2025-04-30 21:21 ` [PATCH 11/15] platform/x86/intel/vsec: Set OOBMSM to CPU mapping David E. Box
2025-04-30 21:21 ` [PATCH 12/15] platform/x86/intel/tpmi: Get OOBMSM CPU mapping from TPMI David E. Box
2025-04-30 21:21 ` [PATCH 13/15] platform/x86/intel/pmt/discovery: Get telemetry attributes David E. Box
2025-04-30 21:21 ` [PATCH 14/15] platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry regions by feature David E. Box
2025-05-20 15:05 ` Ilpo Järvinen
2025-04-30 21:21 ` [PATCH 15/15] platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API David E. Box
2025-05-16 15:30 ` [PATCH 00/15] Intel VSEC/PMT: Introduce Discovery Driver Luck, Tony
2025-05-19 17:22 ` Luck, Tony
2025-05-19 17:32 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f50a036f94000bad3de9f10e8a26240a2306c638.camel@linux.intel.com \
--to=david.e.box@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tony.luck@intel.com \
--cc=xi.pardee@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®