Linux Tegra architecture development
 help / color / mirror / Atom feed
  • * [PATCH v5 0/4] Enable sysfs module symlink for more built-in drivers
           [not found] <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com>
           [not found] ` <20260427-acpi_mod_name-v4-1-22b42240c9bf@sony.com>
    @ 2026-05-18 10:19 ` Shashank Balaji
      2026-05-18 10:19   ` [PATCH v5 1/4] soc/tegra: cbb: Move driver registration from pure_initcall to core_initcall Shashank Balaji
                         ` (4 more replies)
      1 sibling, 5 replies; 19+ messages in thread
    From: Shashank Balaji @ 2026-05-18 10:19 UTC (permalink / raw)
      To: Suzuki K Poulose, James Clark, Alexander Shishkin,
    	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
    	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
    	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
    	Jonathan Corbet, Shuah Khan, Luis Chamberlain, Petr Pavlu,
    	Daniel Gomez, Sami Tolvanen, Aaron Tomlin, Mike Leach, Leo Yan,
    	Thierry Reding, Jonathan Hunter, Mike Leach
      Cc: Rahul Bukte, Shashank Balaji, linux-kernel, coresight,
    	linux-arm-kernel, driver-core, rust-for-linux, linux-doc,
    	Daniel Palmer, Tim Bird, linux-modules, linux-tegra, Sumit Gupta
    
    struct device_driver's mod_name is not set by a number of bus' driver registration
    functions. Without that, built-in drivers don't have the module symlink in sysfs.
    We want this to go from unbound driver name -> module name -> kernel config name.
    This is useful on embedded platforms to minimize kernel config, reduce kernel size,
    and reduce boot time.
    
    In order to achieve this, mod_name has to be set to KBUILD_MODNAME, and this has
    to be done for all buses which don't yet do this.
    
    Here are some treewide stats:
    - 110 registration functions across all bus types
    - 20 of them set mod_name
    - Remaining 90 do not set mod_name:
        1. 36 functions under pattern 1:
            They have a __register function + register macro. KBUILD_MODNAME needs to
            be passed and the function needs to take mod_name as input.
        2. 42 functions under pattern 2:
            These have no macro wrapper. They need a double-underscore rename + macro
            wrapper to make them similar to pattern 1.
        3. Remaining 12 do not have such a clean registration interface. More analysis
           is required.
    
    We plan to start with pattern 1, since it's the easiest category of changes.
    Within that, for now we're only sending the platform patch. If we get the go-ahead
    on that, we'll send the remaining ones.
    
    Patch 4 depends on patches 1, 2, and 3.
    
    Co-developed-by: Rahul Bukte <rahul.bukte@sony.com>
    Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
    Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
    ---
    Changes in v5:
    - Move tegra cbb driver init to core_initcall and module_kset init to pure_initcall (Gary)
    - Rename coresight_init_driver() to coresight_init_driver_with_owner(), and
      declare function prototype before use (Leo)
    - Merge doc change patch with code change patch, so that __platform_register_drivers()
      prototype is changed everywhere in the same patch
    - Link to v4: https://patch.msgid.link/20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com
    
    Changes in v4:
    - Initialize module_kset in do_basic_setup() before do_initcalls() (Gary)
    - Add commit body to the documentation patch (Greg)
    - Link to v3: https://patch.msgid.link/20260422-acpi_mod_name-v3-0-a184eff9ff6f@sony.com
    
    Changes in v3:
    - Initialize module_kset on-demand (Greg)
    - Make coresight driver registration happen through a macro (Greg)
    - Split up the patch adding mod_name to platform driver registrations (Greg)
    - Link to v2: https://patch.msgid.link/20260421-acpi_mod_name-v2-0-e73f9310dad3@sony.com
    
    Changes in v2:
    - Drop acpi patch, send platform instead (Rafael)
    - Link to v1: https://patch.msgid.link/20260416-acpi_mod_name-v1-0-1a4d96fd86c9@sony.com
    
    To: Suzuki K Poulose <suzuki.poulose@arm.com>
    To: Mike Leach <mike.leach@linaro.org>
    To: James Clark <james.clark@linaro.org>
    To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    To: "Rafael J. Wysocki" <rafael@kernel.org>
    To: Danilo Krummrich <dakr@kernel.org>
    To: Miguel Ojeda <ojeda@kernel.org>
    To: Boqun Feng <boqun@kernel.org>
    To: Gary Guo <gary@garyguo.net>
    To: Björn Roy Baron <bjorn3_gh@protonmail.com>
    To: Benno Lossin <lossin@kernel.org>
    To: Andreas Hindborg <a.hindborg@kernel.org>
    To: Alice Ryhl <aliceryhl@google.com>
    To: Trevor Gross <tmgross@umich.edu>
    To: Jonathan Corbet <corbet@lwn.net>
    To: Shuah Khan <skhan@linuxfoundation.org>
    To: Luis Chamberlain <mcgrof@kernel.org>
    To: Petr Pavlu <petr.pavlu@suse.com>
    To: Daniel Gomez <da.gomez@kernel.org>
    To: Sami Tolvanen <samitolvanen@google.com>
    To: Aaron Tomlin <atomlin@atomlin.com>
    To: Mike Leach <mike.leach@arm.com>
    To: Leo Yan <leo.yan@arm.com>
    To: Thierry Reding <thierry.reding@kernel.org>
    To: Jonathan Hunter <jonathanh@nvidia.com>
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: driver-core@lists.linux.dev
    Cc: rust-for-linux@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: Shashank Balaji <shashank.mahadasyam@sony.com>
    Cc: Rahul Bukte <rahul.bukte@sony.com>
    Cc: Daniel Palmer <daniel.palmer@sony.com>
    Cc: Tim Bird <tim.bird@sony.com>
    Cc: linux-modules@vger.kernel.org
    Cc: linux-tegra@vger.kernel.org
    Cc: Sumit Gupta <sumitg@nvidia.com>
    
    ---
    Shashank Balaji (4):
          soc/tegra: cbb: Move driver registration from pure_initcall to core_initcall
          kernel: param: initialize module_kset in a pure_initcall
          coresight: pass THIS_MODULE implicitly through a macro
          driver core: platform: set mod_name in driver registration
    
     Documentation/driver-api/driver-model/platform.rst |  3 ++-
     drivers/base/platform.c                            | 21 ++++++++++++++-------
     drivers/hwtracing/coresight/coresight-catu.c       |  2 +-
     drivers/hwtracing/coresight/coresight-core.c       |  9 +++++----
     drivers/hwtracing/coresight/coresight-cpu-debug.c  |  3 +--
     drivers/hwtracing/coresight/coresight-funnel.c     |  3 +--
     drivers/hwtracing/coresight/coresight-replicator.c |  3 +--
     drivers/hwtracing/coresight/coresight-stm.c        |  2 +-
     drivers/hwtracing/coresight/coresight-tmc-core.c   |  2 +-
     drivers/hwtracing/coresight/coresight-tnoc.c       |  2 +-
     drivers/hwtracing/coresight/coresight-tpdm.c       |  3 +--
     drivers/hwtracing/coresight/coresight-tpiu.c       |  2 +-
     drivers/soc/tegra/cbb/tegra194-cbb.c               |  2 +-
     drivers/soc/tegra/cbb/tegra234-cbb.c               |  2 +-
     include/linux/coresight.h                          |  7 +++++--
     include/linux/platform_device.h                    | 17 +++++++++--------
     kernel/params.c                                    |  2 +-
     rust/kernel/platform.rs                            |  4 +++-
     18 files changed, 50 insertions(+), 39 deletions(-)
    ---
    base-commit: 5200f5f493f79f14bbdc349e402a40dfb32f23c8
    change-id: 20260416-acpi_mod_name-f645a76e337b
    
    Best regards,
    --  
    Shashank Balaji <shashank.mahadasyam@sony.com>
    
    
    ^ permalink raw reply	[flat|nested] 19+ messages in thread

  • end of thread, other threads:[~2026-05-28 21:20 UTC | newest]
    
    Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com>
         [not found] ` <20260427-acpi_mod_name-v4-1-22b42240c9bf@sony.com>
         [not found]   ` <DI3Z28IZZOT9.349TTWNN9VDMB@garyguo.net>
         [not found]     ` <afABOMT_s9DvF6NY@JPC00244420>
         [not found]       ` <DI4QQA6EGIA1.N8WRFWVKG91S@garyguo.net>
    2026-04-28 13:07         ` [PATCH v4 1/4] kernel: param: initialize module_kset before do_initcalls() Shashank Balaji
    2026-05-12  2:12           ` Shashank Balaji
    2026-05-12  8:55             ` Jon Hunter
    2026-05-12 12:14               ` Sumit Gupta
    2026-05-12 13:32                 ` Shashank Balaji
    2026-05-18 10:19 ` [PATCH v5 0/4] Enable sysfs module symlink for more built-in drivers Shashank Balaji
    2026-05-18 10:19   ` [PATCH v5 1/4] soc/tegra: cbb: Move driver registration from pure_initcall to core_initcall Shashank Balaji
    2026-05-27 11:19     ` Gary Guo
    2026-05-28 21:09     ` Thierry Reding
    2026-05-18 10:19   ` [PATCH v5 2/4] kernel: param: initialize module_kset in a pure_initcall Shashank Balaji
    2026-05-22 13:06     ` Petr Pavlu
    2026-05-23  3:24       ` Shashank Balaji
    2026-05-27 11:19     ` Gary Guo
    2026-05-18 10:19   ` [PATCH v5 3/4] coresight: pass THIS_MODULE implicitly through a macro Shashank Balaji
    2026-05-18 10:20   ` [PATCH v5 4/4] driver core: platform: set mod_name in driver registration Shashank Balaji
    2026-05-18 10:27     ` Greg Kroah-Hartman
    2026-05-18 10:32       ` Shashank Balaji
    2026-05-18 10:49         ` Greg Kroah-Hartman
    2026-05-28 21:19   ` [PATCH v5 0/4] Enable sysfs module symlink for more built-in drivers Danilo Krummrich
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox