Re: [PATCH v3 21/25] dax/region: Create resources on sparse DAX regions

Markus Elfring
2024-08-18T11:45:41Z

…
> +++ b/drivers/cxl/core/extent.c
> @@ -271,20 +271,67 @@ static void calc_hpa_range(struct cxl_endpoint_decoder *cxled,
> hpa_range->end = hpa_range->start + range_len(dpa_range) - 1;
> }
>
> +static int cxlr_notify_extent(struct cxl_region *cxlr, enum dc_event event,
> + struct region_extent *region_extent)
> +{
…
> + device_lock(dev);
> + if (dev->driver) {
…
> + }
> + device_unlock(dev);
> + return rc;
> +}
…

Under which circumstances would you become interested to apply a statement
like “guard(device)(dev);”?
https://elixir.bootlin.com/linux/v6.11-rc3/source/include/linux/device.h#L1027

Regards,
Markus