soc: apple: rtkit: Add a private pointer to apple_rtkit_shmem

Message ID 20230121074253.9774-1-lina@asahilina.net
State New
Headers
Series soc: apple: rtkit: Add a private pointer to apple_rtkit_shmem |

Commit Message

Asahi Lina Jan. 21, 2023, 7:42 a.m. UTC
  This allows downstream consumers to keep track of private data for shmem
mappings. In particular, the Rust abstraction will use this to safely
drop data associated with a mapping when it is unmapped.

Signed-off-by: Asahi Lina <lina@asahilina.net>
---
 include/linux/soc/apple/rtkit.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Sven Peter Jan. 22, 2023, 10:17 a.m. UTC | #1
On Sat, Jan 21, 2023, at 08:42, Asahi Lina wrote:
> This allows downstream consumers to keep track of private data for shmem
> mappings. In particular, the Rust abstraction will use this to safely
> drop data associated with a mapping when it is unmapped.
>
> Signed-off-by: Asahi Lina <lina@asahilina.net>
> ---

Reviewed-by: Sven Peter <sven@svenpeter.dev>

thanks,

Sven
  
Eric Curtin Jan. 22, 2023, 12:07 p.m. UTC | #2
On Sat, 21 Jan 2023 at 07:53, Asahi Lina <lina@asahilina.net> wrote:
>
> This allows downstream consumers to keep track of private data for shmem
> mappings. In particular, the Rust abstraction will use this to safely
> drop data associated with a mapping when it is unmapped.
>
> Signed-off-by: Asahi Lina <lina@asahilina.net>
> ---

Signed-off-by: Eric Curtin <ecurtin@redhat.com>

>  include/linux/soc/apple/rtkit.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index 62bfa37b5adb..1a9888a1797a 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -22,6 +22,7 @@
>   * @size:      Size of the shared memory buffer.
>   * @iova:      Device VA of shared memory buffer.
>   * @is_mapped: Shared memory buffer is managed by the co-processor.
> + * @private:   Private data pointer for the parent driver.
>   */
>
>  struct apple_rtkit_shmem {
> @@ -30,6 +31,7 @@ struct apple_rtkit_shmem {
>         size_t size;
>         dma_addr_t iova;
>         bool is_mapped;
> +       void *private;
>  };
>
>  /*
> --
> 2.35.1
>
>
  
Eric Curtin Jan. 22, 2023, 6:05 p.m. UTC | #3
Is mise le meas/Regards,

Eric Curtin


On Sat, 21 Jan 2023 at 07:53, Asahi Lina <lina@asahilina.net> wrote:
>
> This allows downstream consumers to keep track of private data for shmem
> mappings. In particular, the Rust abstraction will use this to safely
> drop data associated with a mapping when it is unmapped.
>
> Signed-off-by: Asahi Lina <lina@asahilina.net>
> ---

Sorry Lina, these were obviously supposed to not be signed off tags, but:

Reviewed-by: Eric Curtin <ecurtin@redhat.com>

that's what you get, when you copy a tag from somewhere else!

>  include/linux/soc/apple/rtkit.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index 62bfa37b5adb..1a9888a1797a 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -22,6 +22,7 @@
>   * @size:      Size of the shared memory buffer.
>   * @iova:      Device VA of shared memory buffer.
>   * @is_mapped: Shared memory buffer is managed by the co-processor.
> + * @private:   Private data pointer for the parent driver.
>   */
>
>  struct apple_rtkit_shmem {
> @@ -30,6 +31,7 @@ struct apple_rtkit_shmem {
>         size_t size;
>         dma_addr_t iova;
>         bool is_mapped;
> +       void *private;
>  };
>
>  /*
> --
> 2.35.1
>
>
  
Hector Martin Jan. 31, 2023, 11:41 a.m. UTC | #4
On 21/01/2023 16.42, Asahi Lina wrote:
> This allows downstream consumers to keep track of private data for shmem
> mappings. In particular, the Rust abstraction will use this to safely
> drop data associated with a mapping when it is unmapped.
> 
> Signed-off-by: Asahi Lina <lina@asahilina.net>
> ---
>  include/linux/soc/apple/rtkit.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index 62bfa37b5adb..1a9888a1797a 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -22,6 +22,7 @@
>   * @size:      Size of the shared memory buffer.
>   * @iova:      Device VA of shared memory buffer.
>   * @is_mapped: Shared memory buffer is managed by the co-processor.
> + * @private:   Private data pointer for the parent driver.
>   */
>  
>  struct apple_rtkit_shmem {
> @@ -30,6 +31,7 @@ struct apple_rtkit_shmem {
>  	size_t size;
>  	dma_addr_t iova;
>  	bool is_mapped;
> +	void *private;
>  };
>  
>  /*

Thanks, applied to asahi-soc/soc!

- Hector
  

Patch

diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
index 62bfa37b5adb..1a9888a1797a 100644
--- a/include/linux/soc/apple/rtkit.h
+++ b/include/linux/soc/apple/rtkit.h
@@ -22,6 +22,7 @@ 
  * @size:      Size of the shared memory buffer.
  * @iova:      Device VA of shared memory buffer.
  * @is_mapped: Shared memory buffer is managed by the co-processor.
+ * @private:   Private data pointer for the parent driver.
  */
 
 struct apple_rtkit_shmem {
@@ -30,6 +31,7 @@  struct apple_rtkit_shmem {
 	size_t size;
 	dma_addr_t iova;
 	bool is_mapped;
+	void *private;
 };
 
 /*