From: Alejandro Lucero Palau <alucerop@amd.com>
To: Dan Williams <dan.j.williams@intel.com>,
dave.jiang@intel.com, ira.weiny@intel.com
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
stable@vger.kernel.org, Zijun Hu <zijun_hu@icloud.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alison Schofield <alison.schofield@intel.com>,
Gregory Price <gourry@gourry.net>,
Vishal Verma <vishal.l.verma@intel.com>,
linux-cxl@vger.kernel.org
Subject: Re: [PATCH 0/5] cxl: Initialization and shutdown fixes
Date: Sat, 12 Oct 2024 07:30:56 +0100 [thread overview]
Message-ID: <a5a310fe-2451-b053-4a0f-53e496adb9be@amd.com> (raw)
In-Reply-To: <6709627eba220_964f229495@dwillia2-xfh.jf.intel.com.notmuch>
On 10/11/24 18:38, Dan Williams wrote:
> Alejandro Lucero Palau wrote:
>> Hi Dan,
>>
>>
>> I think this is the same issue one of the patches in type2 support tries
>> to deal with:
>>
>>
>> https://lore.kernel.org/linux-cxl/20240907081836.5801-1-alejandro.lucero-palau@amd.com/T/#m9357a559c1a3cc7869ecce44a1801d51518d106e
>>
>>
>> If this fixes that situation, I guess I can drop that one from v4 which
>> is ready to be sent.
>>
>>
>> The other problem I try to fix in that patch, the endpoint not being
>> there when that code tries to use it, it is likely not needed either,
>> although I have a trivial fix for it now instead of that ugly loop with
>> delays. The solution is to add PROBE_FORCE_SYNCHRONOUS as probe_type for
>> the cxl_mem_driver which implies the device_add will only return when
>> the device is really created. Maybe that is worth it for other potential
>> situations suffering the delayed creation.
> I am skeptical that PROBE_FORCE_SYNCRONOUS is a fix for any
> device-readiness bug. Some other assumption is violated if that is
> required.
But that problem is not about device readiness but just how the device
model works. In this case the memdev creation is adding devices, no real
ones but those abstractions we use from the device model, and that
device creation is done asynchronously. When the code creating the
memdev, a Type2 driver in my case, is going to work with such a device
abstraction just after the memdev creation, it is not there yet. It is
true that clx_mem_probe will interact with the real device, but the fact
is such a function is not invoked by the device model synchronously, so
the code using such a device abstraction needs to wait until it is
there. With this flag the waiting is implicit to device creation.
Without that flag other "nasty dancing" with delays and checks needs to
be done as the code in v3 did.
> For the type-2 case I did have an EPROBE_DEFER in my initial RFC on the
> assumption that an accelerator driver might want to wait until CXL is
> initialized before the base accelerator proceeds. However, if
> accelerator drivers behave the same as the cxl_pci driver and are ok
> with asynchronus arrival of CXL functionality then no deferral is
> needed.
I think deferring the accel driver makes sense. In the sfc driver case,
it could work without CXL and then change to use it once the CXL kernel
support is fully initialised, but I guess other accel drivers will rely
on CXL with no other option, and even with the sfc driver, supporting
such a change will make the code far more complex.
>
> Otherwise, the only motivation for synchronous probing I can think of
> would be to have more predictable naming of kernel objects. So yes, I
> would be curious to understand what scenarios probe deferral is still
> needed.
OK. I will keep that patch with the last change in the v4. Let's discuss
this further with that patch as a reference.
Thanks.
next prev parent reply other threads:[~2024-10-12 6:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 5:33 [PATCH 0/5] cxl: Initialization and shutdown fixes Dan Williams
2024-10-11 5:34 ` [PATCH 1/5] cxl/port: Fix CXL port initialization order when the subsystem is built-in Dan Williams
2024-10-14 11:33 ` Jonathan Cameron
2024-10-11 5:34 ` [PATCH 2/5] cxl/port: Fix cxl_bus_rescan() vs bus_rescan_devices() Dan Williams
2024-10-11 12:27 ` Lk Sii
2024-10-11 17:52 ` Dan Williams
2024-10-15 16:36 ` Jonathan Cameron
2024-10-15 17:57 ` Dan Williams
2024-10-16 14:51 ` Jonathan Cameron
2024-10-23 0:33 ` Dan Williams
2024-10-11 5:34 ` [PATCH 3/5] cxl/acpi: Ensure ports ready at cxl_acpi_probe() return Dan Williams
2024-10-11 5:34 ` [PATCH 4/5] cxl/port: Fix use-after-free, permit out-of-order decoder shutdown Dan Williams
2024-10-11 11:50 ` Zijun Hu
2024-10-11 17:46 ` Dan Williams
2024-10-11 23:40 ` Zijun Hu
2024-10-12 17:56 ` Gregory Price
2024-10-12 22:16 ` Dan Williams
2024-10-14 1:29 ` Zijun Hu
2024-10-14 19:32 ` Dan Williams
2024-10-15 0:02 ` Zijun Hu
2024-10-15 0:10 ` Dan Williams
2024-10-15 16:47 ` Jonathan Cameron
2024-10-23 0:31 ` Dan Williams
2024-10-11 5:34 ` [PATCH 5/5] cxl/test: Improve init-order fidelity relative to real-world systems Dan Williams
2024-10-11 11:21 ` [PATCH 0/5] cxl: Initialization and shutdown fixes Alejandro Lucero Palau
2024-10-11 17:38 ` Dan Williams
2024-10-12 6:30 ` Alejandro Lucero Palau [this message]
2024-10-12 21:57 ` Dan Williams
2024-10-14 15:13 ` Alejandro Lucero Palau
2024-10-14 22:24 ` Dan Williams
2024-10-15 8:45 ` Alejandro Lucero Palau
2024-10-15 16:37 ` Dan Williams
2024-10-16 14:41 ` Alejandro Lucero Palau
2024-10-23 0:46 ` Dan Williams
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=a5a310fe-2451-b053-4a0f-53e496adb9be@amd.com \
--to=alucerop@amd.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gourry@gourry.net \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=zijun_hu@icloud.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