Re: [PATCH 1/7] driver core: Add conditional guard support for device_lock()

From: Danilo Krummrich

Date: Tue Mar 10 2026 - 15:20:32 EST


On Tue Mar 10, 2026 at 7:39 PM CET, Dan Williams wrote:
> Dave Jiang wrote:
> [..]
>> >>> diff --git a/include/linux/device.h b/include/linux/device.h
>> >>> index 0be95294b6e6..4fafee80524b 100644
>> >>> --- a/include/linux/device.h
>> >>> +++ b/include/linux/device.h
>> >>> @@ -911,6 +911,7 @@ static inline void device_unlock(struct device *dev)
>> >>> }
>> >>>
>> >>> DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T))
>> >>> +DEFINE_GUARD_COND(device, _intr, device_lock_interruptible(_T), _RET == 0)
>> >>
>> >> Can you please just squash this small change to the same patch that is using it? Thanks!
>> >
>> > Why? It is a single logical change and hence should be a separate patch, no?
>>
>> For some reason I missed it's in linux/device.h. So sure ok. But
>> typically I would like to see the usage if it's in the same
>> sub-system.
>
> I generally expect the same as well.
>
> ...however, when we get into multiple in flight patch sets wanting the
> same API [1] it would be nice to have a stable commit id to share, Greg?
>
> [1]: TEE I/O enabling also has a use case, and introduced the helper
> with the "first" user.
> http://lore.kernel.org/20260303000207.1836586-7-dan.j.williams@xxxxxxxxx

This patch has neither Rafael, me nor the driver-core mailing list Cc'd and
buries this change in a patch named "PCI/TSM: Add Device Security (TVM Guest)
LOCK operation support", which makes pretty it hard to catch.

Please submit such changes as a separate patch and send it to all maintainers
and the corresponding mailing list such that people have a chance to take note
of it.

As for sharing the commit throughout multiple trees, I can provide a signed tag
similar to [1] once Greg and Rafael had a chance to take a look at this patch as
well.

You may also want to sort out authorship / tags with Li.

Thanks,
Danilo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/tag/?h=platform_device_info_swnode-7.1-rc1