linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
@ 2021-10-29 15:28 Thomas Weißschuh
  2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:28 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Mark Gross, Hans de Goede, Rushikesh S Kadam, Jiri Kosina,
	Benjamin Tissoires, Guenter Roeck, Enric Balletbo i Serra,
	Benson Leung, platform-driver-x86, linux-kbuild

Currently as soon as any ISHTP device appears all available ISHTP device
drivers are loaded automatically.
This series extends the MODULE_DEVICE_TABLE() functionality to properly handle
the ishtp bus and switches the drivers over to use it.

Patch 1 adds the infrastructure to handle ishtp devices via MODULE_DEVICE_TABLE()
Patch 2 replaces some inlined constants with ones now defined by mod_devicetable.h
Patches 3-6 migrate all ishtp drivers to MODULE_DEVICE_TABLE()

Note: This patchset is based on the pdx86/for-next tree because that contains
one of the drivers that is not yet in the other trees.

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Benson Leung <bleung@chromium.org>

Cc: platform-driver-x86@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org

Thomas Weißschuh (6):
  HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
  HID: intel-ish-hid: use constants for modaliases
  HID: intel-ish-hid: fw-loader: only load for matching devices
  HID: intel-ish-hid: hid-client: only load for matching devices
  platform/chrome: chros_ec_ishtp: only load for matching devices
  platform/x86: isthp_eclite: only load for matching devices

 drivers/hid/intel-ish-hid/ishtp-fw-loader.c  |  7 +++++-
 drivers/hid/intel-ish-hid/ishtp-hid-client.c |  7 +++++-
 drivers/hid/intel-ish-hid/ishtp/bus.c        |  4 ++--
 drivers/platform/chrome/cros_ec_ishtp.c      |  7 +++++-
 drivers/platform/x86/intel/ishtp_eclite.c    |  7 +++++-
 include/linux/mod_devicetable.h              | 13 +++++++++++
 scripts/mod/devicetable-offsets.c            |  3 +++
 scripts/mod/file2alias.c                     | 24 ++++++++++++++++++++
 8 files changed, 66 insertions(+), 6 deletions(-)


base-commit: 85303db36b6e170917a7bc6aae4898c31a5272a0
-- 
2.33.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
  2021-10-29 15:28 [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Thomas Weißschuh
@ 2021-10-29 15:28 ` Thomas Weißschuh
  2021-10-29 15:28   ` [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases Thomas Weißschuh
  2021-11-01  9:58   ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Hans de Goede
  2021-11-01  9:56 ` [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Hans de Goede
  2021-11-09 10:42 ` Jiri Kosina
  2 siblings, 2 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:28 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, linux-kbuild,
	Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires,
	Hans de Goede, Masahiro Yamada, Michal Marek, Nick Desaulniers

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>

---

Cc: linux-kbuild@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Nick Desaulniers <ndesaulniers@google.com>
---
 include/linux/mod_devicetable.h   | 13 +++++++++++++
 scripts/mod/devicetable-offsets.c |  3 +++
 scripts/mod/file2alias.c          | 24 ++++++++++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae2e75d15b21..befbf53c4b7c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -895,4 +895,17 @@ struct dfl_device_id {
 	kernel_ulong_t driver_data;
 };
 
+/* ISHTP (Integrated Sensor Hub Transport Protocol) */
+
+#define ISHTP_MODULE_PREFIX	"ishtp:"
+
+/**
+ * struct ishtp_device_id - ISHTP device identifier
+ * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
+ * @context: pointer to driver specific data
+ */
+struct ishtp_device_id {
+	guid_t guid;
+};
+
 #endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index cc3625617a0e..c0d3bcb99138 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -259,5 +259,8 @@ int main(void)
 	DEVID_FIELD(dfl_device_id, type);
 	DEVID_FIELD(dfl_device_id, feature_id);
 
+	DEVID(ishtp_device_id);
+	DEVID_FIELD(ishtp_device_id, guid);
+
 	return 0;
 }
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 49aba862073e..5258247d78ac 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -115,6 +115,17 @@ static inline void add_uuid(char *str, uuid_le uuid)
 		uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
 }
 
+static inline void add_guid(char *str, guid_t guid)
+{
+	int len = strlen(str);
+
+	sprintf(str + len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
+		guid.b[3], guid.b[2], guid.b[1], guid.b[0],
+		guid.b[5], guid.b[4], guid.b[7], guid.b[6],
+		guid.b[8], guid.b[9], guid.b[10], guid.b[11],
+		guid.b[12], guid.b[13], guid.b[14], guid.b[15]);
+}
+
 /**
  * Check that sizeof(device_id type) are consistent with size of section
  * in .o file. If in-consistent then userspace and kernel does not agree
@@ -1380,6 +1391,18 @@ static int do_mhi_entry(const char *filename, void *symval, char *alias)
 	return 1;
 }
 
+/* Looks like: ishtp:{guid} */
+static int do_ishtp_entry(const char *filename, void *symval, char *alias)
+{
+	DEF_FIELD(symval, ishtp_device_id, guid);
+
+	strcpy(alias, ISHTP_MODULE_PREFIX "{");
+	add_guid(alias, guid);
+	strcat(alias, "}");
+
+	return 1;
+}
+
 static int do_auxiliary_entry(const char *filename, void *symval, char *alias)
 {
 	DEF_FIELD_ADDR(symval, auxiliary_device_id, name);
@@ -1499,6 +1522,7 @@ static const struct devtable devtable[] = {
 	{"auxiliary", SIZE_auxiliary_device_id, do_auxiliary_entry},
 	{"ssam", SIZE_ssam_device_id, do_ssam_entry},
 	{"dfl", SIZE_dfl_device_id, do_dfl_entry},
+	{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
 };
 
 /* Create MODULE_ALIAS() statements.
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases
  2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
@ 2021-10-29 15:28   ` Thomas Weißschuh
  2021-10-29 15:28     ` [PATCH 3/6] HID: intel-ish-hid: fw-loader: only load for matching devices Thomas Weißschuh
  2021-11-01  9:58   ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Hans de Goede
  1 sibling, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:28 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Jiri Kosina, Benjamin Tissoires

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 334eac611774..e159cd1c5f37 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -350,7 +350,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
 {
 	int len;
 
-	len = snprintf(buf, PAGE_SIZE, "ishtp:%s\n", dev_name(dev));
+	len = snprintf(buf, PAGE_SIZE, ISHTP_MODULE_PREFIX "%s\n", dev_name(dev));
 	return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
 static DEVICE_ATTR_RO(modalias);
@@ -363,7 +363,7 @@ ATTRIBUTE_GROUPS(ishtp_cl_dev);
 
 static int ishtp_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
-	if (add_uevent_var(env, "MODALIAS=ishtp:%s", dev_name(dev)))
+	if (add_uevent_var(env, "MODALIAS=" ISHTP_MODULE_PREFIX "%s", dev_name(dev)))
 		return -ENOMEM;
 	return 0;
 }
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/6] HID: intel-ish-hid: fw-loader: only load for matching devices
  2021-10-29 15:28   ` [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases Thomas Weißschuh
@ 2021-10-29 15:28     ` Thomas Weißschuh
  2021-10-29 15:28       ` [PATCH 4/6] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:28 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Jiri Kosina, Benjamin Tissoires

Previously it was loaded for all ISHTP devices.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
---
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
index 1b486f262747..945a9d0b68cd 100644
--- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
+++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
@@ -1063,6 +1063,12 @@ static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
 	.reset = loader_ishtp_cl_reset,
 };
 
+static const struct ishtp_device_id loader_ishtp_id_table[] = {
+	{ loader_ishtp_guid },
+	{ }
+};
+MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);
+
 static int __init ish_loader_init(void)
 {
 	return ishtp_cl_driver_register(&loader_ishtp_cl_driver, THIS_MODULE);
@@ -1083,4 +1089,3 @@ MODULE_DESCRIPTION("ISH ISH-TP Host firmware Loader Client Driver");
 MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
 
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("ishtp:*");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/6] HID: intel-ish-hid: hid-client: only load for matching devices
  2021-10-29 15:28     ` [PATCH 3/6] HID: intel-ish-hid: fw-loader: only load for matching devices Thomas Weißschuh
@ 2021-10-29 15:28       ` Thomas Weißschuh
  2021-10-29 15:29         ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:28 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Jiri Kosina, Benjamin Tissoires

Previously it was loaded for all ISHTP devices.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
---
 drivers/hid/intel-ish-hid/ishtp-hid-client.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index 91bf4d01e91a..fb47d38d1e87 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -952,6 +952,12 @@ static struct ishtp_cl_driver	hid_ishtp_cl_driver = {
 	.driver.pm = &hid_ishtp_pm_ops,
 };
 
+static const struct ishtp_device_id hid_ishtp_id_table[] = {
+	{ hid_ishtp_guid },
+	{ }
+};
+MODULE_DEVICE_TABLE(ishtp, hid_ishtp_id_table);
+
 static int __init ish_hid_init(void)
 {
 	int	rv;
@@ -981,4 +987,3 @@ MODULE_AUTHOR("Daniel Drubin <daniel.drubin@intel.com>");
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("ishtp:*");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices
  2021-10-29 15:28       ` [PATCH 4/6] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
@ 2021-10-29 15:29         ` Thomas Weißschuh
  2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
  0 siblings, 2 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:29 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Jiri Kosina, Benjamin Tissoires, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck

Previously it was loaded for all ISHTP devices.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Cc: Benson Leung <bleung@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
---
 drivers/platform/chrome/cros_ec_ishtp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
index 9d1e7e03628e..8c17358e84c1 100644
--- a/drivers/platform/chrome/cros_ec_ishtp.c
+++ b/drivers/platform/chrome/cros_ec_ishtp.c
@@ -774,6 +774,12 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
 	},
 };
 
+static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
+	{ cros_ish_guid },
+	{ }
+};
+MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
+
 static int __init cros_ec_ishtp_mod_init(void)
 {
 	return ishtp_cl_driver_register(&cros_ec_ishtp_driver, THIS_MODULE);
@@ -791,4 +797,3 @@ MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver");
 MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
 
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("ishtp:*");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 6/6] platform/x86: isthp_eclite: only load for matching devices
  2021-10-29 15:29         ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
@ 2021-10-29 15:29           ` Thomas Weißschuh
  2021-10-29 15:29             ` Thomas Weißschuh
  2021-11-01  9:59             ` Hans de Goede
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
  1 sibling, 2 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:29 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada, K,
	Naduvalath, Sumesh, Jiri Kosina, Benjamin Tissoires,
	Hans de Goede, Mark Gross, platform-driver-x86

Previously it was loaded for all ISHTP devices.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: linux-input@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
---
 drivers/platform/x86/intel/ishtp_eclite.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/ishtp_eclite.c b/drivers/platform/x86/intel/ishtp_eclite.c
index 12fc98a48657..b9fb8f28fd63 100644
--- a/drivers/platform/x86/intel/ishtp_eclite.c
+++ b/drivers/platform/x86/intel/ishtp_eclite.c
@@ -681,6 +681,12 @@ static struct ishtp_cl_driver ecl_ishtp_cl_driver = {
 	.driver.pm = &ecl_ishtp_pm_ops,
 };
 
+static const struct ishtp_device_id ecl_ishtp_id_table[] = {
+	{ ecl_ishtp_guid },
+	{ }
+};
+MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
+
 static int __init ecl_ishtp_init(void)
 {
 	return ishtp_cl_driver_register(&ecl_ishtp_cl_driver, THIS_MODULE);
@@ -698,4 +704,3 @@ MODULE_DESCRIPTION("ISH ISHTP eclite client opregion driver");
 MODULE_AUTHOR("K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com>");
 
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("ishtp:*");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 6/6] platform/x86: isthp_eclite: only load for matching devices
  2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
@ 2021-10-29 15:29             ` Thomas Weißschuh
  2021-11-01  9:59             ` Hans de Goede
  1 sibling, 0 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-10-29 15:29 UTC (permalink / raw)
  To: linux-input
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Sumesh K Naduvalath, Jiri Kosina, Benjamin Tissoires,
	Hans de Goede, Mark Gross, platform-driver-x86

Previously it was loaded for all ISHTP devices.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Sumesh K Naduvalath <sumesh.k.naduvalath@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: linux-input@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
---
 drivers/platform/x86/intel/ishtp_eclite.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/ishtp_eclite.c b/drivers/platform/x86/intel/ishtp_eclite.c
index 12fc98a48657..b9fb8f28fd63 100644
--- a/drivers/platform/x86/intel/ishtp_eclite.c
+++ b/drivers/platform/x86/intel/ishtp_eclite.c
@@ -681,6 +681,12 @@ static struct ishtp_cl_driver ecl_ishtp_cl_driver = {
 	.driver.pm = &ecl_ishtp_pm_ops,
 };
 
+static const struct ishtp_device_id ecl_ishtp_id_table[] = {
+	{ ecl_ishtp_guid },
+	{ }
+};
+MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
+
 static int __init ecl_ishtp_init(void)
 {
 	return ishtp_cl_driver_register(&ecl_ishtp_cl_driver, THIS_MODULE);
@@ -698,4 +704,3 @@ MODULE_DESCRIPTION("ISH ISHTP eclite client opregion driver");
 MODULE_AUTHOR("K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com>");
 
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("ishtp:*");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-10-29 15:28 [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Thomas Weißschuh
  2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
@ 2021-11-01  9:56 ` Hans de Goede
  2021-11-01 10:12   ` Thomas Weißschuh
  2021-11-09 10:42 ` Jiri Kosina
  2 siblings, 1 reply; 24+ messages in thread
From: Hans de Goede @ 2021-11-01  9:56 UTC (permalink / raw)
  To: Thomas Weißschuh, linux-input
  Cc: linux-kernel, Srinivas Pandruvada, Mark Gross, Rushikesh S Kadam,
	Jiri Kosina, Benjamin Tissoires, Guenter Roeck,
	Enric Balletbo i Serra, Benson Leung, platform-driver-x86,
	linux-kbuild

Hi,

On 10/29/21 17:28, Thomas Weißschuh wrote:
> Currently as soon as any ISHTP device appears all available ISHTP device
> drivers are loaded automatically.
> This series extends the MODULE_DEVICE_TABLE() functionality to properly handle
> the ishtp bus and switches the drivers over to use it.
> 
> Patch 1 adds the infrastructure to handle ishtp devices via MODULE_DEVICE_TABLE()
> Patch 2 replaces some inlined constants with ones now defined by mod_devicetable.h
> Patches 3-6 migrate all ishtp drivers to MODULE_DEVICE_TABLE()
> 
> Note: This patchset is based on the pdx86/for-next tree because that contains
> one of the drivers that is not yet in the other trees.

Since most of the changes here are under drivers/hid and since the latter
patches depend on 1/6, I believe it would be best to merge the entire series
through the HID tree, here is my ack for this:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Mark Gross <markgross@kernel.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Benson Leung <bleung@chromium.org>
> 
> Cc: platform-driver-x86@vger.kernel.org
> Cc: linux-kbuild@vger.kernel.org
> 
> Thomas Weißschuh (6):
>   HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
>   HID: intel-ish-hid: use constants for modaliases
>   HID: intel-ish-hid: fw-loader: only load for matching devices
>   HID: intel-ish-hid: hid-client: only load for matching devices
>   platform/chrome: chros_ec_ishtp: only load for matching devices
>   platform/x86: isthp_eclite: only load for matching devices
> 
>  drivers/hid/intel-ish-hid/ishtp-fw-loader.c  |  7 +++++-
>  drivers/hid/intel-ish-hid/ishtp-hid-client.c |  7 +++++-
>  drivers/hid/intel-ish-hid/ishtp/bus.c        |  4 ++--
>  drivers/platform/chrome/cros_ec_ishtp.c      |  7 +++++-
>  drivers/platform/x86/intel/ishtp_eclite.c    |  7 +++++-
>  include/linux/mod_devicetable.h              | 13 +++++++++++
>  scripts/mod/devicetable-offsets.c            |  3 +++
>  scripts/mod/file2alias.c                     | 24 ++++++++++++++++++++
>  8 files changed, 66 insertions(+), 6 deletions(-)
> 
> 
> base-commit: 85303db36b6e170917a7bc6aae4898c31a5272a0
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
  2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
  2021-10-29 15:28   ` [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases Thomas Weißschuh
@ 2021-11-01  9:58   ` Hans de Goede
  2021-11-01 10:09     ` Thomas Weißschuh
  1 sibling, 1 reply; 24+ messages in thread
From: Hans de Goede @ 2021-11-01  9:58 UTC (permalink / raw)
  To: Thomas Weißschuh, linux-input
  Cc: linux-kernel, linux-kbuild, Srinivas Pandruvada, Jiri Kosina,
	Benjamin Tissoires, Masahiro Yamada, Michal Marek,
	Nick Desaulniers

Hi,

On 10/29/21 17:28, Thomas Weißschuh wrote:
> 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>
> 
> ---
> 
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-input@vger.kernel.org
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Jiri Kosina <jkosina@suse.cz>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  include/linux/mod_devicetable.h   | 13 +++++++++++++
>  scripts/mod/devicetable-offsets.c |  3 +++
>  scripts/mod/file2alias.c          | 24 ++++++++++++++++++++++++
>  3 files changed, 40 insertions(+)
> 
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index ae2e75d15b21..befbf53c4b7c 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -895,4 +895,17 @@ struct dfl_device_id {
>  	kernel_ulong_t driver_data;
>  };
>  
> +/* ISHTP (Integrated Sensor Hub Transport Protocol) */
> +
> +#define ISHTP_MODULE_PREFIX	"ishtp:"
> +
> +/**
> + * struct ishtp_device_id - ISHTP device identifier
> + * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
> + * @context: pointer to driver specific data
> + */
> +struct ishtp_device_id {
> +	guid_t guid;

The kdoc comment documents a context pointer, but this is missing from the
actual struct. Having some sort of driver_data (1) field here would be good IMHO.

Regards,

Hans

1) "context" is fine, but AFAIK almost all other foo_device_id structs call this
driver_data, so that would be more consistent IMHO.


> +};
> +
>  #endif /* LINUX_MOD_DEVICETABLE_H */
> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> index cc3625617a0e..c0d3bcb99138 100644
> --- a/scripts/mod/devicetable-offsets.c
> +++ b/scripts/mod/devicetable-offsets.c
> @@ -259,5 +259,8 @@ int main(void)
>  	DEVID_FIELD(dfl_device_id, type);
>  	DEVID_FIELD(dfl_device_id, feature_id);
>  
> +	DEVID(ishtp_device_id);
> +	DEVID_FIELD(ishtp_device_id, guid);
> +
>  	return 0;
>  }
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 49aba862073e..5258247d78ac 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -115,6 +115,17 @@ static inline void add_uuid(char *str, uuid_le uuid)
>  		uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
>  }
>  
> +static inline void add_guid(char *str, guid_t guid)
> +{
> +	int len = strlen(str);
> +
> +	sprintf(str + len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
> +		guid.b[3], guid.b[2], guid.b[1], guid.b[0],
> +		guid.b[5], guid.b[4], guid.b[7], guid.b[6],
> +		guid.b[8], guid.b[9], guid.b[10], guid.b[11],
> +		guid.b[12], guid.b[13], guid.b[14], guid.b[15]);
> +}
> +
>  /**
>   * Check that sizeof(device_id type) are consistent with size of section
>   * in .o file. If in-consistent then userspace and kernel does not agree
> @@ -1380,6 +1391,18 @@ static int do_mhi_entry(const char *filename, void *symval, char *alias)
>  	return 1;
>  }
>  
> +/* Looks like: ishtp:{guid} */
> +static int do_ishtp_entry(const char *filename, void *symval, char *alias)
> +{
> +	DEF_FIELD(symval, ishtp_device_id, guid);
> +
> +	strcpy(alias, ISHTP_MODULE_PREFIX "{");
> +	add_guid(alias, guid);
> +	strcat(alias, "}");
> +
> +	return 1;
> +}
> +
>  static int do_auxiliary_entry(const char *filename, void *symval, char *alias)
>  {
>  	DEF_FIELD_ADDR(symval, auxiliary_device_id, name);
> @@ -1499,6 +1522,7 @@ static const struct devtable devtable[] = {
>  	{"auxiliary", SIZE_auxiliary_device_id, do_auxiliary_entry},
>  	{"ssam", SIZE_ssam_device_id, do_ssam_entry},
>  	{"dfl", SIZE_dfl_device_id, do_dfl_entry},
> +	{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
>  };
>  
>  /* Create MODULE_ALIAS() statements.
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 6/6] platform/x86: isthp_eclite: only load for matching devices
  2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
  2021-10-29 15:29             ` Thomas Weißschuh
@ 2021-11-01  9:59             ` Hans de Goede
  1 sibling, 0 replies; 24+ messages in thread
From: Hans de Goede @ 2021-11-01  9:59 UTC (permalink / raw)
  To: Thomas Weißschuh, linux-input
  Cc: linux-kernel, Srinivas Pandruvada, K, Naduvalath, Sumesh,
	Jiri Kosina, Benjamin Tissoires, Mark Gross, platform-driver-x86

Hi,

On 10/29/21 17:29, Thomas Weißschuh wrote:
> Previously it was loaded for all ISHTP devices.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> 
> ---
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mark Gross <markgross@kernel.org>
> Cc: linux-input@vger.kernel.org
> Cc: platform-driver-x86@vger.kernel.org
> ---
>  drivers/platform/x86/intel/ishtp_eclite.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/ishtp_eclite.c b/drivers/platform/x86/intel/ishtp_eclite.c
> index 12fc98a48657..b9fb8f28fd63 100644
> --- a/drivers/platform/x86/intel/ishtp_eclite.c
> +++ b/drivers/platform/x86/intel/ishtp_eclite.c
> @@ -681,6 +681,12 @@ static struct ishtp_cl_driver ecl_ishtp_cl_driver = {
>  	.driver.pm = &ecl_ishtp_pm_ops,
>  };
>  
> +static const struct ishtp_device_id ecl_ishtp_id_table[] = {
> +	{ ecl_ishtp_guid },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
> +
>  static int __init ecl_ishtp_init(void)
>  {
>  	return ishtp_cl_driver_register(&ecl_ishtp_cl_driver, THIS_MODULE);
> @@ -698,4 +704,3 @@ MODULE_DESCRIPTION("ISH ISHTP eclite client opregion driver");
>  MODULE_AUTHOR("K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com>");
>  
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("ishtp:*");
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
  2021-11-01  9:58   ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Hans de Goede
@ 2021-11-01 10:09     ` Thomas Weißschuh
  2021-11-01 10:15       ` Hans de Goede
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-01 10:09 UTC (permalink / raw)
  To: Hans de Goede
  Cc: linux-input, linux-kernel, linux-kbuild, Srinivas Pandruvada,
	Jiri Kosina, Benjamin Tissoires, Masahiro Yamada, Michal Marek,
	Nick Desaulniers

On 2021-11-01 10:58+0100, Hans de Goede wrote:
> On 10/29/21 17:28, Thomas Weißschuh wrote:
> > 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>
> > 
> > ---
> > 
> > Cc: linux-kbuild@vger.kernel.org
> > Cc: linux-input@vger.kernel.org
> > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > Cc: Jiri Kosina <jkosina@suse.cz>
> > Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Cc: Michal Marek <michal.lkml@markovi.net>
> > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > ---
> >  include/linux/mod_devicetable.h   | 13 +++++++++++++
> >  scripts/mod/devicetable-offsets.c |  3 +++
> >  scripts/mod/file2alias.c          | 24 ++++++++++++++++++++++++
> >  3 files changed, 40 insertions(+)
> > 
> > diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> > index ae2e75d15b21..befbf53c4b7c 100644
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -895,4 +895,17 @@ struct dfl_device_id {
> >  	kernel_ulong_t driver_data;
> >  };
> >  
> > +/* ISHTP (Integrated Sensor Hub Transport Protocol) */
> > +
> > +#define ISHTP_MODULE_PREFIX	"ishtp:"
> > +
> > +/**
> > + * struct ishtp_device_id - ISHTP device identifier
> > + * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
> > + * @context: pointer to driver specific data
> > + */
> > +struct ishtp_device_id {
> > +	guid_t guid;
> 
> The kdoc comment documents a context pointer, but this is missing from the
> actual struct. Having some sort of driver_data (1) field here would be good IMHO.

Fine for me.

I left it out because nothing would be using it at the moment and
it would have been easy to add when needed.

Do you want me to send a v2 for that or would you add it when merging?
(Or remove the spurious comment)

> Regards,
> 
> Hans
> 
> 1) "context" is fine, but AFAIK almost all other foo_device_id structs call this
> driver_data, so that would be more consistent IMHO.

Thomas

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-11-01  9:56 ` [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Hans de Goede
@ 2021-11-01 10:12   ` Thomas Weißschuh
  2021-11-01 10:17     ` Hans de Goede
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-01 10:12 UTC (permalink / raw)
  To: Hans de Goede
  Cc: linux-input, linux-kernel, Srinivas Pandruvada, Mark Gross,
	Rushikesh S Kadam, Jiri Kosina, Benjamin Tissoires,
	Guenter Roeck, Enric Balletbo i Serra, Benson Leung,
	platform-driver-x86, linux-kbuild

On 2021-11-01 10:56+0100, Hans de Goede wrote:
> On 10/29/21 17:28, Thomas Weißschuh wrote:
> > Currently as soon as any ISHTP device appears all available ISHTP device
> > drivers are loaded automatically.
> > This series extends the MODULE_DEVICE_TABLE() functionality to properly handle
> > the ishtp bus and switches the drivers over to use it.
> > 
> > Patch 1 adds the infrastructure to handle ishtp devices via MODULE_DEVICE_TABLE()
> > Patch 2 replaces some inlined constants with ones now defined by mod_devicetable.h
> > Patches 3-6 migrate all ishtp drivers to MODULE_DEVICE_TABLE()
> > 
> > Note: This patchset is based on the pdx86/for-next tree because that contains
> > one of the drivers that is not yet in the other trees.
> 
> Since most of the changes here are under drivers/hid and since the latter
> patches depend on 1/6, I believe it would be best to merge the entire series
> through the HID tree, here is my ack for this:
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>

Please note that patch 6 modifies a driver that is not yet available in the HID
and 5.15 trees but only in pdx86/for-next.

Thomas

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
  2021-11-01 10:09     ` Thomas Weißschuh
@ 2021-11-01 10:15       ` Hans de Goede
  0 siblings, 0 replies; 24+ messages in thread
From: Hans de Goede @ 2021-11-01 10:15 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-input, linux-kernel, linux-kbuild, Srinivas Pandruvada,
	Jiri Kosina, Benjamin Tissoires, Masahiro Yamada, Michal Marek,
	Nick Desaulniers

Hi,

On 11/1/21 11:09, Thomas Weißschuh wrote:
> On 2021-11-01 10:58+0100, Hans de Goede wrote:
>> On 10/29/21 17:28, Thomas Weißschuh wrote:
>>> 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>
>>>
>>> ---
>>>
>>> Cc: linux-kbuild@vger.kernel.org
>>> Cc: linux-input@vger.kernel.org
>>> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>>> Cc: Jiri Kosina <jkosina@suse.cz>
>>> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>>> Cc: Michal Marek <michal.lkml@markovi.net>
>>> Cc: Nick Desaulniers <ndesaulniers@google.com>
>>> ---
>>>  include/linux/mod_devicetable.h   | 13 +++++++++++++
>>>  scripts/mod/devicetable-offsets.c |  3 +++
>>>  scripts/mod/file2alias.c          | 24 ++++++++++++++++++++++++
>>>  3 files changed, 40 insertions(+)
>>>
>>> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
>>> index ae2e75d15b21..befbf53c4b7c 100644
>>> --- a/include/linux/mod_devicetable.h
>>> +++ b/include/linux/mod_devicetable.h
>>> @@ -895,4 +895,17 @@ struct dfl_device_id {
>>>  	kernel_ulong_t driver_data;
>>>  };
>>>  
>>> +/* ISHTP (Integrated Sensor Hub Transport Protocol) */
>>> +
>>> +#define ISHTP_MODULE_PREFIX	"ishtp:"
>>> +
>>> +/**
>>> + * struct ishtp_device_id - ISHTP device identifier
>>> + * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
>>> + * @context: pointer to driver specific data
>>> + */
>>> +struct ishtp_device_id {
>>> +	guid_t guid;
>>
>> The kdoc comment documents a context pointer, but this is missing from the
>> actual struct. Having some sort of driver_data (1) field here would be good IMHO.
> 
> Fine for me.
> 
> I left it out because nothing would be using it at the moment and
> it would have been easy to add when needed.

IMHO having a device_id without a context/driver_data field would be
weird and is likely asking for needless churn in the future, but see
below.

> Do you want me to send a v2 for that or would you add it when merging?
> (Or remove the spurious comment)

As I indicated in my reply to the cover-letter, I believe this series
should be merged through the HID tree, so this is up to the HID maintainers
to decide.

Regards,

Hans


p.s.

Thank you for doing this series I did not realize that the eclite driver
would end up being loaded on all systems where the ISH is used, thank you
for fixing this.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-11-01 10:12   ` Thomas Weißschuh
@ 2021-11-01 10:17     ` Hans de Goede
  2021-11-02 11:50       ` Jiri Kosina
  0 siblings, 1 reply; 24+ messages in thread
From: Hans de Goede @ 2021-11-01 10:17 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-input, linux-kernel, Srinivas Pandruvada, Mark Gross,
	Rushikesh S Kadam, Jiri Kosina, Benjamin Tissoires,
	Guenter Roeck, Enric Balletbo i Serra, Benson Leung,
	platform-driver-x86, linux-kbuild

Hi,

On 11/1/21 11:12, Thomas Weißschuh wrote:
> On 2021-11-01 10:56+0100, Hans de Goede wrote:
>> On 10/29/21 17:28, Thomas Weißschuh wrote:
>>> Currently as soon as any ISHTP device appears all available ISHTP device
>>> drivers are loaded automatically.
>>> This series extends the MODULE_DEVICE_TABLE() functionality to properly handle
>>> the ishtp bus and switches the drivers over to use it.
>>>
>>> Patch 1 adds the infrastructure to handle ishtp devices via MODULE_DEVICE_TABLE()
>>> Patch 2 replaces some inlined constants with ones now defined by mod_devicetable.h
>>> Patches 3-6 migrate all ishtp drivers to MODULE_DEVICE_TABLE()
>>>
>>> Note: This patchset is based on the pdx86/for-next tree because that contains
>>> one of the drivers that is not yet in the other trees.
>>
>> Since most of the changes here are under drivers/hid and since the latter
>> patches depend on 1/6, I believe it would be best to merge the entire series
>> through the HID tree, here is my ack for this:
>>
>> Acked-by: Hans de Goede <hdegoede@redhat.com>
> 
> Please note that patch 6 modifies a driver that is not yet available in the HID
> and 5.15 trees but only in pdx86/for-next.

Right, but given where we are in the cycle this is going to be something to
merge post 5.16-rc1 anyways which resolves the dependency issue.

I guess it might be good to send this our in a later pull-req as a fix series
for a later 5.16-rc# though, to avoid the eclite and chrome-ec drivers from
autoloading on all systems with an ISH, even though they usually will not be
used there.

Regards,

Hans


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-11-01 10:17     ` Hans de Goede
@ 2021-11-02 11:50       ` Jiri Kosina
  2021-11-02 13:17         ` Srinivas Pandruvada
  0 siblings, 1 reply; 24+ messages in thread
From: Jiri Kosina @ 2021-11-02 11:50 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Thomas Weißschuh, linux-input, linux-kernel,
	Srinivas Pandruvada, Mark Gross, Rushikesh S Kadam,
	Benjamin Tissoires, Guenter Roeck, Enric Balletbo i Serra,
	Benson Leung, platform-driver-x86, linux-kbuild

On Mon, 1 Nov 2021, Hans de Goede wrote:

> >> Since most of the changes here are under drivers/hid and since the latter
> >> patches depend on 1/6, I believe it would be best to merge the entire series
> >> through the HID tree, here is my ack for this:
> >>
> >> Acked-by: Hans de Goede <hdegoede@redhat.com>
> > 
> > Please note that patch 6 modifies a driver that is not yet available in the HID
> > and 5.15 trees but only in pdx86/for-next.
> 
> Right, but given where we are in the cycle this is going to be something to
> merge post 5.16-rc1 anyways which resolves the dependency issue.
> 
> I guess it might be good to send this our in a later pull-req as a fix series
> for a later 5.16-rc# though, to avoid the eclite and chrome-ec drivers from
> autoloading on all systems with an ISH, even though they usually will not be
> used there.

I'll be happy to take this as 5.16 fixups after the merge window is over 
(I am not adding anything new to the branches now, before Linus merges HID 
tree), but I'd still like to see Ack from Srinivas.

Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-11-02 11:50       ` Jiri Kosina
@ 2021-11-02 13:17         ` Srinivas Pandruvada
  0 siblings, 0 replies; 24+ messages in thread
From: Srinivas Pandruvada @ 2021-11-02 13:17 UTC (permalink / raw)
  To: Jiri Kosina, Hans de Goede
  Cc: Thomas Weißschuh, linux-input, linux-kernel, Mark Gross,
	Rushikesh S Kadam, Benjamin Tissoires, Guenter Roeck,
	Enric Balletbo i Serra, Benson Leung, platform-driver-x86,
	linux-kbuild

On Tue, 2021-11-02 at 12:50 +0100, Jiri Kosina wrote:
> On Mon, 1 Nov 2021, Hans de Goede wrote:
> 
> > > > Since most of the changes here are under drivers/hid and since
> > > > the latter
> > > > patches depend on 1/6, I believe it would be best to merge the
> > > > entire series
> > > > through the HID tree, here is my ack for this:
> > > > 
> > > > Acked-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> > > 
> > > Please note that patch 6 modifies a driver that is not yet
> > > available in the HID
> > > and 5.15 trees but only in pdx86/for-next.
> > 
> > Right, but given where we are in the cycle this is going to be
> > something to
> > merge post 5.16-rc1 anyways which resolves the dependency issue.
> > 
> > I guess it might be good to send this our in a later pull-req as a
> > fix series
> > for a later 5.16-rc# though, to avoid the eclite and chrome-ec
> > drivers from
> > autoloading on all systems with an ISH, even though they usually
> > will not be
> > used there.
> 
> I'll be happy to take this as 5.16 fixups after the merge window is
> over 
> (I am not adding anything new to the branches now, before Linus
> merges HID 
> tree), but I'd still like to see Ack from Srinivas.
Done.

Thanks,
Srinivas

> 
> Thanks,
> 



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus
  2021-10-29 15:28 [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Thomas Weißschuh
  2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
  2021-11-01  9:56 ` [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Hans de Goede
@ 2021-11-09 10:42 ` Jiri Kosina
  2 siblings, 0 replies; 24+ messages in thread
From: Jiri Kosina @ 2021-11-09 10:42 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-input, linux-kernel, Srinivas Pandruvada, Mark Gross,
	Hans de Goede, Rushikesh S Kadam, Benjamin Tissoires,
	Guenter Roeck, Enric Balletbo i Serra, Benson Leung,
	platform-driver-x86, linux-kbuild

On Fri, 29 Oct 2021, Thomas Weißschuh wrote:

> Currently as soon as any ISHTP device appears all available ISHTP device
> drivers are loaded automatically.
> This series extends the MODULE_DEVICE_TABLE() functionality to properly handle
> the ishtp bus and switches the drivers over to use it.
> 
> Patch 1 adds the infrastructure to handle ishtp devices via MODULE_DEVICE_TABLE()
> Patch 2 replaces some inlined constants with ones now defined by mod_devicetable.h
> Patches 3-6 migrate all ishtp drivers to MODULE_DEVICE_TABLE()
> 
> Note: This patchset is based on the pdx86/for-next tree because that contains
> one of the drivers that is not yet in the other trees.
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Mark Gross <markgross@kernel.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Benson Leung <bleung@chromium.org>
> 
> Cc: platform-driver-x86@vger.kernel.org
> Cc: linux-kbuild@vger.kernel.org

Applied to hid.git#for-5.16/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices
  2021-10-29 15:29         ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
  2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
@ 2021-11-10 16:44           ` Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
                               ` (3 more replies)
  1 sibling, 4 replies; 24+ messages in thread
From: Nathan Chancellor @ 2021-11-10 16:44 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-input, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Jiri Kosina, Benjamin Tissoires, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, llvm

On Fri, Oct 29, 2021 at 05:29:00PM +0200, Thomas Weißschuh wrote:
> Previously it was loaded for all ISHTP devices.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> 
> ---
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: linux-input@vger.kernel.org
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> ---
>  drivers/platform/chrome/cros_ec_ishtp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
> index 9d1e7e03628e..8c17358e84c1 100644
> --- a/drivers/platform/chrome/cros_ec_ishtp.c
> +++ b/drivers/platform/chrome/cros_ec_ishtp.c
> @@ -774,6 +774,12 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
>  	},
>  };
>  
> +static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
> +	{ cros_ish_guid },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
> +
>  static int __init cros_ec_ishtp_mod_init(void)
>  {
>  	return ishtp_cl_driver_register(&cros_ec_ishtp_driver, THIS_MODULE);
> @@ -791,4 +797,3 @@ MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver");
>  MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
>  
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("ishtp:*");
> -- 
> 2.33.1
> 
> 

This patch in -next as commit facfe0a4fdce ("platform/chrome:
chros_ec_ishtp: only load for matching devices") and the following one
as commit f155dfeaa4ee ("platform/x86: isthp_eclite: only load for
matching devices") break clang and GCC prior to 8.1 (output from
Debian's GCC 6.3.0 below):

$ make -skj"$(nproc)" distclean allmodconfig drivers/platform/
drivers/platform/chrome/cros_ec_ishtp.c:778:4: error: initializer element is not constant
  { cros_ish_guid },
    ^~~~~~~~~~~~~
drivers/platform/chrome/cros_ec_ishtp.c:778:4: note: (near initialization for 'cros_ec_ishtp_id_table[0].guid')
scripts/Makefile.build:288: recipe for target 'drivers/platform/chrome/cros_ec_ishtp.o' failed
make[4]: *** [drivers/platform/chrome/cros_ec_ishtp.o] Error 1
drivers/platform/x86/intel/ishtp_eclite.c:685:4: error: initializer element is not constant
  { ecl_ishtp_guid },
    ^~~~~~~~~~~~~~
drivers/platform/x86/intel/ishtp_eclite.c:685:4: note: (near initialization for 'ecl_ishtp_id_table[0].guid')

I am sure clang should be fixed to recognize this value as a compile
time constant but the kernel supports GCC back to 5.1.0 so this should
be fixed here as well.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-11  9:10               ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
                               ` (2 subsequent siblings)
  3 siblings, 1 reply; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: 44e2a58cb880 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
index 945a9d0b68cd..26f376faf0e6 100644
--- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
+++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
@@ -76,9 +76,9 @@ enum ish_loader_commands {
 #define LOADER_XFER_MODE_ISHTP			BIT(1)
 
 /* ISH Transport Loader client unique GUID */
-static const guid_t loader_ishtp_guid =
-	GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
-		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc);
+#define ISHTP_GUID GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7, \
+		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc)
+static const guid_t loader_ishtp_guid = ISHTP_GUID;
 
 #define FILENAME_SIZE				256
 
@@ -1064,7 +1064,7 @@ static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id loader_ishtp_id_table[] = {
-	{ loader_ishtp_guid },
+	{ ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);

base-commit: 64355db3caf6468dc711995239efe0cbcd7d0091
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/4] HID: intel-ish-hid: hid-client: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
  3 siblings, 0 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: 0d0cccc0fd83 ("HID: intel-ish-hid: hid-client: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/intel-ish-hid/ishtp-hid-client.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index fb47d38d1e87..cff7da0578b6 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -12,9 +12,9 @@
 #include "ishtp-hid.h"
 
 /* ISH Transport protocol (ISHTP in short) GUID */
-static const guid_t hid_ishtp_guid =
-	GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
-		  0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26);
+#define HID_ISHTP_GUID	GUID_INIT(0x33AECD58, 0xB679, 0x4E54, \
+		  0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26)
+static const guid_t hid_ishtp_guid = HID_ISHTP_GUID;
 
 /* Rx ring buffer pool size */
 #define HID_CL_RX_RING_SIZE	32
@@ -953,7 +953,7 @@ static struct ishtp_cl_driver	hid_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id hid_ishtp_id_table[] = {
-	{ hid_ishtp_guid },
+	{ HID_ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, hid_ishtp_id_table);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/4] platform/chrome: chros_ec_ishtp: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
  3 siblings, 0 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: facfe0a4fdce ("platform/chrome: chros_ec_ishtp: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/chrome/cros_ec_ishtp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
index 8c17358e84c1..2e635fee854c 100644
--- a/drivers/platform/chrome/cros_ec_ishtp.c
+++ b/drivers/platform/chrome/cros_ec_ishtp.c
@@ -41,9 +41,9 @@ enum cros_ec_ish_channel {
 #define ISHTP_SEND_TIMEOUT			(3 * HZ)
 
 /* ISH Transport CrOS EC ISH client unique GUID */
-static const guid_t cros_ish_guid =
-	GUID_INIT(0x7b7154d0, 0x56f4, 0x4bdc,
-		  0xb0, 0xd8, 0x9e, 0x7c, 0xda,	0xe0, 0xd6, 0xa0);
+#define CROS_ISH_GUID GUID_INIT(0x7b7154d0, 0x56f4, 0x4bdc, \
+		  0xb0, 0xd8, 0x9e, 0x7c, 0xda,	0xe0, 0xd6, 0xa0)
+static const guid_t cros_ish_guid = CROS_ISH_GUID;
 
 struct header {
 	u8 channel;
@@ -775,7 +775,7 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
 };
 
 static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
-	{ cros_ish_guid },
+	{ CROS_ISH_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/4] platform/x86: isthp_eclite: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
                               ` (2 preceding siblings ...)
  2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  3 siblings, 0 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: f155dfeaa4ee ("platform/x86: isthp_eclite: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/x86/intel/ishtp_eclite.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel/ishtp_eclite.c b/drivers/platform/x86/intel/ishtp_eclite.c
index b9fb8f28fd63..d6709d5c77fd 100644
--- a/drivers/platform/x86/intel/ishtp_eclite.c
+++ b/drivers/platform/x86/intel/ishtp_eclite.c
@@ -93,9 +93,9 @@ struct ishtp_opregion_dev {
 };
 
 /* eclite ishtp client UUID: 6a19cc4b-d760-4de3-b14d-f25ebd0fbcd9 */
-static const guid_t ecl_ishtp_guid =
-	GUID_INIT(0x6a19cc4b, 0xd760, 0x4de3,
-		  0xb1, 0x4d, 0xf2, 0x5e, 0xbd, 0xf, 0xbc, 0xd9);
+#define ECL_ISHTP_GUID GUID_INIT(0x6a19cc4b, 0xd760, 0x4de3, \
+		  0xb1, 0x4d, 0xf2, 0x5e, 0xbd, 0xf, 0xbc, 0xd9)
+static const guid_t ecl_ishtp_guid = ECL_ISHTP_GUID;
 
 /* ACPI DSM UUID: 91d936a7-1f01-49c6-a6b4-72f00ad8d8a5 */
 static const guid_t ecl_acpi_guid =
@@ -682,7 +682,7 @@ static struct ishtp_cl_driver ecl_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id ecl_ishtp_id_table[] = {
-	{ ecl_ishtp_guid },
+	{ ECL_ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
@ 2021-11-11  9:10               ` Thomas Weißschuh
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Weißschuh @ 2021-11-11  9:10 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: linux-kernel, Srinivas Pandruvada, Rushikesh S Kadam,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, llvm,
	Arnd Bergmann

Hi,

On 2021-11-11 00:00+0100, Thomas Weißschuh wrote:
> Previously the compilation broke on clang and gcc < 8.1.0 with errors like
> "error: initializer element is not constant".
> 
> Fixes: 44e2a58cb880 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> index 945a9d0b68cd..26f376faf0e6 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> @@ -76,9 +76,9 @@ enum ish_loader_commands {
>  #define LOADER_XFER_MODE_ISHTP			BIT(1)
>  
>  /* ISH Transport Loader client unique GUID */
> -static const guid_t loader_ishtp_guid =
> -	GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
> -		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc);
> +#define ISHTP_GUID GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7, \
> +		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc)
> +static const guid_t loader_ishtp_guid = ISHTP_GUID;
>  
>  #define FILENAME_SIZE				256
>  
> @@ -1064,7 +1064,7 @@ static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
>  };
>  
>  static const struct ishtp_device_id loader_ishtp_id_table[] = {
> -	{ loader_ishtp_guid },
> +	{ ISHTP_GUID },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);
> 
> base-commit: 64355db3caf6468dc711995239efe0cbcd7d0091
> -- 
> 2.33.1
> 

Please drop this whole series and use the patch
"HID: intel-ish-hid: fix module device-id handling"[0]
from Arnd instead.

It adds proper device table support to the ISHTP bus itself also preventing
unused-variable warnings for the device table when the drivers are built-in.

Thanks,
Thomas

[0] https://lore.kernel.org/lkml/20211111085842.2846422-1-arnd@kernel.org/

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-11-11  9:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 15:28 [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Thomas Weißschuh
2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
2021-10-29 15:28   ` [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases Thomas Weißschuh
2021-10-29 15:28     ` [PATCH 3/6] HID: intel-ish-hid: fw-loader: only load for matching devices Thomas Weißschuh
2021-10-29 15:28       ` [PATCH 4/6] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
2021-10-29 15:29         ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
2021-10-29 15:29             ` Thomas Weißschuh
2021-11-01  9:59             ` Hans de Goede
2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Nathan Chancellor
2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
2021-11-11  9:10               ` Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
2021-11-01  9:58   ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Hans de Goede
2021-11-01 10:09     ` Thomas Weißschuh
2021-11-01 10:15       ` Hans de Goede
2021-11-01  9:56 ` [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Hans de Goede
2021-11-01 10:12   ` Thomas Weißschuh
2021-11-01 10:17     ` Hans de Goede
2021-11-02 11:50       ` Jiri Kosina
2021-11-02 13:17         ` Srinivas Pandruvada
2021-11-09 10:42 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).