|
@@ -1,4 +1,4 @@
|
|
-From 4f1cd3f4da8cf250dcdee9edaf08802a3d8c5150 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From f3005b47f052eb94cfab78f38aafa57acb30fbcd Mon Sep 17 00:00:00 2001
|
|
From: qzed <qzed@users.noreply.github.com>
|
|
From: qzed <qzed@users.noreply.github.com>
|
|
Date: Mon, 26 Aug 2019 01:11:08 +0200
|
|
Date: Mon, 26 Aug 2019 01:11:08 +0200
|
|
Subject: [PATCH] ACPI: Fix buffer/integer type mismatch
|
|
Subject: [PATCH] ACPI: Fix buffer/integer type mismatch
|
|
@@ -60,7 +60,7 @@ index d3d2dbfba680..0b7f617a6e9b 100644
|
|
--
|
|
--
|
|
2.30.0
|
|
2.30.0
|
|
|
|
|
|
-From 880ce43d10d83d8201160bcaa3abbdea860943e5 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 892dfdea075d24abf3e1eb5b0f32662890a58b92 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 24 Sep 2019 17:38:12 +0200
|
|
Date: Tue, 24 Sep 2019 17:38:12 +0200
|
|
Subject: [PATCH] serdev: Add ACPI devices by ResourceSource field
|
|
Subject: [PATCH] serdev: Add ACPI devices by ResourceSource field
|
|
@@ -248,7 +248,7 @@ index a9719858c950..ce5309d00280 100644
|
|
--
|
|
--
|
|
2.30.0
|
|
2.30.0
|
|
|
|
|
|
-From baea73b8602dbd6ac6fe1dfb7a094431b224f1ce Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 96bbe52d5ea5308d776bee60ace244f05cb480a4 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Mon, 17 Aug 2020 01:23:20 +0200
|
|
Date: Mon, 17 Aug 2020 01:23:20 +0200
|
|
Subject: [PATCH] misc: surface_sam: Add file2alias support for Surface SAM
|
|
Subject: [PATCH] misc: surface_sam: Add file2alias support for Surface SAM
|
|
@@ -350,7 +350,7 @@ index c91eba751804..bc06f7631200 100644
|
|
--
|
|
--
|
|
2.30.0
|
|
2.30.0
|
|
|
|
|
|
-From 86bc3d0ecd32e004024303e7bfe4dcd09c4523f3 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 1c5e72241965f1a32d98b190e04cfbbaf0c8ab09 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Mon, 17 Aug 2020 01:44:30 +0200
|
|
Date: Mon, 17 Aug 2020 01:44:30 +0200
|
|
Subject: [PATCH] misc: Add support for Surface System Aggregator Module
|
|
Subject: [PATCH] misc: Add support for Surface System Aggregator Module
|
|
@@ -388,7 +388,7 @@ Patchset: surface-sam
|
|
.../misc/surface_aggregator/clients/Kconfig | 134 +
|
|
.../misc/surface_aggregator/clients/Kconfig | 134 +
|
|
.../misc/surface_aggregator/clients/Makefile | 10 +
|
|
.../misc/surface_aggregator/clients/Makefile | 10 +
|
|
.../clients/surface_acpi_notify.c | 886 ++++++
|
|
.../clients/surface_acpi_notify.c | 886 ++++++
|
|
- .../clients/surface_aggregator_cdev.c | 303 ++
|
|
|
|
|
|
+ .../clients/surface_aggregator_cdev.c | 322 ++
|
|
.../clients/surface_aggregator_registry.c | 616 ++++
|
|
.../clients/surface_aggregator_registry.c | 616 ++++
|
|
.../clients/surface_battery.c | 1168 ++++++++
|
|
.../clients/surface_battery.c | 1168 ++++++++
|
|
.../surface_aggregator/clients/surface_dtx.c | 1277 ++++++++
|
|
.../surface_aggregator/clients/surface_dtx.c | 1277 ++++++++
|
|
@@ -398,11 +398,11 @@ Patchset: surface-sam
|
|
drivers/misc/surface_aggregator/controller.h | 285 ++
|
|
drivers/misc/surface_aggregator/controller.h | 285 ++
|
|
drivers/misc/surface_aggregator/core.c | 851 ++++++
|
|
drivers/misc/surface_aggregator/core.c | 851 ++++++
|
|
drivers/misc/surface_aggregator/ssh_msgb.h | 205 ++
|
|
drivers/misc/surface_aggregator/ssh_msgb.h | 205 ++
|
|
- .../surface_aggregator/ssh_packet_layer.c | 2057 +++++++++++++
|
|
|
|
|
|
+ .../surface_aggregator/ssh_packet_layer.c | 2074 +++++++++++++
|
|
.../surface_aggregator/ssh_packet_layer.h | 190 ++
|
|
.../surface_aggregator/ssh_packet_layer.h | 190 ++
|
|
drivers/misc/surface_aggregator/ssh_parser.c | 228 ++
|
|
drivers/misc/surface_aggregator/ssh_parser.c | 228 ++
|
|
drivers/misc/surface_aggregator/ssh_parser.h | 155 +
|
|
drivers/misc/surface_aggregator/ssh_parser.h | 155 +
|
|
- .../surface_aggregator/ssh_request_layer.c | 1264 ++++++++
|
|
|
|
|
|
+ .../surface_aggregator/ssh_request_layer.c | 1263 ++++++++
|
|
.../surface_aggregator/ssh_request_layer.h | 143 +
|
|
.../surface_aggregator/ssh_request_layer.h | 143 +
|
|
drivers/misc/surface_aggregator/trace.h | 632 ++++
|
|
drivers/misc/surface_aggregator/trace.h | 632 ++++
|
|
include/linux/mod_devicetable.h | 5 +-
|
|
include/linux/mod_devicetable.h | 5 +-
|
|
@@ -414,7 +414,7 @@ Patchset: surface-sam
|
|
include/uapi/linux/surface_aggregator/dtx.h | 146 +
|
|
include/uapi/linux/surface_aggregator/dtx.h | 146 +
|
|
scripts/mod/devicetable-offsets.c | 3 +-
|
|
scripts/mod/devicetable-offsets.c | 3 +-
|
|
scripts/mod/file2alias.c | 10 +-
|
|
scripts/mod/file2alias.c | 10 +-
|
|
- 47 files changed, 19135 insertions(+), 7 deletions(-)
|
|
|
|
|
|
+ 47 files changed, 19170 insertions(+), 7 deletions(-)
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/client-api.rst
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/client-api.rst
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/client.rst
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/client.rst
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/clients/cdev.rst
|
|
create mode 100644 Documentation/driver-api/surface_aggregator/clients/cdev.rst
|
|
@@ -3646,7 +3646,7 @@ index 000000000000..4249af06d738
|
|
+obj-$(CONFIG_SURFACE_PERFMODE) += surface_perfmode.o
|
|
+obj-$(CONFIG_SURFACE_PERFMODE) += surface_perfmode.o
|
|
diff --git a/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
|
|
diff --git a/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
|
|
new file mode 100644
|
|
new file mode 100644
|
|
-index 000000000000..8cd67a669c86
|
|
|
|
|
|
+index 000000000000..ef9c1f8e8336
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
|
|
+++ b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
|
|
@@ -0,0 +1,886 @@
|
|
@@ -0,0 +1,886 @@
|
|
@@ -3840,7 +3840,7 @@ index 000000000000..8cd67a669c86
|
|
+ union acpi_object *obj;
|
|
+ union acpi_object *obj;
|
|
+ int status = 0;
|
|
+ int status = 0;
|
|
+
|
|
+
|
|
-+ if (!acpi_check_dsm(san, &SAN_DSM_UUID, SAN_DSM_REVISION, 1 << func))
|
|
|
|
|
|
++ if (!acpi_check_dsm(san, &SAN_DSM_UUID, SAN_DSM_REVISION, BIT_ULL(func)))
|
|
+ return 0;
|
|
+ return 0;
|
|
+
|
|
+
|
|
+ dev_dbg(dev, "notify event %#04llx\n", func);
|
|
+ dev_dbg(dev, "notify event %#04llx\n", func);
|
|
@@ -4538,10 +4538,10 @@ index 000000000000..8cd67a669c86
|
|
+MODULE_LICENSE("GPL");
|
|
+MODULE_LICENSE("GPL");
|
|
diff --git a/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c b/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c
|
|
diff --git a/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c b/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c
|
|
new file mode 100644
|
|
new file mode 100644
|
|
-index 000000000000..340d15b148b9
|
|
|
|
|
|
+index 000000000000..79e28fab7e40
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c
|
|
+++ b/drivers/misc/surface_aggregator/clients/surface_aggregator_cdev.c
|
|
-@@ -0,0 +1,303 @@
|
|
|
|
|
|
+@@ -0,0 +1,322 @@
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+/*
|
|
+/*
|
|
+ * Provides user-space access to the SSAM EC via the /dev/surface/aggregator
|
|
+ * Provides user-space access to the SSAM EC via the /dev/surface/aggregator
|
|
@@ -4610,8 +4610,8 @@ index 000000000000..340d15b148b9
|
|
+{
|
|
+{
|
|
+ struct ssam_cdev_request __user *r;
|
|
+ struct ssam_cdev_request __user *r;
|
|
+ struct ssam_cdev_request rqst;
|
|
+ struct ssam_cdev_request rqst;
|
|
-+ struct ssam_request spec;
|
|
|
|
-+ struct ssam_response rsp;
|
|
|
|
|
|
++ struct ssam_request spec = {};
|
|
|
|
++ struct ssam_response rsp = {};
|
|
+ const void __user *plddata;
|
|
+ const void __user *plddata;
|
|
+ void __user *rspdata;
|
|
+ void __user *rspdata;
|
|
+ int status = 0, ret = 0, tmp;
|
|
+ int status = 0, ret = 0, tmp;
|
|
@@ -4650,6 +4650,15 @@ index 000000000000..340d15b148b9
|
|
+ goto out;
|
|
+ goto out;
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
|
|
++ /*
|
|
|
|
++ * Note: spec.length is limited to U16_MAX bytes via struct
|
|
|
|
++ * ssam_cdev_request. This is slightly larger than the
|
|
|
|
++ * theoretical maximum (SSH_COMMAND_MAX_PAYLOAD_SIZE) of the
|
|
|
|
++ * underlying protocol (note that nothing remotely this size
|
|
|
|
++ * should ever be allocated in any normal case). This size is
|
|
|
|
++ * validated later in ssam_request_sync(), for allocation the
|
|
|
|
++ * bound imposed by u16 should be enough.
|
|
|
|
++ */
|
|
+ spec.payload = kzalloc(spec.length, GFP_KERNEL);
|
|
+ spec.payload = kzalloc(spec.length, GFP_KERNEL);
|
|
+ if (!spec.payload) {
|
|
+ if (!spec.payload) {
|
|
+ ret = -ENOMEM;
|
|
+ ret = -ENOMEM;
|
|
@@ -4669,6 +4678,16 @@ index 000000000000..340d15b148b9
|
|
+ goto out;
|
|
+ goto out;
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
|
|
++ /*
|
|
|
|
++ * Note: rsp.capacity is limited to U16_MAX bytes via struct
|
|
|
|
++ * ssam_cdev_request. This is slightly larger than the
|
|
|
|
++ * theoretical maximum (SSH_COMMAND_MAX_PAYLOAD_SIZE) of the
|
|
|
|
++ * underlying protocol (note that nothing remotely this size
|
|
|
|
++ * should ever be allocated in any normal case). In later use,
|
|
|
|
++ * this capacity does not have to be strictly bounded, as it
|
|
|
|
++ * is only used as an output buffer to be written to. For
|
|
|
|
++ * allocation the bound imposed by u16 should be enough.
|
|
|
|
++ */
|
|
+ rsp.pointer = kzalloc(rsp.capacity, GFP_KERNEL);
|
|
+ rsp.pointer = kzalloc(rsp.capacity, GFP_KERNEL);
|
|
+ if (!rsp.pointer) {
|
|
+ if (!rsp.pointer) {
|
|
+ ret = -ENOMEM;
|
|
+ ret = -ENOMEM;
|
|
@@ -12928,10 +12947,10 @@ index 000000000000..1221f642dda1
|
|
+#endif /* _SURFACE_AGGREGATOR_SSH_MSGB_H */
|
|
+#endif /* _SURFACE_AGGREGATOR_SSH_MSGB_H */
|
|
diff --git a/drivers/misc/surface_aggregator/ssh_packet_layer.c b/drivers/misc/surface_aggregator/ssh_packet_layer.c
|
|
diff --git a/drivers/misc/surface_aggregator/ssh_packet_layer.c b/drivers/misc/surface_aggregator/ssh_packet_layer.c
|
|
new file mode 100644
|
|
new file mode 100644
|
|
-index 000000000000..74f0faaa2b27
|
|
|
|
|
|
+index 000000000000..583315db8b02
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/drivers/misc/surface_aggregator/ssh_packet_layer.c
|
|
+++ b/drivers/misc/surface_aggregator/ssh_packet_layer.c
|
|
-@@ -0,0 +1,2057 @@
|
|
|
|
|
|
+@@ -0,0 +1,2074 @@
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+/*
|
|
+/*
|
|
+ * SSH packet transport layer.
|
|
+ * SSH packet transport layer.
|
|
@@ -14628,7 +14647,24 @@ index 000000000000..74f0faaa2b27
|
|
+ /* Find SYN. */
|
|
+ /* Find SYN. */
|
|
+ syn_found = sshp_find_syn(source, &aligned);
|
|
+ syn_found = sshp_find_syn(source, &aligned);
|
|
+
|
|
+
|
|
-+ if (unlikely(aligned.ptr - source->ptr) > 0) {
|
|
|
|
|
|
++ if (unlikely(aligned.ptr != source->ptr)) {
|
|
|
|
++ /*
|
|
|
|
++ * We expect aligned.ptr == source->ptr. If this is not the
|
|
|
|
++ * case, then aligned.ptr > source->ptr and we've encountered
|
|
|
|
++ * some unexpected data where we'd expect the start of a new
|
|
|
|
++ * message (i.e. the SYN sequence).
|
|
|
|
++ *
|
|
|
|
++ * This can happen when a CRC check for the previous message
|
|
|
|
++ * failed and we start actively searching for the next one
|
|
|
|
++ * (via the call to sshp_find_syn() above), or the first bytes
|
|
|
|
++ * of a message got dropped or corrupted.
|
|
|
|
++ *
|
|
|
|
++ * In any case, we issue a warning, send a NAK to the EC to
|
|
|
|
++ * request re-transmission of any data we haven't acknowledged
|
|
|
|
++ * yet, and finally, skip everything up to the next SYN
|
|
|
|
++ * sequence.
|
|
|
|
++ */
|
|
|
|
++
|
|
+ ptl_warn(ptl, "rx: parser: invalid start of frame, skipping\n");
|
|
+ ptl_warn(ptl, "rx: parser: invalid start of frame, skipping\n");
|
|
+
|
|
+
|
|
+ /*
|
|
+ /*
|
|
@@ -15582,10 +15618,10 @@ index 000000000000..395c61ef890b
|
|
+#endif /* _SURFACE_AGGREGATOR_SSH_PARSER_h */
|
|
+#endif /* _SURFACE_AGGREGATOR_SSH_PARSER_h */
|
|
diff --git a/drivers/misc/surface_aggregator/ssh_request_layer.c b/drivers/misc/surface_aggregator/ssh_request_layer.c
|
|
diff --git a/drivers/misc/surface_aggregator/ssh_request_layer.c b/drivers/misc/surface_aggregator/ssh_request_layer.c
|
|
new file mode 100644
|
|
new file mode 100644
|
|
-index 000000000000..bb1c862411a2
|
|
|
|
|
|
+index 000000000000..52a83a8fcf82
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/drivers/misc/surface_aggregator/ssh_request_layer.c
|
|
+++ b/drivers/misc/surface_aggregator/ssh_request_layer.c
|
|
-@@ -0,0 +1,1264 @@
|
|
|
|
|
|
+@@ -0,0 +1,1263 @@
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+/*
|
|
+/*
|
|
+ * SSH request transport layer.
|
|
+ * SSH request transport layer.
|
|
@@ -16592,9 +16628,8 @@ index 000000000000..bb1c862411a2
|
|
+ *
|
|
+ *
|
|
+ * Initializes the given request transport layer and associated packet
|
|
+ * Initializes the given request transport layer and associated packet
|
|
+ * transport layer. Transmitter and receiver threads must be started
|
|
+ * transport layer. Transmitter and receiver threads must be started
|
|
-+ * separately via ssh_rtl_tx_start() and ssh_rtl_rx_start(), after the
|
|
|
|
-+ * request-layer has been initialized and the lower-level serial device layer
|
|
|
|
-+ * has been set up.
|
|
|
|
|
|
++ * separately via ssh_rtl_start(), after the request-layer has been
|
|
|
|
++ * initialized and the lower-level serial device layer has been set up.
|
|
+ *
|
|
+ *
|
|
+ * Return: Returns zero on success and a nonzero error code on failure.
|
|
+ * Return: Returns zero on success and a nonzero error code on failure.
|
|
+ */
|
|
+ */
|
|
@@ -16644,7 +16679,7 @@ index 000000000000..bb1c862411a2
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+/**
|
|
+/**
|
|
-+ * ssh_rtl_tx_start() - Start request transmitter and receiver.
|
|
|
|
|
|
++ * ssh_rtl_start() - Start request transmitter and receiver.
|
|
+ * @rtl: The request transport layer.
|
|
+ * @rtl: The request transport layer.
|
|
+ *
|
|
+ *
|
|
+ * Return: Returns zero on success, a negative error code on failure.
|
|
+ * Return: Returns zero on success, a negative error code on failure.
|