From: Mario Limonciello <mario.limonciello@amd.com>
To: Tom Lendacky <thomas.lendacky@amd.com>,
John Allen <john.allen@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S . Miller" <davem@davemloft.net>,
<linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH v4 04/11] crypto: ccp: move setting PSP master to earlier in the init
Date: Thu, 8 Jun 2023 06:17:50 -0500 [thread overview]
Message-ID: <20230608111757.32054-5-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230608111757.32054-1-mario.limonciello@amd.com>
Dynamic boost control needs to use platform access symbols
that look for the PSP master as part of initialization.
So move the PSP master before psp_init() so that dynamic boost
control can be initialized properly.
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v3->v4:
* Pick up tag
v2->v3:
* Clean up master device if psp_init() failed
---
drivers/crypto/ccp/psp-dev.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index e3d6955d3265..3390f0bd6408 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -173,13 +173,14 @@ int psp_dev_init(struct sp_device *sp)
goto e_err;
}
+ /* master device must be set for platform access */
+ if (psp->sp->set_psp_master_device)
+ psp->sp->set_psp_master_device(psp->sp);
+
ret = psp_init(psp);
if (ret)
goto e_irq;
- if (sp->set_psp_master_device)
- sp->set_psp_master_device(sp);
-
/* Enable interrupt */
iowrite32(-1, psp->io_regs + psp->vdata->inten_reg);
@@ -188,6 +189,9 @@ int psp_dev_init(struct sp_device *sp)
return 0;
e_irq:
+ if (sp->clear_psp_master_device)
+ sp->clear_psp_master_device(sp);
+
sp_free_psp_irq(psp->sp, psp);
e_err:
sp->psp_data = NULL;
--
2.34.1
next prev parent reply other threads:[~2023-06-08 19:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 11:17 [PATCH v4 00/11] Add dynamic boost control support Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 01/11] crypto: ccp: Rename macro for security attributes Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 02/11] crypto: ccp: Add support for displaying PSP firmware versions Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 03/11] crypto: ccp: Add bootloader and TEE version offsets Mario Limonciello
2023-06-08 11:17 ` Mario Limonciello [this message]
2023-06-08 11:17 ` [PATCH v4 05/11] crypto: ccp: Add support for fetching a nonce for dynamic boost control Mario Limonciello
2023-06-23 8:14 ` Herbert Xu
2023-06-08 11:17 ` [PATCH v4 06/11] crypto: ccp: Add support for setting user ID " Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 07/11] crypto: ccp: Add support for getting and setting DBC parameters Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 08/11] crypto: ccp: Add a sample library for ioctl use Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 09/11] crypto: ccp: Add a sample python script for Dynamic Boost Control Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 10/11] crypto: ccp: Add unit tests for dynamic boost control Mario Limonciello
2023-06-08 11:17 ` [PATCH v4 11/11] crypto: ccp: Add Mario to MAINTAINERS Mario Limonciello
2023-06-21 20:59 ` [PATCH v4 00/11] Add dynamic boost control support 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=20230608111757.32054-5-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=john.allen@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;
as well as URLs for NNTP newsgroup(s).