Page MenuHomeFreeBSD

linuxkpi: Add `sysfs_create_bin_file()` and `sysfs_remove_bin_file()`
AcceptedPublic

Authored by dumbbell on Feb 19 2025, 9:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 22, 12:44 PM
Unknown Object (File)
Mon, Mar 17, 2:43 AM
Unknown Object (File)
Thu, Mar 6, 7:53 AM
Unknown Object (File)
Mar 3 2025, 5:30 AM
Unknown Object (File)
Mar 1 2025, 9:41 PM
Unknown Object (File)
Feb 23 2025, 7:47 PM
Unknown Object (File)
Feb 22 2025, 9:19 PM
Unknown Object (File)
Feb 22 2025, 2:12 PM
Subscribers

Details

Reviewers
bz
Group Reviewers
linuxkpi
Summary

They are used by the i915 DRM driver for quite some time, but that code was commented out. It was moved around in Linux 6.8, so instead of figuring out what should be commented out now, let's add an implementation of these functions.

This is part of the update of DRM drivers to Linux 6.8.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

So we expose sysfs entries via sysctl?

Yes. For now, there is no connection between linsysfs and linuxkpi: linuxkpi does not add its entries as files and directories in linsysfs, it always used a sysctl interface instead.

Perhaps this is something we can change in the future. It would be way closer to Linux and would make sense, but it will be a breaking change (I don’t know the consumers of the sysctl OIDs).

bz requested changes to this revision.Feb 22 2025, 1:16 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/sysfs.h
195

Wouldn't sysctl_handle_opaque be better for a "bin" object? Also it seems you do use CTLTYPE_OPAQUE

217

No need for { } here in the if/else if cases

228

No need for a block here either

This revision now requires changes to proceed.Feb 22 2025, 1:16 PM
sys/compat/linuxkpi/common/include/linux/sysfs.h
195

Oops, yes, that was my intention…

Call sysctl_handle_opaque() instead of sysctl_handle_string()

I think this is fine; if you do the one change no need to put it back up here.

sys/compat/linuxkpi/common/include/linux/sysfs.h
227

oid == NULL if you still want to change it right for the commit

This revision is now accepted and ready to land.Tue, Apr 1, 11:01 PM