Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3112712pxf; Mon, 15 Mar 2021 01:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymJMEA0QI9cFTJcuEGtSA7FgazgbUawarMmtG3kI+h8iI4bI4dQqfxfdGcQqLEJQ00dTKD X-Received: by 2002:a17:906:74c4:: with SMTP id z4mr1672860ejl.512.1615796828552; Mon, 15 Mar 2021 01:27:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1615796828; cv=pass; d=google.com; s=arc-20160816; b=fEUN7l84X7wUCx5ekC0XDDM510ygHssH0Uk6xcGuffFLg6MHwOR5aeYeufrCpj5NuQ NdAfE0mqTkzl4LtdOhug7L+pEkPyXzQes2T/dUmmPtDDQ4j8wJilxiPDTm1LVJBHlOPH Y6887i0xtFBeI3vZYKdemVbPbFkYImJGWSeaYLG6He+q0ToDRDMWnmfcfKfr9lpBFglO FZRWOgi23aFyLZIM2fTmh3DznDeCFvi/LIjwBLFzAvUb38mE0xsQVAejIxl3AVXqHukO YROkMyhAW5Hwkr+bOux81v6gPd9fiztavSNW65ngiSUSpB3jgp5Vg5qCH0Szd0n8oO3v +I/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EPl6QTO809v7FQVSPOpW9fte9x6JzqJXKza9Z5Va3Z0=; b=Bn5Dj0PEsnz6WNVCeA3QU39hvkb2oJw1L3vZRblej7b3xJTEXfw2vSlnGRxyZoPBZG lt1X35jJQ+CH4zGNv8V2CNQphW/Tw6Uu9RGJjanA2+0wcl9rlD3dvyogJAZQv9G00Ezu 2kmLyVmZ7W4p6S7o3teUJshUADyLvQuBEnYPBYpib/9Wfxv30Zm7SKfySNEuq51woMrk qFFzDNqhzD7vxmRb7mUOXvPeryw6nYp2d+ebbzSvIdfVfVS7pauquybpUSo/80JxX2pB pe0UwMG6Pdl/ysccR6Iz42f0SgjxInr/RcDgIog0/3zaJgxTtf7Fj0FgzNVMfyZ1ClP/ gqZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Bye5e05Q; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si10868599eds.83.2021.03.15.01.26.37; Mon, 15 Mar 2021 01:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Bye5e05Q; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbhCOI0F (ORCPT + 99 others); Mon, 15 Mar 2021 04:26:05 -0400 Received: from mail-mw2nam10on2043.outbound.protection.outlook.com ([40.107.94.43]:54657 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230204AbhCOI0A (ORCPT ); Mon, 15 Mar 2021 04:26:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQeB2pAQmgcYMr4pRV/2W/ouO19popcRbeVlBxP9bT5leeR0oNTB37WQBCOlEXfXsvQecws/bZ0HzdPj2JZYN4UcUwBtolDEFkrKPCOc3EjGEAbvG0+Vw2Vb9sMVcHHGHTgnWvPkuOu0T/3DF7KJmmtnAAQMpOwHR+PHrKgF4YBnZ8ObyhTvyCy2cTq9YSptM0icGzCuB5xRRiuWOVDLA/hV0at22svXr0zCHa+5nxDc4nN7qfZEQ5Hw/WKVDHeIWgIJDKPKZVhxsMYeB5XHDCPtCHZQie346Y6ZTrW2r2Mglpt2NUceg9ShYnj7T3dLBEQbd+GlRb4QE7uidpQERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EPl6QTO809v7FQVSPOpW9fte9x6JzqJXKza9Z5Va3Z0=; b=VsIUZP2G13Cw4tlYPfhWr7MI1vFezmlp+aLxwhWVmOSMgowROMLSaUupAm508ZBDnSLI12GswemnLRTM2kXfwVVHHWEnlE8Y3ltZs3SjymqeX5/qaFqiAWoNuZhTP8q9njWtHqQk8GSzwwh/wwNhn8niv5NQGVxj4Ylxpamh1K4jipRlk70tHdkeQyXtknSRRRq96Xw0bRkHZY4dTsTkAUqlX9YU6jMnH53v8/Oiud/dp+h3I9zdqfQ6UtxghYkRUuKFSaT2vBvIbaeZlyeCl+yo2LVKbit4JzDTzhgUmYBkIYZm41Ns0pmaE+kag5NzSrWwC62tFGLuRrMcM+JKGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EPl6QTO809v7FQVSPOpW9fte9x6JzqJXKza9Z5Va3Z0=; b=Bye5e05QTKtkCWkI/GPi+jig9HOWd/qGWaicZBSr7t5+0W6CT+3eQlaKrYzMikq0KnHaOK3jVbH0wHy3ZaRIz949KOwNpW5vUKHt9pcZNI26qMRj0Cuom48Mm5w7acX06Nynw1amt/j0nABbkOKHn8eBv4tc0dXQAhpVOepHGdw= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB4719.namprd12.prod.outlook.com (2603:10b6:805:e9::25) by SA0PR12MB4368.namprd12.prod.outlook.com (2603:10b6:806:9f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Mon, 15 Mar 2021 08:25:59 +0000 Received: from SN6PR12MB4719.namprd12.prod.outlook.com ([fe80::c32:245b:4812:ee03]) by SN6PR12MB4719.namprd12.prod.outlook.com ([fe80::c32:245b:4812:ee03%3]) with mapi id 15.20.3933.032; Mon, 15 Mar 2021 08:25:59 +0000 From: Rijo Thomas To: Tom Lendacky , John Allen , Herbert Xu , "David S . Miller" , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Cc: Rijo Thomas , Mythri Pandeshwara krishna , Devaraj Rangasamy , Jens Wiklander , Ard Biesheuvel Subject: [PATCH v3 1/2] crypto: ccp - reduce tee command status polling interval from 5ms to 1ms Date: Mon, 15 Mar 2021 13:55:28 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Content-Type: text/plain X-Originating-IP: [165.204.156.251] X-ClientProxiedBy: MAXPR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::19) To SN6PR12MB4719.namprd12.prod.outlook.com (2603:10b6:805:e9::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from andbang6.amd.com (165.204.156.251) by MAXPR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 08:25:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a0fc304-d6e0-44f4-2917-08d8e78bf650 X-MS-TrafficTypeDiagnostic: SA0PR12MB4368: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tSLADfoUoKLGX4V32uQcOglNEg8pIXb+gPWDFQHYH/LG/KComoiP6B2+o/Qum4kqt2RW6W5ToBTxv2Bjw4STVINCTpu+YcAC8XMLbCOdv+L2zAGG5pqvNiGJFoLHWeg+G5eKMxc0bJ6cSjtJjeUMRD67NvNndUowwUN/K+LaQmH+G3+OAMgQzvvuX6gVF8c3u/rtgP46R+QTZCuASBfBVy1TdWdILeW5PrDHmTazqGGuwc0dd5KaAQ4yuwTiQKKYSIfCF6y0YtwaWaH53Kab73En4JfFtOTqXPCRPoymoFemyBoy9I1UOkAl1ZPV8cPHInFiaVjea/LwqxZPBRIabgvrx63UilqNpE9hHqpDNlVOyKlffmLCnGpJFW86yJr62I2CzyesGQcK8UXjOJsAAzXWD2JH5CH3EE/jx3V8qFzh2wKV+LtcYcsPYPIKhyONH48ArHfA8Qej3aoe6RbhaFOecB7NGxnlr/gf1TAKYRfIXpo7sELfyCPW/NRdogUDwRldE42aXed09g8Ti0OPIRhkmG6p3Zj+zXcU/jJQZKE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB4719.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(396003)(39860400002)(366004)(346002)(36756003)(52116002)(8676002)(4326008)(7696005)(83380400001)(2906002)(478600001)(8936002)(54906003)(86362001)(6486002)(26005)(110136005)(186003)(5660300002)(66556008)(66476007)(6666004)(316002)(956004)(16526019)(66946007)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?rSXke6Kp7nSsWm96lgj2MSU/MS5lBTJ9Xu2MzXGiPxljyMun9DgiETALr6t+?= =?us-ascii?Q?zYG5wnLsOHbggf+zYwKKRCCPbtqKpBtUBnJjDRN7AgmR3DuSoN521+ugCkui?= =?us-ascii?Q?SmXSmXkejTWfTSxM28mf+rYINAFJYIzE6eUQOLEc6AzcoqJD6pTaQh/zRysr?= =?us-ascii?Q?eOogLZyJ7Blg2wIxSKWeQmYvNib3hJbOHYUMwPprkTffM5vCM5TYp//Q984Z?= =?us-ascii?Q?Eb0qyZoxi7caFv1sxSaJ26riVcGtV+NkONCBRaxruDFhA9iJGvKqJd6Oc5nd?= =?us-ascii?Q?J86gEYQVmi9X9XsFk13u8yCBKIY53Bc9tEpG8eHEqVuoKDsboMGReCIxdIa9?= =?us-ascii?Q?e5xxkB2ds0vs0wvlyyyt6oV+lyb17Ugn3eV7xNRqA9FbS6ObmMmk/zlwm4Z9?= =?us-ascii?Q?nPnrYeesYVlx9cH5WZpzRChszF+eHTRIUc3Q4eA8e4fMTlETcG5V0OQN1qOi?= =?us-ascii?Q?2A+KidOTdJ/Ii9EySo4h4GiDopgbN7u26WjXHGKnmHpw/eiJKOBRywmKM/nk?= =?us-ascii?Q?MO8BlfeQik5J3PaANhtcdWOlN7S5+L0K1v/183jW4fZIhD/t7l40JUmnnp6A?= =?us-ascii?Q?lM8PLZ7e+9hLFJFYL6MGYO1ppKCxEn+KLmOwEwmVKBzea1exVTgAbATCQAIf?= =?us-ascii?Q?tX5CDvV6nen8V2OYz1Pwr7UcFLMYUdG8sdyY6HByfYqn5tSVl46yEJoBWWXq?= =?us-ascii?Q?PHXoLSVW6eWNK/vDrdTh9o+ieFUwLRG57LXodSSHs4kOzfNNhhX3cr6kx5fA?= =?us-ascii?Q?+0Ps5AuYu6gdC06qnunISnHY+Hyn+r3HnO/eDiHVPkd5Q7Ydac2uHd8KDX8L?= =?us-ascii?Q?YuxMT/u5rq3nl+fze4wEZEqOXwwC1b/68Y6dyHKTKuii5z6+kU5YuSmzyOcv?= =?us-ascii?Q?CuLWhj+yAz6udbjjhYBblBkTJ4TiVsFZzkSiOzT1+lc/4eC7EFbxIQUFjt0u?= =?us-ascii?Q?nTCSCzOr0C3yQz0VSLpB6CnhxxaxBPb+wDwf4BIT8IUq2RwIJ7jr7AYO67wu?= =?us-ascii?Q?NosFtU59VZZeAMy98Lf9L5FiPZfbJbCY2kffLzCmd2syPRSU2NbPEDsR4NCR?= =?us-ascii?Q?P4lTmEhruKTKECp+2cxe2CBpjYZs4b+uahdyviXxGXt/ktkiyWiB+8YFLTpe?= =?us-ascii?Q?eAtL5nPXBwiMFzQtlgG74v2OwHoZmBsvFyLhqL90rXu1e9aeNNXb9SkI2H4Y?= =?us-ascii?Q?FToHDGji5j8kd6p2cv4CnD47j8PUgrxiITISfb9Yh9jbkmHrxKteCZTBnzij?= =?us-ascii?Q?jC/qaW0lE+uChHh8iZpaBI+9Diq1/Q1fFRCtpPRktnEwUWjUfVJ04vzCr4Wm?= =?us-ascii?Q?N6TXYPuuSWnx9ha7yWZUK6D4?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a0fc304-d6e0-44f4-2917-08d8e78bf650 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB4719.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 08:25:59.3533 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hM2pISbl4Q4mCaAS1XdCRcqbG8qDTYG5Ba9gQ0jfVGLD4f+Eo11Sy7VPCvDJPVrCTtImUZn3zhMsGjy9VHDb9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4368 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The PSP TEE device driver polls the command status variable every 5ms to check for command completion. Reduce this time to 1ms so that there is an improvement in driver response time to clients which submit TEE commands. Reviewed-by: Devaraj Rangasamy Signed-off-by: Rijo Thomas --- drivers/crypto/ccp/tee-dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/tee-dev.c b/drivers/crypto/ccp/tee-dev.c index 5e697a90ea7f..910b71df2aef 100644 --- a/drivers/crypto/ccp/tee-dev.c +++ b/drivers/crypto/ccp/tee-dev.c @@ -5,7 +5,7 @@ * Author: Rijo Thomas * Author: Devaraj Rangasamy * - * Copyright 2019 Advanced Micro Devices, Inc. + * Copyright (C) 2019,2021 Advanced Micro Devices, Inc. */ #include @@ -309,14 +309,14 @@ static int tee_wait_cmd_completion(struct psp_tee_device *tee, struct tee_ring_cmd *resp, unsigned int timeout) { - /* ~5ms sleep per loop => nloop = timeout * 200 */ - int nloop = timeout * 200; + /* ~1ms sleep per loop => nloop = timeout * 1000 */ + int nloop = timeout * 1000; while (--nloop) { if (resp->cmd_state == TEE_CMD_STATE_COMPLETED) return 0; - usleep_range(5000, 5100); + usleep_range(1000, 1100); } dev_err(tee->dev, "tee: command 0x%x timed out, disabling PSP\n", -- 2.17.1