Re: [GIT PULL] Driver core changes for 7.0-rc1
From: Danilo Krummrich
Date: Sun Mar 01 2026 - 15:22:17 EST
On Sun Mar 1, 2026 at 7:17 PM CET, Linus Torvalds wrote:
> Use some really simple local spinlock lock to just copy the string
> into a local copy when accessing it - it's not like it's even some
> arbitrarily long string afaik (how long can driver names be?)
Yes, that's what my code in [1] already does. Actually, I think we don't even
need a local copy for accessing the string. We should be good with something
like
int device_match_driver_override(struct device *dev,
const struct device_driver *drv)
which internally compares the strings holding the spinlock.
Otherwise, since you asked, the string length is currently limited to
PAGE_SIZE - 1 as it will be copied with sysfs_emit(). But as mentioned, we
shouldn't need a copy anyways.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/log/?h=driver_override