crypto: ccp - Drop extra doorbell checks
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 3 Apr 2023 18:32:10 +0000 (13:32 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 14 Apr 2023 10:59:34 +0000 (18:59 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/platform-access.c

index b51fb11..1ad3a0a 100644 (file)
 
 #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;