Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	John Allen <john.allen@amd.com>
Cc: "Held Felix" <Felix.Held@amd.com>,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	"Mark Hasemeyer" <markhas@chromium.org>,
	"Grzegorz Bernacki" <gjb@semihalf.com>,
	"Jan Dąbroś" <jsd@semihalf.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org
Subject: [PATCH v8 1/6] crypto: ccp: Drop extra doorbell checks
Date: Mon, 3 Apr 2023 13:32:10 -0500	[thread overview]
Message-ID: <20230403183216.3493-2-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230403183216.3493-1-mario.limonciello@amd.com>

The doorbell register set used for I2C arbitration is dedicated for this
purpose and there is no need to utilize other safety checks the platform
access register set uses.

Suggested-by: Mark Hasemeyer <markhas@chromium.org>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mark Hasemeyer <markhas@chromium.org>
Tested-by: Mark Hasemeyer <markhas@chromium.org>
---
 drivers/crypto/ccp/platform-access.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
index b51fb1196932..1ad3a0a512b1 100644
--- a/drivers/crypto/ccp/platform-access.c
+++ b/drivers/crypto/ccp/platform-access.c
@@ -20,14 +20,6 @@
 
 #define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
 
-/* Doorbell shouldn't be ringing */
-static int check_doorbell(u32 __iomem *doorbell)
-{
-	u32 tmp;
-
-	return readl_poll_timeout(doorbell, tmp, tmp != 0, 0, PSP_CMD_TIMEOUT_US);
-}
-
 /* Recovery field should be equal 0 to start sending commands */
 static int check_recovery(u32 __iomem *cmd)
 {
@@ -156,18 +148,6 @@ int psp_ring_platform_doorbell(int msg)
 
 	mutex_lock(&pa_dev->doorbell_mutex);
 
-	if (check_doorbell(button)) {
-		dev_dbg(psp->dev, "doorbell is not ready\n");
-		ret = -EBUSY;
-		goto unlock;
-	}
-
-	if (check_recovery(cmd)) {
-		dev_dbg(psp->dev, "doorbell command in recovery\n");
-		ret = -EBUSY;
-		goto unlock;
-	}
-
 	if (wait_cmd(cmd)) {
 		dev_dbg(psp->dev, "doorbell command not done processing\n");
 		ret = -EBUSY;
-- 
2.34.1


  reply	other threads:[~2023-04-03 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 18:32 [PATCH v8 0/6] Use CCP driver to handle PSP I2C arbitration Mario Limonciello
2023-04-03 18:32 ` Mario Limonciello [this message]
2023-04-03 18:32 ` [PATCH v8 2/6] crypto: ccp: Bump up doorbell debug message to error Mario Limonciello
2023-04-03 18:32 ` [PATCH v8 3/6] crypto: ccp: Return doorbell status code as an argument Mario Limonciello
2023-04-03 18:32 ` [PATCH v8 4/6] crypto: ccp: Use lower 8 bytes to communicate with doorbell command register Mario Limonciello
2023-04-06  6:42 ` [PATCH v8 0/6] Use CCP driver to handle PSP I2C arbitration Wolfram Sang
2023-04-06 11:58   ` Mario Limonciello
2023-04-07  6:18     ` Wolfram Sang
2023-04-12 16:28       ` Limonciello, Mario
2023-04-14 11:05 ` Herbert Xu

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=20230403183216.3493-2-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Felix.Held@amd.com \
    --cc=davem@davemloft.net \
    --cc=gjb@semihalf.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.allen@amd.com \
    --cc=jsd@semihalf.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markhas@chromium.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