Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Rust-for-Linux/linux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: baa41ff37d5087ac38dcf99018eb9862ea53a9bb
Choose a base ref
...
head repository: Rust-for-Linux/linux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c13f777a3a5e5a9a4ae8c1415d327742618233c3
Choose a head ref
  • 18 commits
  • 29 files changed
  • 4 contributors

Commits on Mar 1, 2024

  1. driver, of: Mangle the device ID machinery further to remove const_tr…

    …ait_impl
    
    This unstable feature is broken/gone in 1.73. To work around this
    without breaking the API, turn IdArray::new() into a macro so that it
    can use concrete types (which can still have const associated
    functions) instead of a trait.
    
    This is quite ugly...
    
    Signed-off-by: Asahi Lina <[email protected]>
    (cherry picked from commit 71e6c52)
    Signed-off-by: Fabien Parent <[email protected]>
    asahilina authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    ce41d4c View commit details
    Browse the repository at this point in the history
  2. rust: kernel: lock: Add Lock::pin_init()

    This allows initializing a lock using pin_init!(), instead of requiring
    the inner data to be passed through the stack.
    
    Signed-off-by: Asahi Lina <[email protected]>
    (cherry picked from commit 05abc1d)
    Signed-off-by: Fabien Parent <[email protected]>
    asahilina authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    c69fc2d View commit details
    Browse the repository at this point in the history
  3. rust: sync: Add dummy LockClassKey implementation for !CONFIG_LOCKDEP

    Lock classes aren't used without lockdep. The C side declares the key
    as an empty struct in that case, but let's make it an explicit ZST in
    Rust, implemented in a separate module. This allows us to more easily
    guarantee that the lockdep code will be trivially optimized out without
    CONFIG_LOCKDEP, including LockClassKey arguments that are passed around.
    
    Depending on whether CONFIG_LOCKDEP is enabled or not, we then import
    the real lockdep implementation or the dummy one.
    
    Signed-off-by: Asahi Lina <[email protected]>
    (cherry picked from commit 3d8fea8)
    Signed-off-by: Fabien Parent <[email protected]>
    asahilina authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    31b295a View commit details
    Browse the repository at this point in the history
  4. rust: sync: Replace static LockClassKey refs with a pointer wrapper

    We want to be able to handle dynamic lock class creation and using
    pointers to things that aren't a real lock_class_key as lock classes.
    Doing this by casting around Rust references is difficult without
    accidentally invoking UB.
    
    Instead, switch LockClassKey to being a raw pointer wrapper around a
    lock_class_key, which means there is no UB possible on the Rust side
    just by creating and consuming these objects. The C code also should
    never actually dereference lock classes, only use their address
    (possibly with an offset).
    
    We still provide a dummy ZST version of this wrapper, to be used when
    lockdep is disabled.
    
    Signed-off-by: Asahi Lina <[email protected]>
    (cherry picked from commit 1f50256)
    Signed-off-by: Fabien Parent <[email protected]>
    asahilina authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    15afb4a View commit details
    Browse the repository at this point in the history
  5. *RFL import: The rest of kernel::device (minus clk stuff)

    Commit reference: 3dfc5eb
    
    Signed-off-by: Asahi Lina <[email protected]>
    (cherry picked from commit 495dd6c)
    Signed-off-by: Fabien Parent <[email protected]>
    asahilina authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    aeefa92 View commit details
    Browse the repository at this point in the history
  6. rust: add I2C driver module macro

    Signed-off-by: Finn Behrens <[email protected]>
    Signed-off-by: Fabien Parent <[email protected]>
    kloenk authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    7581a40 View commit details
    Browse the repository at this point in the history
  7. rust: i2c: add of support

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    5f894b9 View commit details
    Browse the repository at this point in the history
  8. rust: i2c: add method to retrieve raw client pointer

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    15c3522 View commit details
    Browse the repository at this point in the history
  9. rust: i2c: add function to retrieve Device out of a Client

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    611788a View commit details
    Browse the repository at this point in the history
  10. samples: rust: add i2c client driver sample

    Add a basic sample for using the I2C client driver.
    
    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a370144 View commit details
    Browse the repository at this point in the history
  11. rust: add function to create masks

    Create a function that is equivalent to Linux's GENMASK macro.
    
    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    7b4547c View commit details
    Browse the repository at this point in the history
  12. rust: macros: get paste! { [A $pos] } to work for integers

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    6f150e2 View commit details
    Browse the repository at this point in the history
  13. rust: macros: add seq! macro

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    da7df7f View commit details
    Browse the repository at this point in the history
  14. rust: Add new abstraction for regmap

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a88ecd3 View commit details
    Browse the repository at this point in the history
  15. rust: add Module::as_ptr

    This allows you to get a raw pointer to THIS_MODULE for use in unsafe
    code. The Rust Binder RFC uses it when defining fops for the binderfs
    component [1].
    
    This doesn't really need to go in now - it could go in together with
    Rust Binder like how it is sent in the Rust Binder RFC. However, the
    upcoming 1.77.0 release of the Rust compiler introduces a new warning,
    and applying this patch now will silence that warning. That allows us to
    avoid adding the #[allow(dead_code)] annotation seen in [2].
    
    Link: https://lore.kernel.org/rust-for-linux/[email protected]/ [1]
    Link: https://lore.kernel.org/all/[email protected]/ [2]
    Signed-off-by: Alice Ryhl <[email protected]>
    Darksonn authored and Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    62f3e40 View commit details
    Browse the repository at this point in the history
  16. rust: error: Add declaration for ENOTRECOVERABLE error

    Add a missing errno for ENOTRECOVERABLE.
    
    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    ee3fa46 View commit details
    Browse the repository at this point in the history
  17. rust: regulator: add regulator consumer abstractions

    Add a rust abstraction for the regulator consumer API.
    
    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    523f9d9 View commit details
    Browse the repository at this point in the history
  18. rust: regulator: add abstraction to write regulator drivers

    Signed-off-by: Fabien Parent <[email protected]>
    Fabo committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    c13f777 View commit details
    Browse the repository at this point in the history
Loading