From: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
To: linux-kernel@vger.kernel.org
Cc: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>,
"Brijesh Singh" <brijesh.singh@amd.com>,
"Tom Lendacky" <thomas.lendacky@amd.com>,
"Kalra, Ashish" <ashish.kalra@amd.com>,
linux-crypto@vger.kernel.org
Subject: [PATCH v2 5/8] crypto: cpp - Bind to psp platform device on x86
Date: Mon, 13 Feb 2023 09:24:26 +0000 [thread overview]
Message-ID: <20230213092429.1167812-6-jpiotrowski@linux.microsoft.com> (raw)
In-Reply-To: <20230213092429.1167812-1-jpiotrowski@linux.microsoft.com>
The PSP in Hyper-V VMs is exposed through the ASP ACPI table and is
represented as a platform_device. Allow the ccp driver to bind to it by
adding an id_table and initing the platform_driver also on x86. At this
point probe is called for the psp device but init fails due to missing
driver data.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
---
drivers/crypto/ccp/sp-dev.c | 7 +++++++
drivers/crypto/ccp/sp-platform.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/crypto/ccp/sp-dev.c b/drivers/crypto/ccp/sp-dev.c
index 7eb3e4668286..4c9f442b8a11 100644
--- a/drivers/crypto/ccp/sp-dev.c
+++ b/drivers/crypto/ccp/sp-dev.c
@@ -259,6 +259,12 @@ static int __init sp_mod_init(void)
if (ret)
return ret;
+ ret = sp_platform_init();
+ if (ret) {
+ sp_pci_exit();
+ return ret;
+ }
+
#ifdef CONFIG_CRYPTO_DEV_SP_PSP
psp_pci_init();
#endif
@@ -286,6 +292,7 @@ static void __exit sp_mod_exit(void)
#ifdef CONFIG_CRYPTO_DEV_SP_PSP
psp_pci_exit();
#endif
+ sp_platform_exit();
sp_pci_exit();
#endif
diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c
index 7d79a8744f9a..5dcc834deb72 100644
--- a/drivers/crypto/ccp/sp-platform.c
+++ b/drivers/crypto/ccp/sp-platform.c
@@ -56,6 +56,12 @@ static const struct of_device_id sp_of_match[] = {
MODULE_DEVICE_TABLE(of, sp_of_match);
#endif
+static const struct platform_device_id sp_platform_match[] = {
+ { "psp" },
+ { },
+};
+MODULE_DEVICE_TABLE(platform, sp_platform_match);
+
static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
{
#ifdef CONFIG_OF
@@ -212,6 +218,7 @@ static int sp_platform_resume(struct platform_device *pdev)
#endif
static struct platform_driver sp_platform_driver = {
+ .id_table = sp_platform_match,
.driver = {
.name = "ccp",
#ifdef CONFIG_ACPI
--
2.25.1
next prev parent reply other threads:[~2023-02-13 9:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 9:24 [PATCH v2 0/8] Support ACPI PSP on Hyper-V Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 1/8] include/acpi: add definition of ASPT table Jeremi Piotrowski
2023-02-13 18:43 ` Rafael J. Wysocki
2023-02-16 10:28 ` Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 2/8] ACPI: ASPT: Add helper to parse table Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 3/8] x86/psp: Register PSP platform device when ASP table is present Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 4/8] x86/psp: Add IRQ support Jeremi Piotrowski
2023-02-13 9:24 ` Jeremi Piotrowski [this message]
2023-02-13 9:24 ` [PATCH v2 6/8] crypto: ccp - Add vdata for platform device Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 7/8] crypto: ccp - Skip DMA coherency check for platform psp Jeremi Piotrowski
2023-02-13 9:24 ` [PATCH v2 8/8] crypto: ccp - Allow platform device to be psp master device Jeremi Piotrowski
2023-02-20 14:49 ` [PATCH v2 0/8] Support ACPI PSP on Hyper-V Tom Lendacky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230213092429.1167812-6-jpiotrowski@linux.microsoft.com \
--to=jpiotrowski@linux.microsoft.com \
--cc=ashish.kalra@amd.com \
--cc=brijesh.singh@amd.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome