linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] RTKit protocol version 10 support
@ 2025-12-23 14:13 Nick Chan
  2025-12-23 14:13 ` [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start Nick Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nick Chan @ 2025-12-23 14:13 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Lee Jones
  Cc: asahi, linux-arm-kernel, linux-kernel, Nick Chan

Add support for version 10 of the RTKit protocol which is used from iOS 11
to iOS 13. In version 10 epmap is always completed within 1 message, and
app endpoints start at 0x6 instead of 0x20.

A new interface apple_rtkit_app_ep_to_ep() is added to accommodate the
difference in app endpoints. Consumer drivers that uses RTKit app endpoints
need to be modified to use the new interface to work with protocol
version 10.

Add support in macsmc to get the SMC endpoint with the new interface.
nvme-apple does not use any RTKit app endpoints.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
---
Nick Chan (3):
      soc: apple: rtkit: Support verison-specific app endpoint start
      soc: apple: rtkit: Add protocol version 10 support
      mfd: macsmc: Support variable app endpoint start

 drivers/mfd/macsmc.c               | 18 +++++++-----
 drivers/soc/apple/rtkit-internal.h |  4 ++-
 drivers/soc/apple/rtkit.c          | 59 ++++++++++++++++++++++++++------------
 include/linux/mfd/macsmc.h         |  2 ++
 include/linux/soc/apple/rtkit.h    | 10 +++++++
 5 files changed, 67 insertions(+), 26 deletions(-)
---
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
change-id: 20251222-rtkit-v10-cdcf41bdaaef

Best regards,
-- 
Nick Chan <towinchenmi@gmail.com>



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

* [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start
  2025-12-23 14:13 [PATCH 0/3] RTKit protocol version 10 support Nick Chan
@ 2025-12-23 14:13 ` Nick Chan
  2026-01-04 15:17   ` Sven Peter
  2025-12-23 14:13 ` [PATCH 2/3] soc: apple: rtkit: Add protocol version 10 support Nick Chan
  2025-12-23 14:13 ` [PATCH 3/3] mfd: macsmc: Support variable app endpoint start Nick Chan
  2 siblings, 1 reply; 5+ messages in thread
From: Nick Chan @ 2025-12-23 14:13 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Lee Jones
  Cc: asahi, linux-arm-kernel, linux-kernel, Nick Chan

Support for protocol versions where app endpoints starts at a
different endpoint number will be added. Consumer drivers will also
need to be modified to have them to work with such protocol
versions.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
---
 drivers/soc/apple/rtkit-internal.h |  3 ++-
 drivers/soc/apple/rtkit.c          | 42 +++++++++++++++++++++++++++-----------
 include/linux/soc/apple/rtkit.h    | 10 +++++++++
 3 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/drivers/soc/apple/rtkit-internal.h b/drivers/soc/apple/rtkit-internal.h
index b8d5244678f0100b72173fa9aca80bf9db1b4e5e..52ef7a202120eb8a56c149179389741ec0f5e358 100644
--- a/drivers/soc/apple/rtkit-internal.h
+++ b/drivers/soc/apple/rtkit-internal.h
@@ -19,7 +19,7 @@
 #include <linux/workqueue.h>
 #include "mailbox.h"
 
-#define APPLE_RTKIT_APP_ENDPOINT_START 0x20
+#define APPLE_RTKIT_APP_ENDPOINT_START_V11 0x20
 #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
 
 struct apple_rtkit {
@@ -35,6 +35,7 @@ struct apple_rtkit {
 
 	int boot_result;
 	int version;
+	u8 app_ep_start;
 
 	unsigned int iop_power_state;
 	unsigned int ap_power_state;
diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
index b8d4da147d23f7e99e76eea314e4d976cddbd1c6..716d6a3e6eefd82d919467e39d68245c5c0d137c 100644
--- a/drivers/soc/apple/rtkit.c
+++ b/drivers/soc/apple/rtkit.c
@@ -140,6 +140,8 @@ static void apple_rtkit_management_rx_hello(struct apple_rtkit *rtk, u64 msg)
 		 want_ver);
 	rtk->version = want_ver;
 
+	rtk->app_ep_start = APPLE_RTKIT_APP_ENDPOINT_START_V11;
+
 	reply = FIELD_PREP(APPLE_RTKIT_MGMT_HELLO_MINVER, want_ver);
 	reply |= FIELD_PREP(APPLE_RTKIT_MGMT_HELLO_MAXVER, want_ver);
 	apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_HELLO_REPLY, reply);
@@ -179,7 +181,7 @@ static void apple_rtkit_management_rx_epmap(struct apple_rtkit *rtk, u64 msg)
 	if (!(msg & APPLE_RTKIT_MGMT_EPMAP_LAST))
 		return;
 
-	for_each_set_bit(ep, rtk->endpoints, APPLE_RTKIT_APP_ENDPOINT_START) {
+	for_each_set_bit(ep, rtk->endpoints, rtk->app_ep_start) {
 		switch (ep) {
 		/* the management endpoint is started by default */
 		case APPLE_RTKIT_EP_MGMT:
@@ -547,20 +549,21 @@ static void apple_rtkit_rx_work(struct work_struct *work)
 	case APPLE_RTKIT_EP_OSLOG:
 		apple_rtkit_oslog_rx(rtk, rtk_work->msg);
 		break;
-	case APPLE_RTKIT_APP_ENDPOINT_START ... 0xff:
-		if (rtk->ops->recv_message)
+	default:
+		if (rtk_work->ep >= rtk->app_ep_start && rtk->ops->recv_message)
 			rtk->ops->recv_message(rtk->cookie, rtk_work->ep,
 					       rtk_work->msg);
-		else
+		else if (rtk_work->ep >= rtk->app_ep_start)
 			dev_warn(
 				rtk->dev,
 				"Received unexpected message to EP%02d: %llx\n",
 				rtk_work->ep, rtk_work->msg);
+		else
+			dev_warn(
+				rtk->dev,
+				"RTKit: message to unknown endpoint %02x: %llx\n",
+				rtk_work->ep, rtk_work->msg);
 		break;
-	default:
-		dev_warn(rtk->dev,
-			 "RTKit: message to unknown endpoint %02x: %llx\n",
-			 rtk_work->ep, rtk_work->msg);
 	}
 
 	kfree(rtk_work);
@@ -585,7 +588,7 @@ static void apple_rtkit_rx(struct apple_mbox *mbox, struct apple_mbox_msg msg,
 			 "RTKit: Message to undiscovered endpoint 0x%02x\n",
 			 ep);
 
-	if (ep >= APPLE_RTKIT_APP_ENDPOINT_START &&
+	if (ep >= rtk->app_ep_start &&
 	    rtk->ops->recv_message_early &&
 	    rtk->ops->recv_message_early(rtk->cookie, ep, msg.msg0))
 		return;
@@ -615,8 +618,7 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
 		return -EINVAL;
 	}
 
-	if (ep >= APPLE_RTKIT_APP_ENDPOINT_START &&
-	    !apple_rtkit_is_running(rtk)) {
+	if (ep >= rtk->app_ep_start && !apple_rtkit_is_running(rtk)) {
 		dev_warn(rtk->dev,
 			 "RTKit: Endpoint 0x%02x is not running, cannot send message\n", ep);
 		return -EINVAL;
@@ -645,7 +647,7 @@ int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint)
 
 	if (!test_bit(endpoint, rtk->endpoints))
 		return -EINVAL;
-	if (endpoint >= APPLE_RTKIT_APP_ENDPOINT_START &&
+	if (endpoint >= rtk->app_ep_start &&
 	    !apple_rtkit_is_running(rtk))
 		return -EINVAL;
 
@@ -675,6 +677,13 @@ struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie,
 	rtk->cookie = cookie;
 	rtk->ops = ops;
 
+	/*
+	 * The management endpoint is required to receive the HELLO message
+	 * and infer the start of app endpoints so assume it is a system
+	 * endpoint here and update this value when HELLO is received.
+	 */
+	rtk->app_ep_start = APPLE_RTKIT_EP_CRASHLOG;
+
 	init_completion(&rtk->epmap_completion);
 	init_completion(&rtk->iop_pwr_ack_completion);
 	init_completion(&rtk->ap_pwr_ack_completion);
@@ -851,6 +860,15 @@ int apple_rtkit_shutdown(struct apple_rtkit *rtk)
 }
 EXPORT_SYMBOL_GPL(apple_rtkit_shutdown);
 
+u8 apple_rtkit_app_ep_to_ep(struct apple_rtkit *rtk, u8 app_ep)
+{
+	if (!apple_rtkit_is_running(rtk))
+		return 0;
+
+	return rtk->app_ep_start + app_ep;
+}
+EXPORT_SYMBOL_GPL(apple_rtkit_app_ep_to_ep);
+
 int apple_rtkit_idle(struct apple_rtkit *rtk)
 {
 	int ret;
diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
index 736f530180179bd144cf85eb0f0bd93844d7188a..423cf1022372b124c9b2728445f85a9b3067c707 100644
--- a/include/linux/soc/apple/rtkit.h
+++ b/include/linux/soc/apple/rtkit.h
@@ -172,4 +172,14 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
  */
 int apple_rtkit_poll(struct apple_rtkit *rtk);
 
+/*
+ * Convert an endpoint number relative to start of app endpoint to an absolute
+ * endpoint number.
+ *
+ * Returns the endpoint number on success, 0 on failure.
+ *
+ * @rtk:            RTKit reference
+ */
+u8 apple_rtkit_app_ep_to_ep(struct apple_rtkit *rtk, u8 app_ep);
+
 #endif /* _LINUX_APPLE_RTKIT_H_ */

-- 
2.52.0



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

* [PATCH 2/3] soc: apple: rtkit: Add protocol version 10 support
  2025-12-23 14:13 [PATCH 0/3] RTKit protocol version 10 support Nick Chan
  2025-12-23 14:13 ` [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start Nick Chan
@ 2025-12-23 14:13 ` Nick Chan
  2025-12-23 14:13 ` [PATCH 3/3] mfd: macsmc: Support variable app endpoint start Nick Chan
  2 siblings, 0 replies; 5+ messages in thread
From: Nick Chan @ 2025-12-23 14:13 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Lee Jones
  Cc: asahi, linux-arm-kernel, linux-kernel, Nick Chan

Add support for protocol version 10 used from iOS 11-13. In
protocol version 10, epmap is always completed within a single
message, and app endpoints start at 0x6 instead of 0x20.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
---
 drivers/soc/apple/rtkit-internal.h |  1 +
 drivers/soc/apple/rtkit.c          | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/apple/rtkit-internal.h b/drivers/soc/apple/rtkit-internal.h
index 52ef7a202120eb8a56c149179389741ec0f5e358..5f91dea8b7a178b368783d74f8c5786ea2965fa7 100644
--- a/drivers/soc/apple/rtkit-internal.h
+++ b/drivers/soc/apple/rtkit-internal.h
@@ -19,6 +19,7 @@
 #include <linux/workqueue.h>
 #include "mailbox.h"
 
+#define APPLE_RTKIT_APP_ENDPOINT_START_V10 0x6
 #define APPLE_RTKIT_APP_ENDPOINT_START_V11 0x20
 #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
 
diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
index 716d6a3e6eefd82d919467e39d68245c5c0d137c..376d1d30fd1e2176357c1daa24c76300c7c70f85 100644
--- a/drivers/soc/apple/rtkit.c
+++ b/drivers/soc/apple/rtkit.c
@@ -71,7 +71,7 @@ enum {
 #define APPLE_RTKIT_OSLOG_SIZE GENMASK_ULL(55, 36)
 #define APPLE_RTKIT_OSLOG_IOVA GENMASK_ULL(35, 0)
 
-#define APPLE_RTKIT_MIN_SUPPORTED_VERSION 11
+#define APPLE_RTKIT_MIN_SUPPORTED_VERSION 10
 #define APPLE_RTKIT_MAX_SUPPORTED_VERSION 12
 
 struct apple_rtkit_rx_work {
@@ -140,7 +140,10 @@ static void apple_rtkit_management_rx_hello(struct apple_rtkit *rtk, u64 msg)
 		 want_ver);
 	rtk->version = want_ver;
 
-	rtk->app_ep_start = APPLE_RTKIT_APP_ENDPOINT_START_V11;
+	if (rtk->version < 11)
+		rtk->app_ep_start = APPLE_RTKIT_APP_ENDPOINT_START_V10;
+	else
+		rtk->app_ep_start = APPLE_RTKIT_APP_ENDPOINT_START_V11;
 
 	reply = FIELD_PREP(APPLE_RTKIT_MGMT_HELLO_MINVER, want_ver);
 	reply |= FIELD_PREP(APPLE_RTKIT_MGMT_HELLO_MAXVER, want_ver);
@@ -171,14 +174,16 @@ static void apple_rtkit_management_rx_epmap(struct apple_rtkit *rtk, u64 msg)
 	}
 
 	reply = FIELD_PREP(APPLE_RTKIT_MGMT_EPMAP_BASE, base);
-	if (msg & APPLE_RTKIT_MGMT_EPMAP_LAST)
-		reply |= APPLE_RTKIT_MGMT_EPMAP_LAST;
-	else
-		reply |= APPLE_RTKIT_MGMT_EPMAP_REPLY_MORE;
+	if (rtk->version > 10) {
+		if (msg & APPLE_RTKIT_MGMT_EPMAP_LAST)
+			reply |= APPLE_RTKIT_MGMT_EPMAP_LAST;
+		else
+			reply |= APPLE_RTKIT_MGMT_EPMAP_REPLY_MORE;
+	}
 
 	apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_EPMAP_REPLY, reply);
 
-	if (!(msg & APPLE_RTKIT_MGMT_EPMAP_LAST))
+	if (rtk->version > 10 && !(msg & APPLE_RTKIT_MGMT_EPMAP_LAST))
 		return;
 
 	for_each_set_bit(ep, rtk->endpoints, rtk->app_ep_start) {

-- 
2.52.0



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

* [PATCH 3/3] mfd: macsmc: Support variable app endpoint start
  2025-12-23 14:13 [PATCH 0/3] RTKit protocol version 10 support Nick Chan
  2025-12-23 14:13 ` [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start Nick Chan
  2025-12-23 14:13 ` [PATCH 2/3] soc: apple: rtkit: Add protocol version 10 support Nick Chan
@ 2025-12-23 14:13 ` Nick Chan
  2 siblings, 0 replies; 5+ messages in thread
From: Nick Chan @ 2025-12-23 14:13 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Lee Jones
  Cc: asahi, linux-arm-kernel, linux-kernel, Nick Chan

Instead of hardcoding the SMC endpoint number, use
apple_rtkit_app_ep_to_ep() to convert a relative endpoint number to
an absolute endpoint number in order to support protocol versions
with a different start of app endpoint number.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
---
 drivers/mfd/macsmc.c       | 18 +++++++++++-------
 include/linux/mfd/macsmc.h |  2 ++
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/macsmc.c b/drivers/mfd/macsmc.c
index e3893e255ce5e4bb4832d80ad1fc002d413a291a..4e0fc5ddf9293ee7281680e964fc5f9b80260b3d 100644
--- a/drivers/mfd/macsmc.c
+++ b/drivers/mfd/macsmc.c
@@ -21,7 +21,7 @@
 #include <linux/soc/apple/rtkit.h>
 #include <linux/unaligned.h>
 
-#define SMC_ENDPOINT			0x20
+#define SMC_APP_ENDPOINT		0
 
 /* We don't actually know the true size here but this seem reasonable */
 #define SMC_SHMEM_SIZE			0x1000
@@ -72,7 +72,7 @@ static int apple_smc_cmd_locked(struct apple_smc *smc, u64 cmd, u64 arg,
 	       FIELD_PREP(SMC_ID, smc->msg_id) |
 	       FIELD_PREP(SMC_DATA, arg));
 
-	ret = apple_rtkit_send_message(smc->rtk, SMC_ENDPOINT, msg, NULL, false);
+	ret = apple_rtkit_send_message(smc->rtk, smc->ep, msg, NULL, false);
 	if (ret) {
 		dev_err(smc->dev, "Failed to send command\n");
 		return ret;
@@ -262,7 +262,7 @@ int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf,
 	       FIELD_PREP(SMC_DATA, key));
 	smc->atomic_pending = true;
 
-	ret = apple_rtkit_send_message(smc->rtk, SMC_ENDPOINT, msg, NULL, true);
+	ret = apple_rtkit_send_message(smc->rtk, smc->ep, msg, NULL, true);
 	if (ret < 0) {
 		dev_err(smc->dev, "Failed to send command (%d)\n", ret);
 		return ret;
@@ -330,7 +330,7 @@ static bool apple_smc_rtkit_recv_early(void *cookie, u8 endpoint, u64 message)
 {
 	struct apple_smc *smc = cookie;
 
-	if (endpoint != SMC_ENDPOINT) {
+	if (endpoint != smc->ep) {
 		dev_warn(smc->dev, "Received message for unknown endpoint 0x%x\n", endpoint);
 		return false;
 	}
@@ -366,7 +366,7 @@ static void apple_smc_rtkit_recv(void *cookie, u8 endpoint, u64 message)
 {
 	struct apple_smc *smc = cookie;
 
-	if (endpoint != SMC_ENDPOINT) {
+	if (endpoint != smc->ep) {
 		dev_warn(smc->dev, "Received message for unknown endpoint 0x%x\n", endpoint);
 		return;
 	}
@@ -427,18 +427,22 @@ static int apple_smc_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to wake up SMC");
 
+	smc->ep = apple_rtkit_app_ep_to_ep(smc->rtk, SMC_APP_ENDPOINT);
+	if (!smc->ep)
+		return dev_err_probe(dev, ret, "Failed to get SMC endpoint");
+
 	ret = devm_add_action_or_reset(dev, apple_smc_rtkit_shutdown, smc);
 	if (ret)
 		return ret;
 
-	ret = apple_rtkit_start_ep(smc->rtk, SMC_ENDPOINT);
+	ret = apple_rtkit_start_ep(smc->rtk, smc->ep);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to start SMC endpoint");
 
 	init_completion(&smc->init_done);
 	init_completion(&smc->cmd_done);
 
-	ret = apple_rtkit_send_message(smc->rtk, SMC_ENDPOINT,
+	ret = apple_rtkit_send_message(smc->rtk, smc->ep,
 				       FIELD_PREP(SMC_MSG, SMC_MSG_INITIALIZE), NULL, false);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to send init message");
diff --git a/include/linux/mfd/macsmc.h b/include/linux/mfd/macsmc.h
index cc09ecce0df7424b288d4248d869f4c9bed3e188..1a462baae0e38ac099f90988afda0f3f5ad968b9 100644
--- a/include/linux/mfd/macsmc.h
+++ b/include/linux/mfd/macsmc.h
@@ -93,6 +93,7 @@ enum apple_smc_boot_stage {
  * @sram: Pointer to SRAM resource
  * @sram_base: SRAM base address
  * @shmem: RTKit shared memory structure for SRAM
+ * @ep: SMC endpoint number
  * @msg_id: Current message id for commands, will be incremented for each command
  * @atomic_mode: Flag set when atomic mode is entered
  * @atomic_pending: Flag indicating pending atomic command
@@ -118,6 +119,7 @@ struct apple_smc {
 	struct resource *sram;
 	void __iomem *sram_base;
 	struct apple_rtkit_shmem shmem;
+	u8 ep;
 
 	unsigned int msg_id;
 

-- 
2.52.0



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

* Re: [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start
  2025-12-23 14:13 ` [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start Nick Chan
@ 2026-01-04 15:17   ` Sven Peter
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Peter @ 2026-01-04 15:17 UTC (permalink / raw)
  To: Nick Chan
  Cc: asahi, linux-arm-kernel, linux-kernel, Lee Jones, Janne Grunau,
	Neal Gompa

Hi,


On 23.12.25 15:13, Nick Chan wrote:
> Support for protocol versions where app endpoints starts at a
> different endpoint number will be added. Consumer drivers will also
> need to be modified to have them to work with such protocol
> versions.
> 
> Signed-off-by: Nick Chan <towinchenmi@gmail.com>
> ---
>   drivers/soc/apple/rtkit-internal.h |  3 ++-
>   drivers/soc/apple/rtkit.c          | 42 +++++++++++++++++++++++++++-----------
>   include/linux/soc/apple/rtkit.h    | 10 +++++++++
>   3 files changed, 42 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/soc/apple/rtkit-internal.h b/drivers/soc/apple/rtkit-internal.h
> index b8d5244678f0100b72173fa9aca80bf9db1b4e5e..52ef7a202120eb8a56c149179389741ec0f5e358 100644
> --- a/drivers/soc/apple/rtkit-internal.h
> +++ b/drivers/soc/apple/rtkit-internal.h

[...]

>   
> +	/*
> +	 * The management endpoint is required to receive the HELLO message
> +	 * and infer the start of app endpoints so assume it is a system
> +	 * endpoint here and update this value when HELLO is received.
> +	 */
> +	rtk->app_ep_start = APPLE_RTKIT_EP_CRASHLOG;

The comment doesn't explain why you set this to APPLE_RTKIT_EP_CRASHLOG.


> +
>   	init_completion(&rtk->epmap_completion);
>   	init_completion(&rtk->iop_pwr_ack_completion);
>   	init_completion(&rtk->ap_pwr_ack_completion);
> @@ -851,6 +860,15 @@ int apple_rtkit_shutdown(struct apple_rtkit *rtk)
>   }
>   EXPORT_SYMBOL_GPL(apple_rtkit_shutdown);
>   
> +u8 apple_rtkit_app_ep_to_ep(struct apple_rtkit *rtk, u8 app_ep)
> +{
> +	if (!apple_rtkit_is_running(rtk))
> +		return 0;

Please don't just silently ignore errors.

> +
> +	return rtk->app_ep_start + app_ep;
> +}
> +EXPORT_SYMBOL_GPL(apple_rtkit_app_ep_to_ep);
> +
>   int apple_rtkit_idle(struct apple_rtkit *rtk)
>   {
>   	int ret;
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index 736f530180179bd144cf85eb0f0bd93844d7188a..423cf1022372b124c9b2728445f85a9b3067c707 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -172,4 +172,14 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
>    */
>   int apple_rtkit_poll(struct apple_rtkit *rtk);
>   
> +/*
> + * Convert an endpoint number relative to start of app endpoint to an absolute
> + * endpoint number.


Is this conversion even true for other co-processors that are not SMC or 
does it just work by accident here? Maybe it makes more sense to drop 
this function and decide which endpoint to use in the SMC driver.

The documentation is also a bit confusing, please at least explain what 
"start of app endpoint" means and where/how you would use this function.





Sven



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

end of thread, other threads:[~2026-01-04 15:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23 14:13 [PATCH 0/3] RTKit protocol version 10 support Nick Chan
2025-12-23 14:13 ` [PATCH 1/3] soc: apple: rtkit: Support verison-specific app endpoint start Nick Chan
2026-01-04 15:17   ` Sven Peter
2025-12-23 14:13 ` [PATCH 2/3] soc: apple: rtkit: Add protocol version 10 support Nick Chan
2025-12-23 14:13 ` [PATCH 3/3] mfd: macsmc: Support variable app endpoint start Nick Chan

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).