From patchwork Sat Jan 21 07:42:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asahi Lina X-Patchwork-Id: 13111019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78DA9C004D4 for ; Sat, 21 Jan 2023 07:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8mrwMmt9cO4/i3VHsgBInySr7KfvmsUdyeNUrZZMcx8=; b=YtQmz908FMkuAl /+ve+Gqe6pch0Z0Qyn94TXGgiTB0pS1kTc2rT1jfqx0uTqUOJAGZIy+tiJfABxeqsdqsjQYeZkNaC iqjY74xNWug/hp+iXzF0IwGvYgf9p2IgZ6/NgbkV3L9B0R+3eTvJxiX1TPbI5ndogTGdiQbWwHFLe zdOKA9cmvi9GcIVg8wY4ZjJikKl9bT2FE+UhrrmebL/xTNhiSiq29/7oUm0FPZkQJEEFSZKprwdL5 lq6AB7tBzcTJVBNIEIk/glk5enn6IBbu9M2yXfNLZpCWV9MifK1UZBcK6whAgIPvlGxlx9Eu9cq+Z JIqV5emOsNjXPU5+xpHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJ8X5-00DXfY-3a; Sat, 21 Jan 2023 07:43:23 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJ8X1-00DXen-CQ for linux-arm-kernel@lists.infradead.org; Sat, 21 Jan 2023 07:43:20 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: linasend@asahilina.net) by mail.marcansoft.com (Postfix) with ESMTPSA id C8F9541EF0; Sat, 21 Jan 2023 07:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=asahilina.net; s=default; t=1674286997; bh=3/HH/e70fh1sArvce9tWJI5BZ4sJUWCbJ03o78bSh0Y=; h=From:To:Cc:Subject:Date; b=Jxe2YsZXl+FVkMrc9H7YYXVt9xACJevd6FMEVBHgpXEHqdlDTasGUSi+2Eu7/3qVC yf1ZRIGV6A4+eUI4qP6RTYSzQmFPvS9i2GAqbuudx94/lPTe8Imzus1ixC9jLsKQ+T VNN6EbtVcFvqVDr+2iAJtt762oicS6z0sntpYUOIxheSycn7+3E7rokapJze/GK6cr FCAIY+IOItdhNhflWB2399Ja02zOSRQhuezRydPEi8hozyV/pLb/nyE8E+7Mad6irq ovX/6LXEPqsTo1Zunc+++j4a4TFIzbIclo+lOXKvFZyWjM01YjminNP9tz9K6yCaGV iKobfTnt7979Q== From: Asahi Lina To: Hector Martin , Sven Peter Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Asahi Lina Subject: [PATCH] soc: apple: rtkit: Add a private pointer to apple_rtkit_shmem Date: Sat, 21 Jan 2023 16:42:53 +0900 Message-Id: <20230121074253.9774-1-lina@asahilina.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_234319_611645_E221E87D X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Sven Peter Signed-off-by: Eric Curtin Reviewed-by: Eric Curtin --- 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; }; /*