- Aug 05, 2024
-
-
Rob Herring authored
All but bo_mmap_offset hooked up. Also need to figure out these warnings: warning: `extern` block uses type `kernel::bindings::lockdep_map`, which is not FFI-safe --> ../drivers/gpu/drm/panthor-rs/file.rs:54:16 | 54 | pfile: *mut bindings::panthor_file, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = help: consider adding a member to this struct = note: this struct has no fields Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Rob Herring authored
Needs drop implemented to replace post_close functionality. Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Rob Herring authored
Based on nova stub. Missing the workqueue init done in module_init in C driver. Need to check if that really needs to be per module rather than per driver instance. Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
- Aug 01, 2024
-
-
Rob Herring authored
Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Rob Herring authored
The rust abstractions want the drm_device and driver specific device separate with the driver specific device accessed thru dev_private. Needs more work to hook-up dev_private in the C driver... Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Rob Herring authored
Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
- Jul 17, 2024
-
-
Rob Herring authored
Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
- Jul 10, 2024
-
-
Rob Herring authored
Use an enum to be compatible with rust. Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Signed-off-by:
Viresh Kumar <viresh.kumar@linaro.org>
-
Rob Herring authored
Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
Rob Herring authored
Signed-off-by:
Rob Herring (Arm) <robh@kernel.org>
-
impl Deref doesn't work in const context. Add a function that is similar to implementing `deref` but that can be used in `const` context. Signed-off-by:
Fabien Parent <fabien.parent@linaro.org>
-
Commit reference: 3dfc5ebff103
-
Commit reference: 3dfc5ebff103
-
- Jun 18, 2024
-
-
The DRM GEM subsystem is the DRM memory management subsystem used by most modern drivers. Add a Rust abstraction to allow Rust DRM driver implementations to use it. Signed-off-by:
Asahi Lina <lina@asahilina.net> Co-developed-by:
Danilo Krummrich <dakr@redhat.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
A DRM File is the DRM counterpart to a kernel file structure, representing an open DRM file descriptor. Add a Rust abstraction to allow drivers to implement their own File types that implement the DriverFile trait. Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement the DRM driver `Registration`. The `Registration` structure is responsible to register and unregister a DRM driver. It makes use of the `Devres` container in order to allow the `Registration` to be owned by devres, such that it is automatically dropped (and the DRM driver unregistered) once the parent device is unbound. Co-developed-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement the abstraction for a `struct drm_device`. A `drm::device::Device` creates a static const `struct drm_driver` filled with the data from the `drm::drv::Driver` trait implementation of the actual driver creating the `drm::device::Device`. Co-developed-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement the DRM driver abstractions. The `Driver` trait provides the interface to the actual driver to fill in the driver specific data, such as the `DriverInfo`, driver features and IOCTLs. Co-developed-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Some traits exposed by the kernel crate may not be intended to be implemented by downstream modules. Add a Sealed trait to allow avoiding this using the sealed trait pattern. Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
DRM drivers need to be able to declare which driver-specific ioctls they support. Add an abstraction implementing the required types and a helper macro to generate the ioctl definition inside the DRM driver. Note that this macro is not usable until further bits of the abstraction are in place (but it will not fail to compile on its own, if not called). Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement `pci::Bar`, `pci::Device::iomap_region` and `pci::Device::iomap_region_sized` to allow for I/O mappings of PCI BARs. To ensure that a `pci::Bar`, and hence the I/O memory mapping, can't out-live the PCI device, the `pci::Bar` type is always embedded into a `Devres` container, such that the `pci::Bar` is revoked once the device is unbound and hence the I/O mapped memory is unmapped. A `pci::Bar` can be requested with (`pci::Device::iomap_region_sized`) or without (`pci::Device::iomap_region`) a const generic representing the minimal requested size of the I/O mapped memory region. In case of the latter only runtime checked I/O reads / writes are possible. Co-developed-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement the basic PCI abstractions required to write a basic PCI driver. This includes the following data structures: The `pci::Driver` trait represents the interface to the driver and provides `pci::Driver::probe` and `pci::Driver::remove` for the driver to implement. The `pci::Device` abstraction represents a `struct pci_dev` and provides abstractions for common functions, such as `pci::Device::set_master`. In order to provide the PCI specific parts to a generic `driver::Registration` the `driver::DriverOps` trait is implemented by the `pci::Adapter`. `pci::DeviceId` implements PCI device IDs based on the generic `driver::RawDevceId` abstraction. This patch is based on previous work from FUJITA Tomonori. Co-developed-by:
FUJITA Tomonori <fujita.tomonori@gmail.com> Signed-off-by:
FUJITA Tomonori <fujita.tomonori@gmail.com> Co-developed-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Add a Rust abstraction for the kernel's devres (device resource management) implementation. The Devres type acts as a container to manage the lifetime and accessibility of device bound resources. Therefore it registers a devres callback and revokes access to the resource on invocation. Users of the Devres abstraction can simply free the corresponding resources in their Drop implementation, which is invoked when either the Devres instance goes out of scope or the devres callback leads to the resource being revoked, which implies a call to drop_in_place(). Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
I/O memory is typically either mapped through direct calls to ioremap() or subsystem / bus specific ones such as pci_iomap(). Even though subsystem / bus specific functions to map I/O memory are based on ioremap() / iounmap() it is not desirable to re-implement them in Rust. Instead, implement a base type for I/O mapped memory, which generically provides the corresponding accessors, such as `Io::readb` or `Io:try_readb`. `Io` supports an optional const generic, such that a driver can indicate the minimal expected and required size of the mapping at compile time. Correspondingly, calls to the 'non-try' accessors, support compile time checks of the I/O memory offset to read / write, while the 'try' accessors, provide boundary checks on runtime. `Io` is meant to be embedded into a structure (e.g. pci::Bar or io::IoMem) which creates the actual I/O memory mapping and initializes `Io` accordingly. To ensure that I/O mapped memory can't out-live the device it may be bound to, subsystems should embedd the corresponding I/O memory type (e.g. pci::Bar) into a `Devres` container, such that it gets revoked once the device is unbound. Co-developed-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Philipp Stanner <pstanner@redhat.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Implement `dev_*` print macros for `device::Device`. They behave like the macros with the same names in C, i.e., they print messages to the kernel ring buffer with the given level, prefixing the messages with corresponding device information. Signed-off-by:
Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Revocable allows access to objects to be safely revoked at run time. This is useful, for example, for resources allocated during device probe; when the device is removed, the driver should stop accessing the device resources even if another state is kept in memory due to existing references (i.e., device context data is ref-counted and has a non-zero refcount after removal of the device). Signed-off-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Add a simple abstraction to guard critical code sections with an rcu read lock. Co-developed-by:
Andreas Hindborg <a.hindborg@samsung.com> Signed-off-by:
Andreas Hindborg <a.hindborg@samsung.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Most subsystems use some kind of ID to match devices and drivers. Hence, we have to provide Rust drivers an abstraction to register an ID table for the driver to match. Generally, those IDs are subsystem specific and hence need to be implemented by the corresponding subsystem. However, the `IdArray`, `IdTable` and `RawDeviceId` types provide a generalized implementation that makes the life of subsystems easier to do so. Co-developed-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Asahi Lina <lina@asahilina.net> Signed-off-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Co-developed-by:
Danilo Krummrich <dakr@redhat.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
Implement the generic `Registration` type and the `DriverOps` trait. The `Registration` structure is the common type that represents a driver registration and is typically bound to the lifetime of a module. However, it doesn't implement actual calls to the kernel's driver core to register drivers itself. Instead the `DriverOps` trait is provided to subsystems, which have to implement `DriverOps::register` and `DrvierOps::unregister`. Subsystems have to provide an implementation for both of those methods where the subsystem specific variants to register / unregister a driver have to implemented. For instance, the PCI subsystem would call __pci_register_driver() from `DriverOps::register` and pci_unregister_driver() from `DrvierOps::unregister`. This patch is based on previous work from Wedson Almeida Filho. Co-developed-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
Danilo Krummrich authored
In a subsequent patch we introduce the `Registration` abstraction used to register driver structures. Some subsystems require the module name on driver registration (e.g. PCI in __pci_register_driver()), hence pass the module name to `Module::init`. Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
This allows modules to be initialised in-place in pinned memory, which enables the usage of pinned types (e.g., mutexes, spinlocks, driver registrations, etc.) in modules without any extra allocations. Drivers that don't need this may continue to implement `Module` without any changes. Signed-off-by:
Wedson Almeida Filho <walmeida@microsoft.com>
-
We'll need it, for example, when calling `register_filesystem` to initialise a file system registration. Signed-off-by:
Wedson Almeida Filho <walmeida@microsoft.com>
-
Danilo Krummrich authored
Add an abstraction around the kernels firmware API to request firmware images. The abstraction provides functions to access the firmware's size and backing buffer. The firmware is released once the abstraction instance is dropped. Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
- Jun 17, 2024
-
-
Danilo Krummrich authored
Add an (always) reference-counted abstraction for a generic C `struct device`. This abstraction encapsulates existing `struct device` instances and manages its reference count. Subsystems may use this abstraction as a base to abstract subsystem specific device instances based on a generic `struct device`, such as `struct pci_dev`. Co-developed-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by:
Danilo Krummrich <dakr@redhat.com>
-
- May 26, 2024
-
-
Linus Torvalds authored
-
Kent Overstreet authored
percpu.h depends on smp.h, but doesn't include it directly because of circular header dependency issues; percpu.h is needed in a bunch of low level headers. This fixes a randconfig build error on mips: include/linux/alloc_tag.h: In function '__alloc_tag_ref_set': include/asm-generic/percpu.h:31:40: error: implicit declaration of function 'raw_smp_processor_id' [-Werror=implicit-function-declaration] Reported-by:
kernel test robot <lkp@intel.com> Fixes: 24e44cc2 ("mm: percpu: enable per-cpu allocation tagging") Closes: https://lore.kernel.org/oe-kbuild-all/202405210052.DIrMXJNz-lkp@intel.com/ Signed-off-by:
Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Linus Torvalds authored
Merge tag 'perf-tools-fixes-for-v6.10-1-2024-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tool fix from Arnaldo Carvalho de Melo: "Revert a patch causing a regression. This made a simple 'perf record -e cycles:pp make -j199' stop working on the Ampere ARM64 system Linus uses to test ARM64 kernels". * tag 'perf-tools-fixes-for-v6.10-1-2024-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: Revert "perf parse-events: Prefer sysfs/JSON hardware events over legacy"
-
Arnaldo Carvalho de Melo authored
This reverts commit 617824a7. This made a simple 'perf record -e cycles:pp make -j199' stop working on the Ampere ARM64 system Linus uses to test ARM64 kernels, as discussed at length in the threads in the Link tags below. The fix provided by Ian wasn't acceptable and work to fix this will take time we don't have at this point, so lets revert this and work on it on the next devel cycle. Reported-by:
Linus Torvalds <torvalds@linux-foundation.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Bhaskar Chowdhury <unixbhaskar@gmail.com> Cc: Ethan Adams <j.ethan.adams@gmail.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Thomas Richter <tmricht@linux.ibm.com> Cc: Tycho Andersen <tycho@tycho.pizza> Cc: Yang Jihong <yangjihong@bytedance.com> Link: https://lore.kernel.org/lkml/CAHk-=wi5Ri=yR2jBVk-4HzTzpoAWOgstr1LEvg_-OXtJvXXJOA@mail.gmail.com Link: https://lore.kernel.org/lkml/CAHk-=wiWvtFyedDNpoV7a8Fq_FpbB+F5KmWK2xPY3QoYseOf_A@mail.gmail.com Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com>
-
git://git.samba.org/sfrench/cifs-2.6Linus Torvalds authored
Pull smb client fixes from Steve French: - two important netfs integration fixes - including for a data corruption and also fixes for multiple xfstests - reenable swap support over SMB3 * tag '6.10-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: Fix missing set of remote_i_size cifs: Fix smb3_insert_range() to move the zero_point cifs: update internal version number smb3: reenable swapfiles over SMB3 mounts
-