Commit Graph

151 Commits

Author SHA1 Message Date
Desnes Nunes 500ec25427 usb: typec: Only use SVID for matching altmodes
JIRA: https://issues.redhat.com/browse/RHEL-78837
Conflicts:
* Avoiding commit <d69d80484598> ("driver core: have match() callback in
  struct bus_type take a const *") that constified struct device_driver
  *driver parameter on typec_match() function

commit 8541bf0239b8509ecc1192b2e26768a36fd9c944
Author: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Date: Fri, 13 Dec 2024 15:35:42 -0800

  Mode in struct typec_altmode is used to indicate the index of the
  altmode on a port, partner or plug. It is used in enter mode VDMs but
  doesn't make much sense for matching against altmode drivers or for
  matching partner to port altmodes.

  Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
  Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  Reviewed-by: Benson Leung <bleung@chromium.org>
  Link: https://lore.kernel.org/r/20241213153543.v5.1.Ie0d37646f18461234777d88b4c3e21faed92ed4f@changeid
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes 06d07520d7 modpost: call module_alias_printf() from all do_*_entry() functions
JIRA: https://issues.redhat.com/browse/RHEL-78837
Conflicts:
* Due to unsupported code on functions do_slim_entry(), do_cdx_entry(),
  do_vchiq_entry(), do_coreboot_entry(), avoiding following commits:
  - <2959ab247061> ("cdx: add the cdx bus driver")
  - <1fa05877588a> ("staging: vc04_services: Support module autoloading
    using MODULE_DEVICE_TABLE")
  - <f1cebae1dbf8> ("firmware: coreboot: Generate aliases for coreboot
    modules")
  - <b4b818305578> ("slimbus: generate MODULE_ALIAS() from
    MODULE_DEVICE_TABLE()")

commit 6d3b3dd26fd71dde0b41478755a59ca30aaeb664
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:45 +0900

  The do_*_entry() functions cannot check the length of the given buffer.

  Use module_alias_printf() helper consistently for these functions.

  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes cf6800c78a modpost: pass (struct module *) to do_*_entry() functions
JIRA: https://issues.redhat.com/browse/RHEL-78837
Conflicts:
* Due to unsupported code on functions do_slim_entry(), do_cdx_entry(),
  do_vchiq_entry(), do_coreboot_entry(), avoiding following commits:
  - <2959ab247061> ("cdx: add the cdx bus driver")
  - <1fa05877588a> ("staging: vc04_services: Support module autoloading
    using MODULE_DEVICE_TABLE")
  - <f1cebae1dbf8> ("firmware: coreboot: Generate aliases for coreboot
    modules")
  - <b4b818305578> ("slimbus: generate MODULE_ALIAS() from
    MODULE_DEVICE_TABLE()")

commit c7c24d60151c022bd8e357f5395a327d354a676a
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:44 +0900

  Replace the first argument with a pointer to struct module.

  'filename' can be replaced with mod->name.

  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes 4a555095c8 modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit ac96a15a0f0c8812a3aaa587b871cd5527f6d736
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Sun, 8 Oct 2023 02:04:45 +0900

  When MODULE_DEVICE_TABLE(ishtp, ) is built on a host with a different
  endianness from the target architecture, it results in an incorrect
  MODULE_ALIAS().

  For example, see a case where drivers/platform/x86/intel/ishtp_eclite.c
  is built as a module for x86.

  If you build it on a little-endian host, you will get the correct
  MODULE_ALIAS:

      $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c
      MODULE_ALIAS("ishtp:{6A19CC4B-D760-4DE3-B14D-F25EBD0FBCD9}");

  However, if you build it on a big-endian host, you will get a wrong
  MODULE_ALIAS:

      $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c
      MODULE_ALIAS("ishtp:{BD0FBCD9-F25E-B14D-4DE3-D7606A19CC4B}");

  This issue has been unnoticed because the x86 kernel is most likely built
  natively on an x86 host.

  The guid field must not be reversed because guid_t is an array of __u8.

  Fixes: fa443bc3c1e4 ("HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()")
  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
  Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
  Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes d20608144a modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit 7f54e00e5842663c2cea501bbbdfa572c94348a3
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Sun, 8 Oct 2023 02:04:44 +0900

  When MODULE_DEVICE_TABLE(tee, ) is built on a host with a different
  endianness from the target architecture, it results in an incorrect
  MODULE_ALIAS().

  For example, see a case where drivers/char/hw_random/optee-rng.c
  is built as a module for ARM little-endian.

  If you build it on a little-endian host, you will get the correct
  MODULE_ALIAS:

      $ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c
      MODULE_ALIAS("tee:ab7a617c-b8e7-4d8f-8301-d09b61036b64*");

  However, if you build it on a big-endian host, you will get a wrong
  MODULE_ALIAS:

      $ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c
      MODULE_ALIAS("tee:646b0361-9bd0-0183-8f4d-e7b87c617aab*");

  The same problem also occurs when you enable CONFIG_CPU_BIG_ENDIAN,
  and build it on a little-endian host.

  This issue has been unnoticed because the ARM kernel is configured for
  little-endian by default, and most likely built on a little-endian host
  (cross-build on x86 or native-build on ARM).

  The uuid field must not be reversed because uuid_t is an array of __u8.

  Fixes: 0fc1db9d10 ("tee: add bus driver framework for TEE based devices")
  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes 43453d654f modpost: introduce module_alias_printf() helper
JIRA: https://issues.redhat.com/browse/RHEL-78837
Conflicts:
* Considering RHEL commit <a952a26a27d5> ("modpost: move *.mod.c genera-
  tion to write_mod_c_files()") that added a call to add_rhelversion()
  in new write_mod_c_files()

commit f4fdb17ca5a5285d4a0ed81b25d5a3d7b9b3ebf3
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:41 +0900

  The generic ->do_entry() handler is currently limited to returning
  a single alias string.

  However, this is not flexible enough for several subsystems, which
  currently require their own implementations:

   - do_usb_table()
   - do_of_table()
   - do_pnp_device_entry()
   - do_pnp_card_entries()

  This commit introduces a helper function so that these special cases can
  add multiple MODULE_ALIAS() and then migrate to the generic framework.

  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes ce048b458f modpost: remove unnecessary check in do_acpi_entry()
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit b7bca42d101d8d9678068cde645bd6d0afa8a20f
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:40 +0900

  The 'id' pointer is never NULL since it has the same address as
  'symval'.

  Also, checking (*id)[0] is simpler than calling strlen().

  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes e0b41388d7 modpost: fix input MODULE_DEVICE_TABLE() built for 64-bit on 32-bit host
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit 77dc55a978e69625f9718460012e5ef0172dc4de
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Sun, 3 Nov 2024 21:52:57 +0900

  When building a 64-bit kernel on a 32-bit build host, incorrect
  input MODULE_ALIAS() entries may be generated.

  For example, when compiling a 64-bit kernel with CONFIG_INPUT_MOUSEDEV=m
  on a 64-bit build machine, you will get the correct output:

    $ grep MODULE_ALIAS drivers/input/mousedev.mod.c
    MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*110,*r*0,*1,*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*r*8,*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*14A,*r*a*0,*1,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*145,*r*a*0,*1,*18,*1C,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*110,*r*a*0,*1,*m*l*s*f*w*");

  However, building the same kernel on a 32-bit machine results in
  incorrect output:

    $ grep MODULE_ALIAS drivers/input/mousedev.mod.c
    MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*110,*130,*r*0,*1,*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*r*8,*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*14A,*16A,*r*a*0,*1,*20,*21,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*145,*165,*r*a*0,*1,*18,*1C,*20,*21,*38,*3C,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*110,*130,*r*a*0,*1,*20,*21,*m*l*s*f*w*");

  A similar issue occurs with CONFIG_INPUT_JOYDEV=m. On a 64-bit build
  machine, the output is:

    $ grep MODULE_ALIAS drivers/input/joydev.mod.c
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*2,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*120,*r*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*130,*r*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*2C0,*r*a*m*l*s*f*w*");

  However, on a 32-bit machine, the output is incorrect:

    $ grep MODULE_ALIAS drivers/input/joydev.mod.c
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*2,*22,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*11F,*13F,*r*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*11F,*13F,*r*a*m*l*s*f*w*");
    MODULE_ALIAS("input:b*v*p*e*-e*1,*k*2C0,*2E0,*r*a*m*l*s*f*w*");

  When building a 64-bit kernel, BITS_PER_LONG is defined as 64. However,
  on a 32-bit build machine, the constant 1L is a signed 32-bit value.
  Left-shifting it beyond 32 bits causes wraparound, and shifting by 31
  or 63 bits makes it a negative value.

  The fix in commit e0e9263271 ("[RHEL-9.7 rhel-78837 PATCH] PATCH: 1 line 2.6.18 bugfix:
  modpost-64bit-fix.patch") is incorrect; it only addresses cases where
  a 64-bit kernel is built on a 64-bit build machine, overlooking cases
  on a 32-bit build machine.

  Using 1ULL ensures a 64-bit width on both 32-bit and 64-bit machines,
  avoiding the wraparound issue.

  Fixes: e0e9263271 ("[RHEL-9.7 rhel-78837 PATCH] PATCH: 1 line 2.6.18 bugfix: modpost-64bit-fix.patch")
  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes 5c99f925e4 modpost: fix acpi MODULE_DEVICE_TABLE built with mismatched endianness
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit 2e766a1f5f94a142d9a906c9411d0f6101c4c721
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Sun, 3 Nov 2024 21:46:50 +0900

  When CONFIG_SATA_AHCI_PLATFORM=m, modpost outputs incorect acpi
  MODULE_ALIAS() if the endianness of the target and the build machine
  do not match.

  When the endianness of the target kernel and the build machine match,
  the output is correct:

    $ grep 'MODULE_ALIAS("acpi' drivers/ata/ahci_platform.mod.c
    MODULE_ALIAS("acpi*:APMC0D33:*");
    MODULE_ALIAS("acpi*:010601:*");

  However, when building a little-endian kernel on a big-endian machine
  (or vice versa), the output is incorrect:

    $ grep 'MODULE_ALIAS("acpi' drivers/ata/ahci_platform.mod.c
    MODULE_ALIAS("acpi*:APMC0D33:*");
    MODULE_ALIAS("acpi*:0601??:*");

  The 'cls' and 'cls_msk' fields are 32-bit.

  DEF_FIELD() must be used instead of DEF_FIELD_ADDR() to correctly handle
  endianness of these 32-bit fields.

  The check 'if (cls)' was unnecessary; it never became NULL, as it was
  the pointer to 'symval' plus the offset to the 'cls' field.

  Fixes: 26095a01d3 ("ACPI / scan: Add support for ACPI _CLS device matching")
  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Desnes Nunes 4f276d368c modpost: remove incorrect code in do_eisa_entry()
JIRA: https://issues.redhat.com/browse/RHEL-78837

commit 0c3e091319e4748cb36ac9a50848903dc6f54054
Author: Masahiro Yamada <masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:39 +0900

  This function contains multiple bugs after the following commits:

   - ac55182899 ("modpost: i2c aliases need no trailing wildcard")
   - 6543becf26 ("mod/file2alias: make modalias generation safe for cross compiling")

  Commit ac55182899 inserted the following code to do_eisa_entry():

      else
              strcat(alias, "*");

  This is incorrect because 'alias' is uninitialized. If it is not
  NULL-terminated, strcat() could cause a buffer overrun.

  Even if 'alias' happens to be zero-filled, it would output:

      MODULE_ALIAS("*");

  This would match anything. As a result, the module could be loaded by
  any unrelated uevent from an unrelated subsystem.

  Commit ac55182899 introduced another bug.            

  Prior to that commit, the conditional check was:

      if (eisa->sig[0])

  This checked if the first character of eisa_device_id::sig was not '\0'.

  However, commit ac55182899 changed it as follows:

      if (sig[0])

  sig[0] is NOT the first character of the eisa_device_id::sig. The
  type of 'sig' is 'char (*)[8]', meaning that the type of 'sig[0]' is
  'char [8]' instead of 'char'. 'sig[0]' and 'symval' refer to the same
  address, which never becomes NULL.

  The correct conversion would have been:

      if ((*sig)[0])

  However, this if-conditional was meaningless because the earlier change
  in commit ac551828993e was incorrect.

  This commit removes the entire incorrect code, which should never have
  been executed.

  Fixes: ac55182899 ("modpost: i2c aliases need no trailing wildcard")
  Fixes: 6543becf26 ("mod/file2alias: make modalias generation safe for cross compiling")
  Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-06-12 16:47:11 -03:00
Donald Dutile 1e9a6cde66 modpost: Mark uuid_le type to be suitable only for MEI
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 248043299bf61134fb675d16963e11f49e79b05b
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Fri Nov 25 12:12:49 2022 +0200

    modpost: Mark uuid_le type to be suitable only for MEI

    The uuid_le type is used only in MEI ABI, do not advertise it for others.
    While at it, comment out that UUID types are not to be used in a new code.

    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:22 -04:00
Donald Dutile 4060329d04 modpost: Join broken long printed messages
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 0d2573a2b7838a4f6934c2835e6730b38df4bcc9
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Date:   Wed Nov 9 14:30:55 2022 +0100

    modpost: Join broken long printed messages

    Breaking long printed messages in multiple lines makes it very hard to
    look up where they originated from.

    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:22 -04:00
Donald Dutile f488b55f1b modpost: use sym_get_data() to get module device_table data
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit abe864b8e19adf33b48997de8bc1a8f095390ade
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Wed Jul 20 01:53:00 2022 +0900

    modpost: use sym_get_data() to get module device_table data

    Use sym_get_data() to replace the long code.

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:18 -04:00
Donald Dutile f8e5ebbd21 modpost: reuse ARRAY_SIZE() macro for section_mismatch()
JIRA: https://issues.redhat.com/browse/RHEL-28063

commit c5c468dcc25efc0095361bb63b6255622e22f695
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Tue May 24 01:46:25 2022 +0900

    modpost: reuse ARRAY_SIZE() macro for section_mismatch()

    Move ARRAY_SIZE() from file2alias.c to modpost.h to reuse it in
    section_mismatch().

    Also, move the variable 'check' inside the for-loop.

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
2024-06-17 14:17:17 -04:00
Íñigo Huguet 820dc7dea5 bus: mhi: ep: Add uevent support for module autoloading
Bugzilla: https://bugzilla.redhat.com/2136122

commit 5d4be19cbe6aadfad0a5f40df91bd478cedd8344
Author: Manivannan Sadhasivam <mani@kernel.org>
Date:   Mon Nov 29 16:35:35 2021 +0530

    bus: mhi: ep: Add uevent support for module autoloading
    
    Add uevent support to MHI endpoint bus so that the client drivers can be
    autoloaded by udev when the MHI endpoint devices gets created. The client
    drivers are expected to provide MODULE_DEVICE_TABLE with the MHI id_table
    struct so that the alias can be exported.
    
    The MHI endpoint reused the mhi_device_id structure of the MHI bus.
    
    Reviewed-by: Alex Elder <elder@linaro.org>
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2022-11-28 12:56:12 +01:00
Patrick Talbert 1c12bf4ea5 Merge: [EHL] Intel Sensor Hub (ISH): EClite driver enabling
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/864

```
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1921376
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45226519
Upstream status: v5.18-rc6

Commiits:
2dbebbcd24 HID: intel-ish-hid: fix module device-id handling
6de6c426d2 mod_devicetable: fix kdocs for ishtp_device_id
392e38a834 HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
583846d5e8 platform/x86: isthp_eclite: only load for matching devices
14e2a1900c platform/x86: Add Intel ishtp eclite driver
7ea3b09132 platform/x86: Add config file for Intel ishtp eclite driver

$ git diff --stat=80 6a43a24466
 MAINTAINERS                                        |   6 +
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c        |  13 +-
 drivers/hid/intel-ish-hid/ishtp-hid-client.c       |  13 +-
 drivers/hid/intel-ish-hid/ishtp/bus.c              |   2 +-
 drivers/platform/chrome/cros_ec_ishtp.c            |  13 +-
 drivers/platform/x86/intel/Kconfig                 |  16 +
 drivers/platform/x86/intel/Makefile                |   3 +
 drivers/platform/x86/intel/ishtp_eclite.c          | 703 +++++++++++++++++++++
 include/linux/intel-ish-client-if.h                |   4 +-
 include/linux/mod_devicetable.h                    |  14 +
 .../generic/x86/x86_64/CONFIG_INTEL_ISHTP_ECLITE   |   1 +
 scripts/mod/devicetable-offsets.c                  |   3 +
 scripts/mod/file2alias.c                           |  24 +
 13 files changed, 797 insertions(+), 18 deletions(-)

Signed-off-by: Tony Camuso <tcamuso@redhat.com>

Approved-by: Prarit Bhargava <prarit@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2022-05-25 09:28:12 +02:00
Tony Camuso 392e38a834 HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
```
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1921376
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45226519
Upstream status: v5.18-rc6

commit fa443bc3c1e4b28d9315dea882e8358ba6e26f8b
Author: Thomas Weißschuh <linux@weissschuh.net>
Date:   Fri Oct 29 17:28:56 2021 +0200

    HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()

    This allows to selectively autoload drivers for ISH devices.
    Currently all ISH drivers are loaded for all systems having any ISH
    device.

    Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Acked-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Signed-off-by: Tony Camuso <tcamuso@redhat.com>
2022-05-11 17:07:16 -04:00
Alex Williamson 4d045a511e PCI / VFIO: Add 'override_only' support for VFIO PCI sub system
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2076304

commit cc6711b0bf36de068b10490198d05ac168377989
Author: Max Gurtovoy <mgurtovoy@nvidia.com>
Date:   Thu Aug 26 13:39:09 2021 +0300

    PCI / VFIO: Add 'override_only' support for VFIO PCI sub system

    Expose an 'override_only' helper macro (i.e.
    PCI_DRIVER_OVERRIDE_DEVICE_VFIO) for VFIO PCI sub system and add the
    required code to prefix its matching entries with "vfio_" in
    modules.alias file.

    It allows VFIO device drivers to include match entries in the
    modules.alias file produced by kbuild that are not used for normal
    driver autoprobing and module autoloading. Drivers using these match
    entries can be connected to the PCI device manually, by userspace, using
    the existing driver_override sysfs.

    For example the resulting modules.alias may have:

      alias pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_core
      alias vfio_pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_vfio_pci
      alias vfio_pci:v*d*sv*sd*bc*sc*i* vfio_pci

    In this example mlx5_core and mlx5_vfio_pci match to the same PCI
    device. The kernel will autoload and autobind to mlx5_core but the
    kernel and udev mechanisms will ignore mlx5_vfio_pci.

    When userspace wants to change a device to the VFIO subsystem it can
    implement a generic algorithm:

       1) Identify the sysfs path to the device:
        /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0

       2) Get the modalias string from the kernel:
        $ cat /sys/bus/pci/devices/0000:01:00.0/modalias
        pci:v000015B3d00001021sv000015B3sd00000001bc02sc00i00

       3) Prefix it with vfio_:
        vfio_pci:v000015B3d00001021sv000015B3sd00000001bc02sc00i00

       4) Search modules.alias for the above string and select the entry that
          has the fewest *'s:
        alias vfio_pci:v000015B3d00001021sv*sd*bc*sc*i* mlx5_vfio_pci

       5) modprobe the matched module name:
        $ modprobe mlx5_vfio_pci

       6) cat the matched module name to driver_override:
        echo mlx5_vfio_pci > /sys/bus/pci/devices/0000:01:00.0/driver_override

       7) unbind device from original module
         echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind

       8) probe PCI drivers (or explicitly bind to mlx5_vfio_pci)
        echo 0000:01:00.0 > /sys/bus/pci/drivers_probe

    The algorithm is independent of bus type. In future the other buses with
    VFIO device drivers, like platform and ACPI, can use this algorithm as
    well.

    This patch is the infrastructure to provide the information in the
    modules.alias to userspace. Convert the only VFIO pci_driver which results
    in one new line in the modules.alias:

      alias vfio_pci:v*d*sv*sd*bc*sc*i* vfio_pci

    Later series introduce additional HW specific VFIO PCI drivers, such as
    mlx5_vfio_pci.

    Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Acked-by: Bjorn Helgaas <bhelgaas@google.com>  # for pci.h
    Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
    Link: https://lore.kernel.org/r/20210826103912.128972-11-yishaih@nvidia.com
    Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-05-04 09:07:42 -06:00
Linus Torvalds e229b429bb Char/Misc driver patches for 5.12-rc1
Here is the large set of char/misc/whatever driver subsystem updates for
 5.12-rc1.  Over time it seems like this tree is collecting more and more
 tiny driver subsystems in one place, making it easier for those
 maintainers, which is why this is getting larger.
 
 Included in here are:
 	- coresight driver updates
 	- habannalabs driver updates
 	- virtual acrn driver addition (proper acks from the x86
 	  maintainers)
 	- broadcom misc driver addition
 	- speakup driver updates
 	- soundwire driver updates
 	- fpga driver updates
 	- amba driver updates
 	- mei driver updates
 	- vfio driver updates
 	- greybus driver updates
 	- nvmeem driver updates
 	- phy driver updates
 	- mhi driver updates
 	- interconnect driver udpates
 	- fsl-mc bus driver updates
 	- random driver fix
 	- some small misc driver updates (rtsx, pvpanic, etc.)
 
 All of these have been in linux-next for a while, with the only reported
 issue being a merge conflict in include/linux/mod_devicetable.h that you
 will hit in your tree due to the dfl_device_id addition from the fpga
 subsystem in here.  The resolution should be simple.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYDZf9w8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk3xgCcCEN+pCJTum+uAzSNH3YKs/onaDgAnRSVwOUw
 tNW6n1JhXLYl9f5JdhvS
 =MOHs
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH:
 "Here is the large set of char/misc/whatever driver subsystem updates
  for 5.12-rc1. Over time it seems like this tree is collecting more and
  more tiny driver subsystems in one place, making it easier for those
  maintainers, which is why this is getting larger.

  Included in here are:

   - coresight driver updates

   - habannalabs driver updates

   - virtual acrn driver addition (proper acks from the x86 maintainers)

   - broadcom misc driver addition

   - speakup driver updates

   - soundwire driver updates

   - fpga driver updates

   - amba driver updates

   - mei driver updates

   - vfio driver updates

   - greybus driver updates

   - nvmeem driver updates

   - phy driver updates

   - mhi driver updates

   - interconnect driver udpates

   - fsl-mc bus driver updates

   - random driver fix

   - some small misc driver updates (rtsx, pvpanic, etc.)

  All of these have been in linux-next for a while, with the only
  reported issue being a merge conflict due to the dfl_device_id
  addition from the fpga subsystem in here"

* tag 'char-misc-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (311 commits)
  spmi: spmi-pmic-arb: Fix hw_irq overflow
  Documentation: coresight: Add PID tracing description
  coresight: etm-perf: Support PID tracing for kernel at EL2
  coresight: etm-perf: Clarify comment on perf options
  ACRN: update MAINTAINERS: mailing list is subscribers-only
  regmap: sdw-mbq: use MODULE_LICENSE("GPL")
  regmap: sdw: use no_pm routines for SoundWire 1.2 MBQ
  regmap: sdw: use _no_pm functions in regmap_read/write
  soundwire: intel: fix possible crash when no device is detected
  MAINTAINERS: replace my with email with replacements
  mhi: Fix double dma free
  uapi: map_to_7segment: Update example in documentation
  uio: uio_pci_generic: don't fail probe if pdev->irq equals to IRQ_NOTCONNECTED
  drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue
  firewire: replace tricky statement by two simple ones
  vme: make remove callback return void
  firmware: google: make coreboot driver's remove callback return void
  firmware: xilinx: Use explicit values for all enum values
  sample/acrn: Introduce a sample of HSM ioctl interface usage
  virt: acrn: Introduce an interface for Service VM to control vCPU
  ...
2021-02-24 10:25:37 -08:00
Xu Yilun 4a224acec5 fpga: dfl: add dfl bus support to MODULE_DEVICE_TABLE()
Device Feature List (DFL) is a linked list of feature headers within the
device MMIO space. It is used by FPGA to enumerate multiple sub features
within it. Each feature can be uniquely identified by DFL type and
feature id, which can be read out from feature headers.

A dfl bus helps DFL framework modularize DFL device drivers for
different sub features. The dfl bus matches its devices and drivers by
DFL type and feature id.

This patch adds dfl bus support to MODULE_DEVICE_TABLE() by adding info
about struct dfl_device_id in devicetable-offsets.c and add a dfl entry
point in file2alias.c.

Acked-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Link: https://lore.kernel.org/r/20210107043714.991646-6-mdf@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07 15:21:27 +01:00
Maximilian Luz eb0e90a820 platform/surface: aggregator: Add dedicated bus and device type
The Surface Aggregator EC provides varying functionality, depending on
the Surface device. To manage this functionality, we use dedicated
client devices for each subsystem or virtual device of the EC. While
some of these clients are described as standard devices in ACPI and the
corresponding client drivers can be implemented as platform drivers in
the kernel (making use of the controller API already present), many
devices, especially on newer Surface models, cannot be found there.

To simplify management of these devices, we introduce a new bus and
client device type for the Surface Aggregator subsystem. The new device
type takes care of managing the controller reference, essentially
guaranteeing its validity for as long as the client device exists, thus
alleviating the need to manually establish device links for that purpose
in the client driver (as has to be done with the platform devices).

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201221183959.1186143-7-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-01-07 00:06:39 +01:00
Dave Ertman 7de3697e9c Add auxiliary bus support
Add support for the Auxiliary Bus, auxiliary_device and auxiliary_driver.
It enables drivers to create an auxiliary_device and bind an
auxiliary_driver to it.

The bus supports probe/remove shutdown and suspend/resume callbacks.
Each auxiliary_device has a unique string based id; driver binds to
an auxiliary_device based on this id through the bus.

Co-developed-by: Kiran Patil <kiran.patil@intel.com>
Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Co-developed-by: Fred Oh <fred.oh@linux.intel.com>
Co-developed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Shiraz Saleem <shiraz.saleem@intel.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Martin Habets <mhabets@solarflare.com>
Link: https://lore.kernel.org/r/20201113161859.1775473-2-david.m.ertman@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/160695681289.505290.8978295443574440604.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-04 12:23:25 +01:00
Pierre-Louis Bossart b5924268d6 soundwire: extend SDW_SLAVE_ENTRY
The SoundWire 1.2 specification adds new capabilities that were not
present in previous version, such as the class ID.

To enable support for class drivers, and well as drivers that address
a specific version, all fields of the sdw_device_id structure need to
be exposed. For SoundWire 1.0 and 1.1 devices, a wildcard is used so
class and version information are ignored.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200608205436.2402-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-06-30 21:26:17 +05:30
Erwan Velu f5152f4ded firmware/dmi: Report DMI Bios & EC firmware release
Some vendors like HPe or Dell, encode the release version of their BIOS
in the "System BIOS {Major|Minor} Release" fields of Type 0.

This information is used to know which bios release actually runs.
It could be used for some quirks, debugging sessions or inventory tasks.

A typical output for a Dell system running the 65.27 bios is :
	[root@t1700 ~]# cat /sys/devices/virtual/dmi/id/bios_release
	65.27
	[root@t1700 ~]#

Servers that have a BMC encode the release version of their firmware in the
 "Embedded Controller Firmware {Major|Minor} Release" fields of Type 0.

This information is used to know which BMC release actually runs.
It could be used for some quirks, debugging sessions or inventory tasks.

A typical output for a Dell system running the 3.75 bmc release is :
    [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/ec_firmware_release
    3.75
    [root@t1700 ~]#

Signed-off-by: Erwan Velu <e.velu@criteo.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2020-06-06 11:35:50 +02:00
Linus Torvalds 0ad5b053d4 Char/Misc driver patches for 5.7-rc1
Here is the big set of char/misc/other driver patches for 5.7-rc1.
 
 Lots of things in here, and it's later than expected due to some reverts
 to resolve some reported issues.  All is now clean with no reported
 problems in linux-next.
 
 Included in here is:
 	- interconnect updates
 	- mei driver updates
 	- uio updates
 	- nvmem driver updates
 	- soundwire updates
 	- binderfs updates
 	- coresight updates
 	- habanalabs updates
 	- mhi new bus type and core
 	- extcon driver updates
 	- some Kconfig cleanups
 	- other small misc driver cleanups and updates
 
 As mentioned, all have been in linux-next for a while, and with the last
 two reverts, all is calm and good.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXodfvA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynzCQCfROhar3E8EhYEqSOP6xq6uhX9uegAnRgGY2rs
 rN4JJpOcTddvZcVlD+vo
 =ocWk
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH:
 "Here is the big set of char/misc/other driver patches for 5.7-rc1.

  Lots of things in here, and it's later than expected due to some
  reverts to resolve some reported issues. All is now clean with no
  reported problems in linux-next.

  Included in here is:
   - interconnect updates
   - mei driver updates
   - uio updates
   - nvmem driver updates
   - soundwire updates
   - binderfs updates
   - coresight updates
   - habanalabs updates
   - mhi new bus type and core
   - extcon driver updates
   - some Kconfig cleanups
   - other small misc driver cleanups and updates

  As mentioned, all have been in linux-next for a while, and with the
  last two reverts, all is calm and good"

* tag 'char-misc-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (174 commits)
  Revert "driver core: platform: Initialize dma_parms for platform devices"
  Revert "amba: Initialize dma_parms for amba devices"
  amba: Initialize dma_parms for amba devices
  driver core: platform: Initialize dma_parms for platform devices
  bus: mhi: core: Drop the references to mhi_dev in mhi_destroy_device()
  bus: mhi: core: Initialize bhie field in mhi_cntrl for RDDM capture
  bus: mhi: core: Add support for reading MHI info from device
  misc: rtsx: set correct pcr_ops for rts522A
  speakup: misc: Use dynamic minor numbers for speakup devices
  mei: me: add cedar fork device ids
  coresight: do not use the BIT() macro in the UAPI header
  Documentation: provide IBM contacts for embargoed hardware
  nvmem: core: remove nvmem_sysfs_get_groups()
  nvmem: core: use is_bin_visible for permissions
  nvmem: core: use device_register and device_unregister
  nvmem: core: add root_only member to nvmem device struct
  extcon: axp288: Add wakeup support
  extcon: Mark extcon_get_edev_name() function as exported symbol
  extcon: palmas: Hide error messages if gpio returns -EPROBE_DEFER
  dt-bindings: extcon: usbc-cros-ec: convert extcon-usbc-cros-ec.txt to yaml format
  ...
2020-04-03 13:22:40 -07:00
Manivannan Sadhasivam e6b0de469c bus: mhi: core: Add uevent support for module autoloading
Add uevent support to MHI bus so that the client drivers can be autoloaded
by udev when the MHI devices gets created. The client drivers are
expected to provide MODULE_DEVICE_TABLE with the MHI id_table struct so
that the alias can be exported.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org>
Tested-by: Jeffrey Hugo <jhugo@codeaurora.org>
Link: https://lore.kernel.org/r/20200220095854.4804-13-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-19 07:41:05 +01:00
Boris Brezillon 1ce589ad39 i3c: Generate aliases for i3c modules
This part was missing, thus preventing user space from loading modules
automatically when MODALIAS uevents are received.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Vitor Soares <vitor.soares@synopsys.com>
Link: https://lore.kernel.org/linux-i3c/79687073b915182e06fccfb18adcedfd0fadbc99.1582796652.git.vitor.soares@synopsys.com
2020-02-28 09:36:00 +01:00
Heikki Krogerus 389c9af7f1 modpost: add guid_t type definition
Since guid_t is the recommended data type for UUIDs in
kernel (and I guess uuid_le is meant to be ultimately
replaced with it), it should be made available here as
well.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-09-04 22:55:42 +09:00
Linus Torvalds dbbdf54c72 platform-drivers-x86 for v5.1-1
Use MODULE_DEVICE_TABLE across several wmi drivers, keeping
 wmi_device_id and MODULE_ALIAS() declarations in sync. Add several
 Ideapad models to the no_hw_rfkill list. Add support for new Mellanox
 platforms, including new fan and LED functionality. Address Dell
 keyboard backlight change event and power button release issues. Update
 dell_rbu to use appropriate memory allocation mechanisms. Several small
 fixes and Ice Lake support for intel_pmc_core. Fix a suspend regression
 for Cherry Trail based devices in intel_int0002_vgpio. A few other
 routine fixes.
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI / scan:
  -  Create platform device for BSG2150 ACPI nodes
 
 Documentation/ABI:
  -  Add new attribute for mlxreg-io sysfs interfaces
  -  Correct mlxreg-io KernelVersion for 5.0
 
 MAINTAINERS:
  -  Include mlxreg.h in Mellanox Platform Driver files
 
 asus-wmi:
  -  Allow loading on systems without the Asus Management GUID
 
 dell-smbios-wmi:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
 
 dell-wmi:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  -  Ignore new keyboard backlight change event
 
 dell-wmi-descriptor:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
 
 dell_rbu:
  -  fix lock imbalance in img_update_realloc
  -  stop abusing the DMA API
 
 huawei-wmi:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
 
 ideapad-laptop:
  -  Add ideapad 330-15ICH to no_hw_rfkill
  -  Add S130-14IGM to no_hw_rfkill list
  -  Add Ideapad 530S-14ARR to no_hw_rfkill list
  -  Add Yoga C930 to no_hw_rfkill_list
  -  Add Y530-I5ICH-1060 to no_hw_rfkill list
  -  Fix no_hw_rfkill_list for Lenovo RESCUER R720-15IKBN
 
 intel-hid:
  -  Missing power button release on some Dell models
 
 intel-wmi-thunderbolt:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
 
 intel_int0002_vgpio:
  -  Only implement irq_set_wake on Bay Trail
 
 intel_pmc_core:
  -  Quirk to ignore XTAL shutdown
  -  Add Package cstates residency info
  -  Add ICL platform support
  -  Convert to INTEL_CPU_FAM6 macro
  -  Avoid a u32 overflow
  -  Include Reserved IP for LTR
  -  Fix file permissions for ltr_show
  -  Fix PCH IP name
  -  Fix PCH IP sts reading
  -  Handle CFL regmap properly
 
 leds:
  -  mlxreg: Add support for capability register
 
 mlx-platform:
  -  Fix access mode for fan_dir attribute
  -  Add UID LED for the next generation systems
  -  Add extra CPLD for next generation systems
  -  Add support for new VMOD0007 board name
  -  Add support for fan capability registers
  -  Add support for fan direction register
 
 modpost:
  -  file2alias: define size of alias
 
 platform/mellanox:
  -  mlxreg-hotplug: Fix KASAN warning
 
 platform_data/mlxreg:
  -  Add capability field to core platform data
  -  Document fixes for core platform data
 
 touchscreen_dmi:
  -  Add info for the CHUWI Hi10 Air tablet
  -  Add info for the Chuwi Hi8 Air tablet
  -  Add info for the PoV Wintab P1006w (v1.0) tablet
 
 wmi:
  -  add WMI support to MODULE_DEVICE_TABLE()
  -  move struct wmi_device_id to mod_devicetable.h
  -  fix potential null pointer dereference
 
 wmi-bmof:
  -  use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
 
 x86/CPU:
  -  Add Icelake model number
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEE9M1dh6j+oEL41EZIXFIlAfdBhuEFAlyCu1EACgkQXFIlAfdB
 huFASAf/d0Y6uqhLD3G7cL2kXjOWoTE9ouWUwv19bBpnohGmD3OMMap4y1lb6nRR
 thCJRhpmX4ObS2adAC4otiOxTzmVoYGsuS9kfBwhKIby2VYHCCxxaTUs6bzMdOfV
 GsbaMA+vfb29bU4DcWlRtYZIz2FC5oyjW4ZmcMA6KtuBGjG9K1fG5zANQe4H8I0e
 zCdcrXhpDGIBJgaJR2N42EUCJruPoEXYfHa1G4B/QKvuW0CXHAdSE0YrN4ju+S3e
 Ew9ZXhoxRaqlu+ZB7H5Kyy6Mg3ZGMzbeYyQFLk5f2yiKSTFNiqwTEJl1aE2JSpy3
 g8Im+6E44/4G8QOL40g5XwmrxHw5mA==
 =Bx4o
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver updates from Darren Hart:

 - use MODULE_DEVICE_TABLE across several wmi drivers, keeping
   wmi_device_id and MODULE_ALIAS() declarations in sync

 - add several Ideapad models to the no_hw_rfkill list

 - add support for new Mellanox platforms, including new fan and LED
   functionality

 - address Dell keyboard backlight change event and power button release
   issues

 - update dell_rbu to use appropriate memory allocation mechanisms

 - several small fixes and Ice Lake support for intel_pmc_core

 - fix a suspend regression for Cherry Trail based devices in
   intel_int0002_vgpio

 - a few other routine fixes

* tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86: (50 commits)
  MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files
  platform/x86: ideapad-laptop: Add S130-14IGM to no_hw_rfkill list
  platform/x86: mlx-platform: Fix access mode for fan_dir attribute
  platform/x86: mlx-platform: Add UID LED for the next generation systems
  platform/x86: mlx-platform: Add extra CPLD for next generation systems
  platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
  platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h
  modpost: file2alias: define size of alias
  platform/x86: touchscreen_dmi: Add info for the CHUWI Hi10 Air tablet
  platform/x86: ideapad-laptop: Add Ideapad 530S-14ARR to no_hw_rfkill list
  platform/x86: ideapad-laptop: Add Yoga C930 to no_hw_rfkill_list
  platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown
  platform/x86: intel_pmc_core: Add Package cstates residency info
  platform/x86: intel_pmc_core: Add ICL platform support
  ...
2019-03-10 13:16:37 -07:00
Mattias Jacobsson 0bc44b2b8b platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
The kernel provides the macro MODULE_DEVICE_TABLE() where driver authors
can specify their device type and their array of device_ids and thereby
trigger the generation of the appropriate MODULE_ALIAS() output. This is
opposed to having to specify one MODULE_ALIAS() for each device. The WMI
device type is currently not supported.

While using MODULE_DEVICE_TABLE() does increase the complexity as well
as spreading out the implementation across the kernel, it does come with
some benefits too;
* It makes different drivers look more similar; if you can specify the
  array of device_ids any device type specific input to MODULE_ALIAS()
  will automatically be generated for you.
* It helps each driver avoid keeping multiple versions of the same
  information in sync. That is, both the array of device_ids and the
  potential multitude of MODULE_ALIAS()'s.

Add WMI support to MODULE_DEVICE_TABLE() by adding info about struct
wmi_device_id in devicetable-offsets.c and add a WMI entry point in
file2alias.c.

The type argument for MODULE_DEVICE_TABLE(type, name) is wmi.

Suggested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2019-03-07 08:46:29 -08:00
Mattias Jacobsson eacc95eae6 platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h
In preparation for adding WMI support to MODULE_DEVICE_TABLE() move the
definition of struct wmi_device_id to mod_devicetable.h and inline
guid_string in the struct.

Changing guid_string to an inline char array changes the loop conditions
when looping over an array of struct wmi_device_id. Therefore update
wmi_dev_match()'s loop to check for an empty guid_string instead of a
NULL pointer.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
[dvhart: Move UUID_STRING_LEN define to this patch]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2019-03-07 08:46:07 -08:00
Mattias Jacobsson 841f1b8fb4 modpost: file2alias: define size of alias
The size of the variable alias provided to do_entry functions are
currently not readily available. Thus hindering do_entry functions to
perform bounds checking.

Define the macro ALIAS_SIZE containing the size of the variable alias.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2019-03-06 23:12:34 -08:00
Sumit Garg 0fc1db9d10 tee: add bus driver framework for TEE based devices
Introduce a generic TEE bus driver concept for TEE based kernel drivers
which would like to communicate with TEE based devices/services. Also
add support in module device table for these new TEE based devices.

In this TEE bus concept, devices/services are identified via Universally
Unique Identifier (UUID) and drivers register a table of device UUIDs
which they can support.

So this TEE bus framework registers following apis:
- match(): Iterates over the driver UUID table to find a corresponding
  match for device UUID. If a match is found, then this particular device
  is probed via corresponding probe api registered by the driver. This
  process happens whenever a device or a driver is registered with TEE
  bus.
- uevent(): Notifies user-space (udev) whenever a new device is registered
  on this bus for auto-loading of modularized drivers.

Also this framework allows for device enumeration to be specific to
corresponding TEE implementation like OP-TEE etc.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Bhupesh Sharma <bhsharma@redhat.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-01 15:12:46 +01:00
Masahiro Yamada f880eea68f modpost: file2alias: check prototype of handler
Use specific prototype instead of an opaque pointer so that the
compiler can catch function prototype mismatch.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Mathieu Malaterre <malat@debian.org>
2018-12-01 22:21:58 +09:00
Masahiro Yamada ec91e78d37 modpost: file2alias: go back to simple devtable lookup
Commit e49ce14150 ("modpost: use linker section to generate table.")
was not so cool as we had expected first; it ended up with ugly section
hacks when commit dd2a3acaec ("mod/file2alias: make modpost compile
on darwin again") came in.

Given a certain degree of unknowledge about the link stage of host
programs, I really want to see simple, stupid table lookup so that
this works in the same way regardless of the underlying executable
format.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Mathieu Malaterre <malat@debian.org>
2018-12-01 22:21:57 +09:00
Leonardo Bras c2b1a9226f modpost: Create macro to avoid variable shadowing
Create DEF_FIELD_ADDR_VAR as a more generic version of the DEF_FIELD_ADD
macro, allowing usage of a variable name other than the struct element name.
Also, sets DEF_FIELD_ADDR as a specific usage of DEF_FILD_ADDR_VAR in which
the var name is the same as the struct element name.
Then, makes use of DEF_FIELD_ADDR_VAR to create a variable of another name,
in order to avoid variable shadowing.

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-10-29 00:41:41 +09:00
Masahiro Yamada 153e04b373 modpost: remove leftover symbol prefix handling for module device table
Blackfin and metag were the only architectures that prefix symbols with
an underscore. They were removed by commit 4ba66a9760 ("arch: remove
blackfin port"), commit bb6fb6dfcc ("metag: Remove arch/metag/"),
respectively.

It is no longer necessary to handle <prefix> part of module device
table symbols.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-10-19 09:47:44 +09:00
Heikki Krogerus 8a37d87d72 usb: typec: Bus type for alternate modes
Introducing a simple bus for the alternate modes. Bus allows
binding drivers to the discovered alternate modes the
partners support.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-02 17:42:36 +02:00
Andrew F. Davis 5b7d127726 rpmsg: Correct support for MODULE_DEVICE_TABLE()
Due to missing a missing entry in file2alias.c MODULE_DEVICE_TABLE() are
not generating the proper module aliases. Add the needed entry here.

Fixes: bcabbccabf ("rpmsg: add virtio-based remote processor messaging bus")
Reported-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 16:33:48 +02:00
Vinod Koul 9251345dca soundwire: Add SoundWire bus type
This adds the base SoundWire bus type, bus and driver registration.
along with changes to module device table for new SoundWire
device type.

Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Acked-By: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19 11:14:56 +01:00
David S. Miller e1ea2f9856 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Several conflicts here.

NFP driver bug fix adding nfp_netdev_is_nfp_repr() check to
nfp_fl_output() needed some adjustments because the code block is in
an else block now.

Parallel additions to net/pkt_cls.h and net/sch_generic.h

A bug fix in __tcp_retransmit_skb() conflicted with some of
the rbtree changes in net-next.

The tc action RCU callback fixes in 'net' had some overlap with some
of the recent tcf_block reworking.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-30 21:09:24 +09:00
Dmitry Torokhov 09c3e01b25 Input: do not use property bits when generating module alias
The commit 8724ecb072 ("Input: allow matching device IDs on property
bits") started using property bits when generating module aliases for input
handlers, but did not adjust the generation of MODALIAS attribute on input
device uevents, breaking automatic module loading. Given that no handler
currently uses property bits in their module tables, let's revert this part
of the commit for now.

Reported-by: Damien Wyart <damien.wyart@gmail.com>
Tested-by: Damien Wyart <damien.wyart@gmail.com>
Fixes: 8724ecb072 ("Input: allow matching device IDs on property bits")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-22 12:49:59 -07:00
David S. Miller f8ddadc4db Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
There were quite a few overlapping sets of changes here.

Daniel's bug fix for off-by-ones in the new BPF branch instructions,
along with the added allowances for "data_end > ptr + x" forms
collided with the metadata additions.

Along with those three changes came veritifer test cases, which in
their final form I tried to group together properly.  If I had just
trimmed GIT's conflict tags as-is, this would have split up the
meta tests unnecessarily.

In the socketmap code, a set of preemption disabling changes
overlapped with the rename of bpf_compute_data_end() to
bpf_compute_data_pointers().

Changes were made to the mv88e6060.c driver set addr method
which got removed in net-next.

The hyperv transport socket layer had a locking change in 'net'
which overlapped with a change of socket state macro usage
in 'net-next'.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-22 13:39:14 +01:00
Dmitry Torokhov 8724ecb072 Input: allow matching device IDs on property bits
Let's allow matching input devices on their property bits, both in-kernel
and when generating module aliases.

Tested-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:54:49 -07:00
Mika Westerberg d1ff70241a thunderbolt: Add support for XDomain discovery protocol
When two hosts are connected over a Thunderbolt cable, there is a
protocol they can use to communicate capabilities supported by the host.
The discovery protocol uses automatically configured control channel
(ring 0) and is build on top of request/response transactions using
special XDomain primitives provided by the Thunderbolt base protocol.

The capabilities consists of a root directory block of basic properties
used for identification of the host, and then there can be zero or more
directories each describing a Thunderbolt service and its capabilities.

Once both sides have discovered what is supported the two hosts can
setup high-speed DMA paths and transfer data to the other side using
whatever protocol was agreed based on the properties. The software
protocol used to communicate which DMA paths to enable is service
specific.

This patch adds support for the XDomain discovery protocol to the
Thunderbolt bus. We model each remote host connection as a Linux XDomain
device. For each Thunderbolt service found supported on the XDomain
device, we create Linux Thunderbolt service device which Thunderbolt
service drivers can then bind to based on the protocol identification
information retrieved from the property directory describing the
service.

This code is based on the work done by Amir Levy and Michael Jamet.

Signed-off-by: Michael Jamet <michael.jamet@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-02 11:24:41 -07:00
Stuart Yoder 0afef45654 staging: fsl-mc: add support for device table matching
Move the definition of fsl_mc_device_id to its proper location in
mod_devicetable.h, and add fsl-mc bus support to devicetable-offsets.c
and file2alias.c to enable device table matching.  With this patch udev
based module loading of fsl-mc drivers is supported.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00
Wolfram Sang b3c0a4dab7 of: fix autoloading due to broken modalias with no 'compatible'
Because of an improper dereference, a stray 'C' character was output to
the modalias when no 'compatible' was specified. This is the case for
some old PowerMac drivers which only set the 'name' property. Fix it to
let them match again.

Reported-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Mathieu Malaterre <malat@debian.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Fixes: 6543becf26 ("mod/file2alias: make modalias generation safe for cross compiling")
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-06-08 10:40:20 +10:00
Philipp Zabel acbef7b766 modpost: fix module autoloading for OF devices with generic compatible property
Since the wildcard at the end of OF module aliases is gone, autoloading
of modules that don't match a device's last (most generic) compatible
value fails.

For example the CODA960 VPU on i.MX6Q has the SoC specific compatible
"fsl,imx6q-vpu" and the generic compatible "cnm,coda960".  Since the
driver currently only works with knowledge about the SoC specific
integration, it doesn't list "cnm,cod960" in the module device table.

This results in the device compatible
"of:NvpuT<NULL>Cfsl,imx6q-vpuCcnm,coda960" not matching the module alias
"of:N*T*Cfsl,imx6q-vpu" anymore, whereas before commit 2f632369ab
("modpost: don't add a trailing wildcard for OF module aliases") it
matched the module alias "of:N*T*Cfsl,imx6q-vpu*".

This patch adds two module aliases for each compatible, one without the
wildcard and one with "C*" appended.

  $ modinfo coda | grep imx6q
  alias:          of:N*T*Cfsl,imx6q-vpuC*
  alias:          of:N*T*Cfsl,imx6q-vpu

Fixes: 2f632369ab ("modpost: don't add a trailing wildcard for OF module aliases")
Link: http://lkml.kernel.org/r/1462203339-15340-1-git-send-email-p.zabel@pengutronix.de
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>	[4.5+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-05 17:38:53 -07:00
Javier Martinez Canillas 2f632369ab modpost: don't add a trailing wildcard for OF module aliases
Commit ac55182899 ("modpost: i2c aliases need no trailing wildcard")
removed the wildcard at the end of the I2C module aliases because I2C
devices have no IDs so the aliases are just arbitrary device names.

This is also true for OF modaliases since a compatible string is used to
define a specific IP hardware block.  So the modalias should match a
specific compatible string and not attempt to match a compatible string
whose name matches the beginning of another one.

For example, the following driver module:

  $ modinfo cros_ec_keyb | grep alias
  alias:          platform:cros-ec-keyb
  alias:          of:N*T*Cgoogle,cros-ec-keyb*

will be tried to be loaded for an alias of:N*T*Cgoogle,cros-ec-keyb-v2
but there could be a different driver that supports the device for that
compatible string so it's better to remove the trailing wildcard for OF.

Also, remove the word "always" from the add_wildcard() function comment
since that was carried from the time where a wildcard was always added
at the end of the module alias for all the devices.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Suggested-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-14 16:00:49 -08:00
K. Y. Srinivasan af3ff643ea Drivers: hv: vmbus: Use uuid_le type consistently
Consistently use uuid_le type in the Hyper-V driver code.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-14 19:15:05 -08:00