[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260211205916.fmmld2ifc62cl42t@offworld>
Date: Wed, 11 Feb 2026 12:59:16 -0800
From: Davidlohr Bueso <dave@...olabs.net>
To: Gregory Price <gourry@...rry.net>
Cc: linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...a.com, jonathan.cameron@...wei.com,
dave.jiang@...el.com, alison.schofield@...el.com,
vishal.l.verma@...el.com, ira.weiny@...el.com,
dan.j.williams@...el.com
Subject: Re: [PATCH v3] cxl/memdev: fix deadlock in cxl_memdev_autoremove()
on attach failure
On Wed, 11 Feb 2026, Gregory Price wrote:
>cxl_memdev_autoremove() takes device_lock(&cxlmd->dev) via guard(device)
>and then calls cxl_memdev_unregister() when the attach callback was
>provided but cxl_mem_probe() failed to bind.
>
>cxl_memdev_unregister() calls
> cdev_device_del()
> device_del()
> bus_remove_device()
> device_release_driver()
>
>This path is reached when a driver uses the @attach parameter to
>devm_cxl_add_memdev() and the CXL topology fails to enumerate (e.g.
>DVSEC range registers decode outside platform-defined CXL ranges,
>causing the endpoint port probe to fail).
>
>Add cxl_memdev_attach_failed() to set the scope of the check correctly.
I preferred the "if (!cxl_memdev_did_attach())" but the below still
reads nicely.
Reviewed-by: Davidlohr Bueso <dave@...olabs.net>
Powered by blists - more mailing lists