No description
  • C 96.8%
  • Assembly 0.9%
  • Rust 0.7%
  • Shell 0.6%
  • Python 0.5%
  • Other 0.3%
Find a file
Stephen Boyd 91ec7ad756 clk: convert drivers from deprecated round_rate() to determine_rate() for v6.18
The round_rate() clk ops is deprecated in the clk framework in favor
 of the determine_rate() clk ops, so let's go ahead and convert the
 various clk drivers using the Coccinelle semantic patch posted below.
 I did some minor cosmetic cleanups of the code in some cases.
 
 Coccinelle semantic patch:
 
     virtual patch
 
     // Look up the current name of the round_rate function
     @ has_round_rate @
     identifier round_rate_name =~ ".*_round_rate";
     identifier hw_param, rate_param, parent_rate_param;
     @@
 
     long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                   unsigned long *parent_rate_param)
     {
         ...
     }
 
     // Rename the route_rate function name to determine_rate()
     @ script:python generate_name depends on has_round_rate @
     round_rate_name << has_round_rate.round_rate_name;
     new_name;
     @@
 
     coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")
 
     // Change rate to req->rate; also change occurrences of 'return XXX'.
     @ chg_rate depends on generate_name @
     identifier has_round_rate.round_rate_name;
     identifier has_round_rate.hw_param;
     identifier has_round_rate.rate_param;
     identifier has_round_rate.parent_rate_param;
     identifier ERR =~ "E.*";
     expression E;
     @@
 
     long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                   unsigned long *parent_rate_param)
     {
     <...
     (
     -return -ERR;
     +return -ERR;
     |
     - return rate_param;
     + return 0;
     |
     - return E;
     + req->rate = E;
     +
     + return 0;
     |
     - rate_param
     + req->rate
     )
     ...>
     }
 
     // Coccinelle only transforms the first occurrence of the rate parameter
     // Run a second time. FIXME: Is there a better way to do this?
     @ chg_rate2 depends on generate_name @
     identifier has_round_rate.round_rate_name;
     identifier has_round_rate.hw_param;
     identifier has_round_rate.rate_param;
     identifier has_round_rate.parent_rate_param;
     @@
 
     long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                   unsigned long *parent_rate_param)
     {
     <...
     - rate_param
     + req->rate
     ...>
     }
 
     // Change parent_rate to req->best_parent_rate
     @ chg_parent_rate depends on generate_name @
     identifier has_round_rate.round_rate_name;
     identifier has_round_rate.hw_param;
     identifier has_round_rate.rate_param;
     identifier has_round_rate.parent_rate_param;
     @@
 
     long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                   unsigned long *parent_rate_param)
     {
     <...
     (
     - *parent_rate_param
     + req->best_parent_rate
     |
     - parent_rate_param
     + &req->best_parent_rate
     )
     ...>
     }
 
     // Convert the function definition from round_rate() to determine_rate()
     @ func_definition depends on chg_rate @
     identifier has_round_rate.round_rate_name;
     identifier has_round_rate.hw_param;
     identifier has_round_rate.rate_param;
     identifier has_round_rate.parent_rate_param;
     identifier generate_name.new_name;
     @@
 
     - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
     -               unsigned long *parent_rate_param)
     + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
     {
         ...
     }
 
     // Update the ops from round_rate() to determine_rate()
     @ ops depends on func_definition @
     identifier has_round_rate.round_rate_name;
     identifier generate_name.new_name;
     @@
 
     {
         ...,
     -   .round_rate = round_rate_name,
     +   .determine_rate = new_name,
         ...,
     }
 
 Note that I used coccinelle 1.2 instead of 1.3 since the newer version
 adds unnecessary braces as described in this post.
 https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/
 -----BEGIN PGP SIGNATURE-----
 
 iIwEABYKADQWIQSkbTJwWGWqPd7cKQS30t0nXX7AhwUCaL8JzxYcbWFzbmV5YkBv
 bnN0YXRpb24ub3JnAAoJELfS3SddfsCH1SEBAPFyS4HcSvOMVkQ8THcAoujNzZHv
 FpXfhKuF5NIYWplJAQDGVWD2w8tjIlEV20UhtPA5RDFVtbn5tf3XJYgXci6YBA==
 =3VnO
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAmjF64QUHHN3Ym95ZEBj
 aHJvbWl1bS5vcmcACgkQrQKIl8bklSWRTRAAzNh1pNIfUo2+F/LeJ5N+mrVmS06+
 bHfs5yED3nXDhgfBbOvOG8ZqVrtC6PHCGgKTcG6yRh6YBNrmdXlVCLValAs2ccDq
 1axGnOkQFWj7dpBYMQUSGSTBpcvgavi2S6KA5xE4fZBRk0ZJ2rzf156QSGTbK+fw
 V5Z0vhZUc21WV4n6CHUzkkq8RH5BOrndPEUK1b7wFvZSUhpBi836Ay1Y0PkXRjb7
 iUVenjSgNf2gUlT1RL0xj4kahS6noG/+peQJaIt/Q8LeDAezbtABE0sLc+UefEwM
 NsWxS0FqnsvEQNacnRtCb8pYLPFiq6DRDsBENektAFkDRlKY3R0IHuf4sH4zcCGi
 lI0aArT1+woRCdakJlZ3yA2GdI2PNkUPMe0RIa+h+EjeYJBJfA2MttbC0yDs28nm
 +xbJdHEl9U0iM0CJMJJWVLoEKzD3sk5+J7oCloBY1rW2zdV73q8s2w4ihDZR54cS
 duNURcLaleoW1m32hKPla9Paj1YXZp9wlHAzklyrLL3PjHA8eFkfQKdMAq/5Eidr
 x3R+Z9hmWOa/Vg2fqyU1L64qii0Py3DZItsU7nkkOAfeEvlyFWG/I3GiHG7mj4W+
 qVfm9uZBjPJeRrJmALu01wMmCQpRvBzKgTmSmknoBE/pe7/Y0iml1mMvIl4RVBNd
 oc1nVB1QcbvyrKI=
 =51t3
 -----END PGP SIGNATURE-----

Merge tag 'clk-round-rate-6.18' of https://github.com/masneyb/linux into clk-determine-rate

Pull clk_ops::round_rate conversion to clk_ops::determine_rate() from Brian Masney:

The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() clk ops, so let's go ahead and convert the
various clk drivers using the Coccinelle semantic patch posted below.
I did some minor cosmetic cleanups of the code in some cases.

Coccinelle semantic patch:

    virtual patch

    // Look up the current name of the round_rate function
    @ has_round_rate @
    identifier round_rate_name =~ ".*_round_rate";
    identifier hw_param, rate_param, parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
        ...
    }

    // Rename the route_rate function name to determine_rate()
    @ script:python generate_name depends on has_round_rate @
    round_rate_name << has_round_rate.round_rate_name;
    new_name;
    @@

    coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")

    // Change rate to req->rate; also change occurrences of 'return XXX'.
    @ chg_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier ERR =~ "E.*";
    expression E;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    -return -ERR;
    +return -ERR;
    |
    - return rate_param;
    + return 0;
    |
    - return E;
    + req->rate = E;
    +
    + return 0;
    |
    - rate_param
    + req->rate
    )
    ...>
    }

    // Coccinelle only transforms the first occurrence of the rate parameter
    // Run a second time. FIXME: Is there a better way to do this?
    @ chg_rate2 depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    - rate_param
    + req->rate
    ...>
    }

    // Change parent_rate to req->best_parent_rate
    @ chg_parent_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

    // Convert the function definition from round_rate() to determine_rate()
    @ func_definition depends on chg_rate @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier generate_name.new_name;
    @@

    - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
    -               unsigned long *parent_rate_param)
    + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
    {
        ...
    }

    // Update the ops from round_rate() to determine_rate()
    @ ops depends on func_definition @
    identifier has_round_rate.round_rate_name;
    identifier generate_name.new_name;
    @@

    {
        ...,
    -   .round_rate = round_rate_name,
    +   .determine_rate = new_name,
        ...,
    }

Note that I used coccinelle 1.2 instead of 1.3 since the newer version
adds unnecessary braces as described in this post.
https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/

* tag 'clk-round-rate-6.18' of https://github.com/masneyb/linux: (118 commits)
  clk: scmi: migrate round_rate() to determine_rate()
  clk: ti: fapll: convert from round_rate() to determine_rate()
  clk: ti: dra7-atl: convert from round_rate() to determine_rate()
  clk: ti: divider: convert from round_rate() to determine_rate()
  clk: ti: composite: convert from round_rate() to determine_rate()
  clk: ti: dpll: convert from round_rate() to determine_rate()
  clk: ti: dpll: change error return from ~0 to -EINVAL
  clk: ti: dpll: remove round_rate() in favor of determine_rate()
  clk: tegra: tegra210-emc: convert from round_rate() to determine_rate()
  clk: tegra: super: convert from round_rate() to determine_rate()
  clk: tegra: pll: convert from round_rate() to determine_rate()
  clk: tegra: periph: divider: convert from round_rate() to determine_rate()
  clk: tegra: divider: convert from round_rate() to determine_rate()
  clk: tegra: audio-sync: convert from round_rate() to determine_rate()
  clk: fixed-factor: drop round_rate() clk ops
  clk: divider: remove round_rate() in favor of determine_rate()
  clk: visconti: pll: convert from round_rate() to determine_rate()
  clk: versatile: vexpress-osc: convert from round_rate() to determine_rate()
  clk: versatile: icst: convert from round_rate() to determine_rate()
  clk: versaclock7: convert from round_rate() to determine_rate()
  ...
History 2025-09-13 15:08:27 -07:00
arch - Fix an interrupt vector setup race which leads to a non-functioning device 2025-08-10 08:15:32 +03:00
block block-6.17-20250808 2025-08-09 08:47:28 +03:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
crypto Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
Documentation EFI updates for v6.17 2025-08-09 18:10:01 +03:00
drivers clk: scmi: migrate round_rate() to determine_rate() 2025-09-08 12:50:56 -04:00
fs NFS client updates for Linux 6.17 2025-08-09 07:20:44 +03:00
include clk: ti: dpll: convert from round_rate() to determine_rate() 2025-09-08 12:50:55 -04:00
init Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
io_uring io_uring/memmap: cast nr_pages to size_t before shifting 2025-08-08 06:35:14 -06:00
ipc vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
kernel - Remove an obsolete comment and fix spelling 2025-08-10 08:51:37 +03:00
lib block-6.17-20250808 2025-08-09 08:47:28 +03:00
LICENSES LICENSES: Replace the obsolete address of the FSF in the GFDL-1.2 2025-07-24 11:15:39 +02:00
mm Significant patch series in this pull request: 2025-08-05 16:02:07 +03:00
net NFS client updates for Linux 6.17 2025-08-09 07:20:44 +03:00
rust Rust changes for v6.17 2025-08-03 13:49:10 -07:00
samples Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
scripts Kbuild updates for v6.17 2025-08-06 07:32:52 +03:00
security + Features 2025-08-04 08:17:28 -07:00
sound gpio updates for v6.17-rc1 2025-08-09 08:15:43 +03:00
tools tools/power turbostat: version 2025.09.09 2025-08-10 09:02:36 +03:00
usr usr/include: openrisc: don't HDRTEST bpf_perf_event.h 2025-05-12 15:03:17 +09:00
virt Merge tag 'kvm-x86-no_assignment-6.17' of https://github.com/kvm-x86/linux into HEAD 2025-07-29 08:36:42 -04:00
.clang-format Linux 6.15-rc5 2025-05-06 16:39:25 +10:00
.clippy.toml rust: clean Rust 1.88.0's warning about clippy::disallowed_macros configuration 2025-05-07 00:11:47 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore MAINTAINERS: Retire Ralf Baechle 2024-11-12 15:48:59 +01:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore gitignore: allow .pylintrc to be tracked 2025-07-02 17:10:04 -06:00
.mailmap Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
.pylintrc docs: add a .pylintrc file with sys path for docs scripts 2025-04-09 12:10:33 -06:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS Kbuild updates for v6.17 2025-08-06 07:32:52 +03:00
Kbuild drm: ensure drm headers are self-contained and pass kernel-doc 2025-02-12 10:44:43 +02:00
Kconfig io_uring: Rename KConfig to Kconfig 2025-02-19 14:53:27 -07:00
MAINTAINERS spi: Fixes for v6.17 2025-08-09 08:43:24 +03:00
Makefile Linux 6.17-rc1 2025-08-10 19:41:16 +03:00
README README: Fix spelling 2024-03-18 03:36:32 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.