From patchwork Wed Mar 29 22:07:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13193265 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A025C74A5B for ; Wed, 29 Mar 2023 22:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbjC2WIS (ORCPT ); Wed, 29 Mar 2023 18:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjC2WIO (ORCPT ); Wed, 29 Mar 2023 18:08:14 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 409C34EF1; Wed, 29 Mar 2023 15:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AkPR/txEHV4YtcO/t0spduZBlKyE2T00MZuGGkSsEme/L44Ln4qo3RjPv14KYSFecNpY8qEg8FgbzlhdCMKx1EsKgMvwpX/rW0gLse9eQspFUg5rqqwDdZV4zw3e6PHXlzI0dx7Z8V3VvA3fZaKtBx6ktJzwN+2hvR/86a7rckCzvWLmQHVRojCCNzdxQpTPLvLmHNVGoAlRE8cfYP7MPB3CwNDmt1gQfveiQUYtLepuiCtWDwloeHOsWWHMyyx3aJzLWkQ9bbchL3YGz7ndCTUsCJosQcM1Pb/0W+2ZNttDFrxpRdiFZXkuAc8u+EIPIKv9mCFE0AJiJD4vdu6HrA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j6S8dkR5yo43HwTojP4Wgu6lcLkIeRpN6JtWy1saf/E=; b=m6g6mKiYSvDcEcSEvrflpS4i+znmBxnFiuwr/obRRr5Rbpqddeiy2SOXCJI3kVC6xqpW473W3yKpAuHhOmpF/zStFnbrKH2eRNJaU4EbsIimGKezYZ4TTkwrZyDBXUGYqgygzuvCCh4pLzFjl2A4Lu571eazYFk+frj6rzEadhRLhDLapeoHwo4GoYPxSwCwDQhlfstJpwDq/dy30UmRlbk/Fs+sxPzyze6kK8hoXhX1FEvpuC3LjMxCqLnn5meZ3FdAD6xuSqcdEaBaJ1YuTA9MHtRoQ2MtqY7FVu+5eXBs/IQ6JPfkFyxLNSwcXYktJIZPnJfEC0WPGxEm3z+4zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=semihalf.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=j6S8dkR5yo43HwTojP4Wgu6lcLkIeRpN6JtWy1saf/E=; b=NVe9KmWkH2W566Y25imaxssLeR2DWa4bMd5ml2/vnmuoCRD5FLiDhgAL+DrYLC4vjzaS2U87NlKB4Mfphq24C65f8/0dSUWSsXWtMONco20AWhvXNxnnwWazuD5o+0fS5gXxrcElt5sRrNOXKsohet5cnW+A/0tgAa0wMi9quOA= Received: from BL0PR05CA0012.namprd05.prod.outlook.com (2603:10b6:208:91::22) by SA3PR12MB8021.namprd12.prod.outlook.com (2603:10b6:806:305::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.30; Wed, 29 Mar 2023 22:08:09 +0000 Received: from BL02EPF000145B8.namprd05.prod.outlook.com (2603:10b6:208:91:cafe::d9) by BL0PR05CA0012.outlook.office365.com (2603:10b6:208:91::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.18 via Frontend Transport; Wed, 29 Mar 2023 22:08:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000145B8.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.35 via Frontend Transport; Wed, 29 Mar 2023 22:08:08 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 29 Mar 2023 17:08:07 -0500 From: Mario Limonciello To: =?utf-8?b?SmFuIETEhWJyb8Wb?= , Grzegorz Bernacki , Mark Hasemeyer , Tom Lendacky , John Allen CC: Felix Held , Mario Limonciello , Herbert Xu , "David S. Miller" , , Subject: [PATCH v7 1/6] crypto: ccp: Drop extra doorbell checks Date: Wed, 29 Mar 2023 17:07:47 -0500 Message-ID: <20230329220753.7741-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230329220753.7741-1-mario.limonciello@amd.com> References: <20230329220753.7741-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145B8:EE_|SA3PR12MB8021:EE_ X-MS-Office365-Filtering-Correlation-Id: 33aa128f-6bfc-4714-6190-08db30a21471 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hsD29L+sqWPnQgfAkkffKqpjH8S8CEQt8xpUotb4Qxy4iF0yzXWceXAkF4OryJfvCmelxWmjMxGftA5yRjR5s0VCpzUzsKvswjyJJPHrf0lvgpRm5xzb2jUKOD8yTcvu0/4HjK3Zb5YeHKM1+RIzzaZy3PNAjt5q63PcqDv+8q8CSxMSF2fAZWOpRkLsyJmDpiAq3Q+UADKhXpU+MCVH13ziytLqD6XQF7jljXx7GvbDPnJqP5DmEc6H5aAIszG6JG5/GzSyVN5w3gw00IxyXh5OuJLA2lcXxSh51RnWyIfNg7e19SwxP9aiEzsrXsZEoELhEo1SDX+TvJnmNutysOQMjgcz6lv2gJhzoKdfj2hvJ37GL/WWpprsk/Wq8Ly8lTU8OUr6eTNINyH8CO3UTx1wLXyqBWBh55z2PiujoU59abVoUMz7k+hIAtS39uCVj3Y4BfVnB0auFFf7CnXOs/gw9cgYWdx+GLtwxLUAj3KShI+mEafBspU+ZHAowaA4IGD+Kw++wnV2ackSLBMwyMLShpfASxrGCobJ09bdw1nVg38jIuhy+Am7KCYI/3EolxMxSA+jp8sKZghJRY8qS4DXy9BEZNkG+64SUpIsYndG1cFEBsaWrmBKOmYULeetxCtzK/SoHNh46mOfjTkDAaTMgmAoTVsfW0CjAR+wUKki+LNkv0WODRatodrq/kg3gnExragL1JslNKLydmLjV50/DqOZj5FeGOHKJXJn8kc= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(47076005)(26005)(54906003)(1076003)(316002)(6666004)(6636002)(110136005)(16526019)(4326008)(8676002)(186003)(70586007)(70206006)(478600001)(36860700001)(82740400003)(5660300002)(44832011)(356005)(40460700003)(2906002)(36756003)(83380400001)(336012)(81166007)(426003)(2616005)(7696005)(41300700001)(86362001)(8936002)(40480700001)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 22:08:08.8399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33aa128f-6bfc-4714-6190-08db30a21471 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8021 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 Signed-off-by: Mario Limonciello Reviewed-by: Mark Hasemeyer --- v6->v7: * new patch --- drivers/crypto/ccp/platform-access.c | 20 -------------------- 1 file changed, 20 deletions(-) base-commit: 9117e682b8b79f7b5e2517fd28d42757d3e8b860 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; From patchwork Wed Mar 29 22:07:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13193266 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A033C761A6 for ; Wed, 29 Mar 2023 22:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbjC2WIT (ORCPT ); Wed, 29 Mar 2023 18:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbjC2WIP (ORCPT ); Wed, 29 Mar 2023 18:08:15 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768E35261; Wed, 29 Mar 2023 15:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KkuBJ4a8doPMnN9eowtGUeGNEDv5el/994JnKzM2dl7+9kYN9M02PRerlc/yxHSB2dCzpPbEwywujDg5wx1hiq9SxZ29ofXFIUOlFPT0Kj/nvlQPuAAMg+Nni9R45LaHnkN7A/ZeHo7qOK++vfXUs3EwgIQEkT5ANQ9WK+VhnTQCtwlhXpfC3arOZchJTj+CU9ZhID2nblsWpXh6Dx+KLABCo7LniboKb1FG4wsZm1I5r4iwjN+xK6wUxbmJBv3k4+na3z4WwalKiLvJVHZM+BIkdMc9kx1y/a1CzO3HYIO6j5tcxBivGvwuHJv8BLZymhKECkLT24bIjtaQhMISAA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=79c986qYawMONEy/n+79MJWvRvPZsX/YX6MoywBH1Nw=; b=bMpvnhWW5W3a9t+7fy9UVwkqRofIOlLhZRKNVpx8MDMC2a9VLOBFn8uLtsK/vhpumvnxSYBU1C3ufhbejMgfHK9QJ8yG9lgp4Nvs5mwLBZRubd8h5msjGdYhxMZFNFKFGh6vubiPx3DImla7IUP0JzHIMIFRgsrYemrVzhuGcXWSay4nVYv651bAus0sAYzteaaftvxWNi83aYY84b+lTVib0xX7fmiLlW82rRC8qlEDnFtl7BO5ev0y+WTAGmc7jMWit8ClhBQLMoNmkjmE3AAu2+RSP0ow5MOWmxOfNOoTN+n6/gu1zRKD/bDUgvUPsc6TleU6057oMEQHWv/g3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=semihalf.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=79c986qYawMONEy/n+79MJWvRvPZsX/YX6MoywBH1Nw=; b=ICaJFK0ZOALVWfYtpLBjBYmK8/IUSU8ufBsbJ4MtBQFjbpLD87JV8aEpGQkEQSbTC/KK4gjWXggVY/lSAh+aOTfqS48KRovEfuZGMxPLc3Rp/51tAzFTszz00J3rOhaRqYHq0ir9DhZyHWb/JcJaoaIIPXTCpK/H9ON5+hyLaxI= Received: from BL0PR05CA0029.namprd05.prod.outlook.com (2603:10b6:208:91::39) by MW6PR12MB8957.namprd12.prod.outlook.com (2603:10b6:303:23a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Wed, 29 Mar 2023 22:08:10 +0000 Received: from BL02EPF000145B8.namprd05.prod.outlook.com (2603:10b6:208:91:cafe::88) by BL0PR05CA0029.outlook.office365.com (2603:10b6:208:91::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 22:08:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000145B8.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.35 via Frontend Transport; Wed, 29 Mar 2023 22:08:10 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 29 Mar 2023 17:08:08 -0500 From: Mario Limonciello To: =?utf-8?b?SmFuIETEhWJyb8Wb?= , Grzegorz Bernacki , Mark Hasemeyer , Tom Lendacky , John Allen CC: Felix Held , Mario Limonciello , Herbert Xu , "David S. Miller" , , Subject: [PATCH v7 2/6] crypto: ccp: Bump up doorbell debug message to error Date: Wed, 29 Mar 2023 17:07:48 -0500 Message-ID: <20230329220753.7741-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230329220753.7741-1-mario.limonciello@amd.com> References: <20230329220753.7741-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145B8:EE_|MW6PR12MB8957:EE_ X-MS-Office365-Filtering-Correlation-Id: 56ede810-57d7-47c4-579f-08db30a2154a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gsgqF/6JzC0u05+eDDpZTBbjKZYHhuDBGo5iXZQtksL5m4CAixltT8WW6ZBL/2A6JmtjUtEFliqToYrUwsVK14nK4nI8W9hh7XaI9nVF2dYhuUd73e5rl2u5rqIMyw0r7SiD+pAXvqWu80uZ0CO8rlG9SSnziBcdG0cT1xeELTVn/khlny+XWzBAY4RnLaUN8pO8FdTCpFb1m+9eduDvV8CXedTyROw5m8LLBmY0KVbAGu6BD/aOlSY8C7bH44pPSbeFKpcImVhZVIWvjik8ajDU3MjBJZ6xfc10Nb79r3+myWUSKyyI5ZZYsbcVaivAYcsrGQb/ua+OU7P9fPW2XY4OpRXqLz4W6jVjzzAD5yqlvWhn/GwnJkdAhRQvnOqKpVCJHZSVmeBPOmZ2/8XFtmECXX4+lkf0IFVPAydfKe4TOm/eOmhbKfTkmQfRds4xKwHz71OtISRmgdV/2S+foBeOJjA7pxi2m/T6MU5xjUHGpfBmC+DBkhWdPlfJcpEo1ue5aEj3lzeq+DSoxZf/UUf+H5suslItYKeBsO73IaBNen9Nk06A5XgwTTarHAROHO2+Fd47W+HgNQUUekXuwmzwRMmHnxT/Af2SBP6E+qLb8ruWIH27jB+3MvddgntKWK3omuE7yn+XQKaeM8LSSHQuDzWsohgdbk/RyGmdbhh1xwc+0Irn3vYEeiiZOSuZJAGy5MTuleQQ3crgISaRt9sXWFlUGeKU5f6pCdsix40= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(83380400001)(81166007)(6666004)(26005)(356005)(1076003)(478600001)(7696005)(54906003)(316002)(110136005)(6636002)(8676002)(70206006)(70586007)(82740400003)(4326008)(36756003)(40480700001)(41300700001)(86362001)(82310400005)(36860700001)(4744005)(2616005)(5660300002)(47076005)(336012)(2906002)(44832011)(8936002)(40460700003)(426003)(16526019)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 22:08:10.2773 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56ede810-57d7-47c4-579f-08db30a2154a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8957 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This is helpful not just for debugging problems, but also for investigating captured logs later on. Suggested-by: Grzegorz Bernacki Signed-off-by: Mario Limonciello --- drivers/crypto/ccp/platform-access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c index 1ad3a0a512b1..1cc154a1c6ab 100644 --- a/drivers/crypto/ccp/platform-access.c +++ b/drivers/crypto/ccp/platform-access.c @@ -149,7 +149,7 @@ int psp_ring_platform_doorbell(int msg) mutex_lock(&pa_dev->doorbell_mutex); if (wait_cmd(cmd)) { - dev_dbg(psp->dev, "doorbell command not done processing\n"); + dev_err(psp->dev, "doorbell command not done processing\n"); ret = -EBUSY; goto unlock; } From patchwork Wed Mar 29 22:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13193267 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0C28C74A5B for ; Wed, 29 Mar 2023 22:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbjC2WIV (ORCPT ); Wed, 29 Mar 2023 18:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbjC2WIR (ORCPT ); Wed, 29 Mar 2023 18:08:17 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF4B544A9; Wed, 29 Mar 2023 15:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eQvoCchOsMFYyWdg5te7V+aGD7LgWtTLgeQGwSJrai8bD1yfGmRK3epC+/mEn+GSREgx1PReDCyeWVEMRk0JNDXxbLIzNsw47tiqE7vfJGDf76l1RbL4tk09eGXtoPML4KhFjSy3V/emueC4Km3c9N57KM8Mrw1EZFlvbswhlFizfsu5yApPBa3/GyfcWtH0mmrjPjAUVCa8SVi61dPbueH/srei6jAHk42H8bv1X79Mv67ILWZc/LVt3RJLjtrhmsmYeZ0JIZ1jtn5X4rcXl3Zpph5RuKboa1p5uJjIkdon7pvYORi4IZgfoZWi7I2MBkhOS7W1p0bNKV8NYQG2aA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Pyce0r//rglaJiecWUtG9Mej/HjSG5a0OqBICjtYQqU=; b=VDyNiNTnfRDBSDjgaIMEadnReVLo2vHzTWcmeUXo4G3B+C+j9tkEkpjqFLBjs5QM/BqKI+r+S+NcohW/v7vdODX0OZJtW+GOjImwIcRBvaRfBBnYigBLK6hs9n66+dxCnD3tGCZt+9QTtgRw83pGdqR+NGHJy9tyMlXu2gC7Zluw0mGN4eB3xDJXYkPsp1v8Cy7Fsi90Px9FEqlYoQoefqA8Z1KHFQYLOz1dLJbLrk7We8gbLAPQNPgDOgY0+8FGjdr7od/Ej+3/t1Pb1EQpe8Fi5tARvx+3SAod6VnxtIqOPDP7Gek1s5ObfP7ji1JOuWgGdAZ/zVrx/sno0KcB4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=semihalf.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=Pyce0r//rglaJiecWUtG9Mej/HjSG5a0OqBICjtYQqU=; b=WIx/WBS8nORVB54X5Ka+KMYgqP7WjYzedejK6UvoLgzPMOr7KZlih00R9OE48i+6wMEpdn480+o7+pdgrICIBr/0vWmGRQPAk54E2DbYqJqEWZptApwBsE8wxvPJE8Q5CKt7VmLwbJlWV09FhwFlITUSVWKkXteVTqAayGc7Ges= Received: from BL0PR05CA0014.namprd05.prod.outlook.com (2603:10b6:208:91::24) by MW4PR12MB6874.namprd12.prod.outlook.com (2603:10b6:303:20b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.41; Wed, 29 Mar 2023 22:08:12 +0000 Received: from BL02EPF000145B8.namprd05.prod.outlook.com (2603:10b6:208:91:cafe::a8) by BL0PR05CA0014.outlook.office365.com (2603:10b6:208:91::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 22:08:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000145B8.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.35 via Frontend Transport; Wed, 29 Mar 2023 22:08:11 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 29 Mar 2023 17:08:10 -0500 From: Mario Limonciello To: =?utf-8?b?SmFuIETEhWJyb8Wb?= , Grzegorz Bernacki , Mark Hasemeyer , Tom Lendacky , John Allen CC: Felix Held , Mario Limonciello , Herbert Xu , "David S. Miller" , , Subject: [PATCH v7 3/6] crypto: ccp: Return doorbell status code as an argument Date: Wed, 29 Mar 2023 17:07:49 -0500 Message-ID: <20230329220753.7741-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230329220753.7741-1-mario.limonciello@amd.com> References: <20230329220753.7741-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145B8:EE_|MW4PR12MB6874:EE_ X-MS-Office365-Filtering-Correlation-Id: a76c2cab-f538-4a18-1158-08db30a21647 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xwnc+by7nHBBQYEc35KKd2yph7s9TK6mA/2d6mzqWv5QdW9ZL16wrLNH2ZXOPwEUKWjd/fkiZRxirKbhUcJpfheXbPczpOpr4MfH2+ipdMEmzUMSX9gUMbQzbuPDF7B29o2H3Q/oh0lHwCARLspgzcx7eRxF2AT6/h+/lJz3trHGyeItHg1MNNoI+G9JMERcl7CMEiQCeKeba9DuxlLzACYJfnWy6Wi1+aDt8DhMTHqZhkapevAhcUm3Gx95Kfp3Ob+v/GEq25OSKTap1rAHjmO6ycUDyOOJysHUdghSChKGJ4tnAGjYg7UBb1ekyvYevtkfLyMJrFsEB8duZIR7alaCudiUhNwjYYnsJjTWolv/sZv3Uwj0VOs8l/OPNT/LA6EvCiGXnllVDJWDB9QsYGWynhNt8T9+TuRE91tbGyRJ8AZThzBTsLxK8xT485bb0t285VPjnWVP1N79hZQ1W4CkSHteh3pOeTIDPyH8zZqMA2Z/5qVvq8af0JDWi8/Svz4V84dvSRJTaIO2AKHo4EoOV2iReBKyfW6+F5be0pQiWr7xp3CIQBwSybI11NQw4Cq2YdItmYbgqHG5yhp+O25ti4vv5Sbu2SHkZMLb82M0BmerKdVumZ5A2Md53BRWpZo/oZ5h5RBc2f6+YDIugqlpqLH9Y5r3M0+3cVJD9CHG7TfvLbh+aOEN7rssHGbEpWCJ2EXEr9OLc8ubpY559v0g78o55hHHptMRXOJ2vwHSmqzdSAYjOVr4OcLA+DeyWE4sC0gHR6syspoDBn7w1Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199021)(46966006)(36840700001)(40470700004)(336012)(316002)(426003)(8936002)(82740400003)(36860700001)(81166007)(6636002)(54906003)(41300700001)(2906002)(110136005)(356005)(4326008)(44832011)(8676002)(478600001)(70206006)(5660300002)(70586007)(2616005)(47076005)(40460700003)(7696005)(86362001)(40480700001)(83380400001)(16526019)(82310400005)(186003)(26005)(36756003)(6666004)(1076003)(36900700001)(134885004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 22:08:11.9179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a76c2cab-f538-4a18-1158-08db30a21647 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6874 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org If the doorbell failed to ring we return -EIO, but the caller can't determine why it failed. Pass the reason for the failure in an argument for caller to investigate. Suggested-by: Mark Hasemeyer Signed-off-by: Mario Limonciello Reviewed-by: Mark Hasemeyer --- v5->v6: * New patch --- drivers/crypto/ccp/platform-access.c | 4 +++- include/linux/psp-platform-access.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c index 1cc154a1c6ab..48f59ae91692 100644 --- a/drivers/crypto/ccp/platform-access.c +++ b/drivers/crypto/ccp/platform-access.c @@ -132,7 +132,7 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg, } EXPORT_SYMBOL_GPL(psp_send_platform_access_msg); -int psp_ring_platform_doorbell(int msg) +int psp_ring_platform_doorbell(int msg, u32 *result) { struct psp_device *psp = psp_get_master_device(); struct psp_platform_access_device *pa_dev; @@ -164,6 +164,8 @@ int psp_ring_platform_doorbell(int msg) val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd)); if (val) { + if (result) + *result = val; ret = -EIO; goto unlock; } diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h index 89df4549fada..1b661341d8f3 100644 --- a/include/linux/psp-platform-access.h +++ b/include/linux/psp-platform-access.h @@ -45,9 +45,9 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_reques * -%EBUSY: mailbox in recovery or in use * -%ENODEV: driver not bound with PSP device * -%ETIMEDOUT: request timed out - * -%EIO: unknown error (see kernel log) + * -%EIO: error will be stored in result argument */ -int psp_ring_platform_doorbell(int msg); +int psp_ring_platform_doorbell(int msg, u32 *result); /** * psp_check_platform_access_status() - Checks whether platform features is ready From patchwork Wed Mar 29 22:07:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13193268 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82BCDC6FD18 for ; Wed, 29 Mar 2023 22:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbjC2WIi (ORCPT ); Wed, 29 Mar 2023 18:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbjC2WIX (ORCPT ); Wed, 29 Mar 2023 18:08:23 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::61c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A9B59EA; Wed, 29 Mar 2023 15:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H95SScFr43YwYz0z75iWO/WwpsxufzjXHxWC1VWCb58ZPt7qgtyY+8OwThQSa9gBXZXWwvhV++F3pDXVGFk0X14coxX51N3yEMtJjPw0ZqofC5yP0XtyN46nqqwp7y+FmORuf5SdWQoc+Bz+Ymzkahe+1ZOrTqsI1VVwZifRyKJZUsoKPwRIErJifF9Y5k4eiTtd0gIPtzMQPTpKnp4CJeZPPS+nPPuhQ5u9ArR2suzCOka4ZVIzOkpidSRi02HqPHVPCldMOhxxK3YRhGLuT25xH2XmWq+QGUpqDCC5dM21OMPwz3mqIWYg2bHNsRxCyFyJwfFVybMxNLFgaSqDDg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P+HdtTlqcWh7FIQLWrBY2CuhY6pHNZaIQyhdrTIReRU=; b=VdK5n2qdjWqsNCgmcMDv2z59vVpPuQnGtMc2GGpyNweNQapy3NEx8TEL3lywNp86QtGFnS7tX4G0OPhxt3AcU2/cOZ54jrJ6E25JhOe2GRsRW8o748UYgD8krxZ9ZV4RPRyKgrAOy/IPIPHrT8vaTioFl0OXE9WCwEbzTIhFKM3kctaio/cKiQGKzNgk4ZKWxUG4IXYiIIgwwm57Fwa1ANI3Rx/H4qiD8aFmGZwSnJTSHiPndYTJtVR+fOOuAuqe4VZkn+jK8HF9QgE6QTWHhAhaYw3YBowei9Y21BGSWgpWFhegdbknDdvSE8K1CxlfLKDLeIpJA/LLm1gd/xLfKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=semihalf.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=P+HdtTlqcWh7FIQLWrBY2CuhY6pHNZaIQyhdrTIReRU=; b=uYC+eIg2l/pDmeFeen04LMNQsrda21OjqI/FG3PNvRNc5a91VzlUz7TGITQ78Gzhho2PXpLKhPh4UojiA0mWBsk2f5nc9ZyVx7HKzraTF2Zz+QMHhiShRmiyL0plyW/t2Zkp/b+s/tsCNE1S8d/Dt3ZAVu+ugsXYBqUAoj8puDQ= Received: from BLAPR03CA0047.namprd03.prod.outlook.com (2603:10b6:208:32d::22) by PH8PR12MB7327.namprd12.prod.outlook.com (2603:10b6:510:215::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Wed, 29 Mar 2023 22:08:14 +0000 Received: from BL02EPF000145BB.namprd05.prod.outlook.com (2603:10b6:208:32d:cafe::82) by BLAPR03CA0047.outlook.office365.com (2603:10b6:208:32d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.43 via Frontend Transport; Wed, 29 Mar 2023 22:08:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000145BB.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.35 via Frontend Transport; Wed, 29 Mar 2023 22:08:13 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 29 Mar 2023 17:08:12 -0500 From: Mario Limonciello To: =?utf-8?b?SmFuIETEhWJyb8Wb?= , Grzegorz Bernacki , Mark Hasemeyer , Tom Lendacky , John Allen CC: Felix Held , Mario Limonciello , Herbert Xu , "David S. Miller" , , Subject: [PATCH v7 4/6] crypto: ccp: Use lower 8 bytes to communicate with doorbell command register Date: Wed, 29 Mar 2023 17:07:50 -0500 Message-ID: <20230329220753.7741-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230329220753.7741-1-mario.limonciello@amd.com> References: <20230329220753.7741-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145BB:EE_|PH8PR12MB7327:EE_ X-MS-Office365-Filtering-Correlation-Id: a3cb9ffd-f4c7-413f-386c-08db30a21746 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aB41bz+VDeZk6ixZA0ON8AQHvZAkKOqwBeF4UB6I8kTJ9cIdP+AhTKK95UmPNw3S8T8KiJeTW/nMTS7KuT4ZyQtPQAhqXIM62bnK7z/f6bitzIRSn0G/2LC7PQDRgEeuSuNgAEGz0MEJJGifdQ4iYqo9KjBHeRPJPadFcCxJZ4OnBnPb+aT0Pk2TsuNJ2I463SHX5YeWM44w1GRtHZV8lPM/2qkikUWa1b8Jl+E9bS6aPCsX/PcraDy/TH12f9ejDl9tQH9w0/TTcutlqTQiljMVEhxqdKqDccYxIt4JoTLdqz4/vM8bNl1nPRMRrMNsecEojyyI304McATzIO8ZbmNQRLUnwDuKCPYTqC7xwky5ALSAPpOj2LMqtdWb2oAX3iLkt9ZaPeMvDHkcxZe3bLepEqWoMqJCz+Dzz5rNsOdyz2MWFL1n00wLasvS1RT0lVAYbivT7Op8i3b29laJ8yGyBrYJN9NtLKn6xkzOhN7MMJEVx24TSmqKTOtDUzZi58MLCr5ektEGPDAofbHUYZS3HApJdyHHp4oKwHZOjUjtCjv6ZVah4Mn07cqzkRexW0yj3Tw4Mehhu1YL0FAyOxQN8A1lVo5C+hh7zdwr+K9AJTU70WdwqEgaZ344g4pGgB3Dy6wHihqj/4wskKl9fwXETBKL9i+UhMw++WEPx/KZFfx6iHBhGnI7dbVmihE2YeCd6FCIKOWW8xw8PcyLmUOUk8IQg7bv0Np0MGDcbGk= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(6666004)(7696005)(26005)(1076003)(478600001)(110136005)(316002)(54906003)(6636002)(186003)(16526019)(36860700001)(47076005)(70586007)(336012)(70206006)(83380400001)(8676002)(2616005)(4326008)(41300700001)(8936002)(81166007)(426003)(356005)(5660300002)(2906002)(44832011)(40460700003)(82740400003)(86362001)(40480700001)(82310400005)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 22:08:13.5901 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3cb9ffd-f4c7-413f-386c-08db30a21746 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145BB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7327 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Unlike other command registers used by the PSP, only the lower 8 bytes are used for communication for both command and status of the command. Suggested-by: Mark Hasemeyer Signed-off-by: Mario Limonciello Reviewed-by: Mark Hasemeyer --- v6->v7: * New patch --- drivers/crypto/ccp/platform-access.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c index 48f59ae91692..939c924fc383 100644 --- a/drivers/crypto/ccp/platform-access.c +++ b/drivers/crypto/ccp/platform-access.c @@ -19,6 +19,7 @@ #include "platform-access.h" #define PSP_CMD_TIMEOUT_US (500 * USEC_PER_MSEC) +#define DOORBELL_CMDRESP_STS GENMASK(7, 0) /* Recovery field should be equal 0 to start sending commands */ static int check_recovery(u32 __iomem *cmd) @@ -154,7 +155,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result) goto unlock; } - iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd); + iowrite32(FIELD_PREP(DOORBELL_CMDRESP_STS, msg), cmd); iowrite32(PSP_DRBL_RING, button); if (wait_cmd(cmd)) { @@ -162,7 +163,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result) goto unlock; } - val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd)); + val = FIELD_GET(DOORBELL_CMDRESP_STS, ioread32(cmd)); if (val) { if (result) *result = val;