Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp607462pxx; Mon, 26 Oct 2020 16:42:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrZ3xm22vvZn3HsEBWGxw3fx9GprLNUte1s8cWXgHFKSNqHmS2iWpCmjmGCQRkIenMnlLs X-Received: by 2002:aa7:dac4:: with SMTP id x4mr17821531eds.165.1603755774243; Mon, 26 Oct 2020 16:42:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603755774; cv=pass; d=google.com; s=arc-20160816; b=DKOto+K5ylxTSbdaIh8ChvFfiW4SGcfPvUCFYPu3ebI84Zn2+LM/PXpoF6p6lFQznb aS5BHbYR9v6MLUF2Bj494uSI9IdRSygkgKKV5aQPPGQz4KMRs69Y9CD2tqTj0+14rnzQ eBnv08zQ5jJOuclnFIzHSvXxO0oz+mGLRAIOsRD4wIEJcN46Tt0LsASs9/IHmIGiZx6G nufXl50OSDGsO86XGVh33XDRLxIkj82f1tVWLhFzqBaT7D6d9Lp6HbWsWdDMeVZobVrV x1Dk/9VPCpk9shtWO6L1O/fq7+/zhhoTvN5anqHFX4hhTWMRp6K32GOZLuY4p67lVYjS UQxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=/+gSgOk92mZCrUk0Hc82XMr+r7KFYCfRM6XQXWOyGo4=; b=c+3LPeNlc6A9aMla72MGuuUPKol3uWKArJzr70DwyOd78z6S4TnSI+x1vT07gHG8zB 9vtdx64Zk8qoGhygKbmfpBU6uz9L1QF3yYWIzdO8IPRk3c0qURDlYcxrPcrnOm5r9VAU UzfkwBg9m+QS8+Itj5TPds5hyvZ0wlPY3Wm2fTa3DUu4zT4QKxu6DPLqdOrgNV6jlPFs Js1nig30n0W6seozt+06kkO1dSHiyG5JEpczzSKCMShR9R5VBIkqJIbpfOyKFhaT7jm0 9o6RVNmZdRGs6XN2aCVJpxwLbdHI5nf/8c1j90ErYTCsBX4MrglD5WAoBwqCcKX+7Yqj 0Psw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DZj47V5U; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf17si8713435ejb.226.2020.10.26.16.42.29; Mon, 26 Oct 2020 16:42:54 -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=@nxp.com header.s=selector2 header.b=DZj47V5U; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1782200AbgJZR6L (ORCPT + 99 others); Mon, 26 Oct 2020 13:58:11 -0400 Received: from mail-eopbgr70045.outbound.protection.outlook.com ([40.107.7.45]:7302 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1782050AbgJZR6J (ORCPT ); Mon, 26 Oct 2020 13:58:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c41JdQudqkj3ro37hQ2HxIvMQAQa6uPHkQFVMFHBfJfHpJvbfs+nhE/osjAmT5PGTBsUfUA/6Ik3mzKC5smaM+UjgWPxI3bxVvKNVDr3jhotD/+4hTQ5rvDaN1yXjVy1wXfgwkA4G6pHD0ZCfDx0mn3skxy61yi+YMyMItMfK+/b8J7C7isHxwUVLSyfe/yNr1AfNa4V8o+fD1yp/bOEN+9KvEGW6WtccJ2FIktgePcYSzTGG2g1Hrc1DNRJMAjVhWCSCM+uOxoUYk/2r2mgOnVKH290GWg2VYTnj7uxdVU3A5dxoZPfxBigNJy3vY3uuHxX4adDk/zmpn43uk20Tw== 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=/+gSgOk92mZCrUk0Hc82XMr+r7KFYCfRM6XQXWOyGo4=; b=lnbWNiuUCCjCLwpT+pl4up7X+EcOpN+q8IkDITBidXn6hXqIsuKUs1huUOiwgNu4YTg7jPwGFAJpy0PKVdY+Oi3RLRSUeGA+0t5/D1Oyy0DlnAkgturvG0KY0ljl7mEu+KMqI0qP8AtHroaa2pglhKrwQk8XkYLa/pJWi9VQbd4MQel5UhGt4bAm79BftVBVkrKQ+4HrOPiYtOm39VT7Vwwg4CVl5Pxtq2JtFw5v7Y63TCkudibBLiulP14+wLgi6U1+QHBp9LyVvqXbsPbHWaarhIJajvw6TNnlwUYFm3D0Fle9BylnqWKeN5HQr9ukJAVbuizjeajM2DB7HrV/Vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/+gSgOk92mZCrUk0Hc82XMr+r7KFYCfRM6XQXWOyGo4=; b=DZj47V5UG2FlEm4JIFQ3ShNda5clEKTUBa1DfZthJ5mTR07AlMp6TFCu3bd1bNXTsQtNbNrR8+ASyFLexP7pFYCosoc1BbCtTfr1PdYih8JJa2Wm0ghRogvKphnZcIsvbVEmO30f4pqBh2bL+vzzlZhvQZIBAJmkT8LzpdQl9f0= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4046.eurprd04.prod.outlook.com (2603:10a6:803:4d::29) by VI1PR04MB4895.eurprd04.prod.outlook.com (2603:10a6:803:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Mon, 26 Oct 2020 17:58:03 +0000 Received: from VI1PR04MB4046.eurprd04.prod.outlook.com ([fe80::847a:fcdb:3b92:7a7d]) by VI1PR04MB4046.eurprd04.prod.outlook.com ([fe80::847a:fcdb:3b92:7a7d%5]) with mapi id 15.20.3477.028; Mon, 26 Oct 2020 17:58:03 +0000 Subject: Re: [PATCH] crypto: caam - enable crypto-engine retry mechanism To: Iuliana Prodan , Herbert Xu , Aymen Sghaier Cc: "David S. Miller" , Silvano Di Ninno , Franck Lenormand , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Andrei Botila , Dragos Rosioru References: <1603310810-25307-1-git-send-email-iuliana.prodan@nxp.com> From: =?UTF-8?Q?Horia_Geant=c4=83?= Message-ID: Date: Mon, 26 Oct 2020 19:57:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [78.97.206.147] X-ClientProxiedBy: AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) To VI1PR04MB4046.eurprd04.prod.outlook.com (2603:10a6:803:4d::29) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.129] (78.97.206.147) by AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.28 via Frontend Transport; Mon, 26 Oct 2020 17:58:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ab7c9bd6-1747-4fed-eb9e-08d879d8af23 X-MS-TrafficTypeDiagnostic: VI1PR04MB4895: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /IraOQOfW28QxCwNYvZSujxIBpzEZ5xHZjOShInY4HJ8jKWQozCAJ6f/F7v2wy7TXPgizJdLWVOpUoGZ+CDZsiNkhNEqODmBxP/0c9wF6ckqFRQLQeD7VVXsmU3Wr/oKHSaKzMNvrJw8Lu+nWX1w5Clcl5SvjGJA/bvlDH4pFAUH/JvYEyxE8zFSBSozaXYKnFr0oEpa4OlEvhSJy2j2OuJjIsJ0GARcS5IWyQZ2iqw7mbKVNTodS/H9q9m8gC9vi0SK/EHTDyCKyGN4+HvvMENJ13UJnhyzO6rmGXfwkj2r3td7YXG5/C8Fcagn/ztwhHMN2IBBucAR1I8BMxkwUTz8Mq4jRp1TpdRBOgNjC/+Ge993DI9Rw3bqaK0QCm3a X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(39860400002)(346002)(2616005)(956004)(52116002)(8936002)(5660300002)(6636002)(66556008)(53546011)(2906002)(66476007)(66946007)(186003)(86362001)(26005)(8676002)(16526019)(54906003)(316002)(4326008)(36756003)(16576012)(110136005)(31696002)(6486002)(478600001)(31686004)(4744005)(6666004)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Vy/y686znDzsfYCjJz0geKbc7Zoti7fyWQCnGxY9SwFWuo7hFdr65cEYGj6ZbPVubqMH0Lo0KIUnn8nbvw34QgRUbJLe1dSl/CYvN2q7fbsBWWpVR+9onLMHcpUrQ7x6yT3nGQ4QMl91UA5wII7rLz+lxbG/Moiq/EohPShh/Xigd41dIh2rVu8FqQXAzwzj/funKGp3CUzIqF4iN8bf9fu7fYknWe8yzbp8Z+V1lPV8GSeKp9Zo2Fn6G7K6GC+XUQ4Dfn7Z+EBfnrP3sOY4Lxp+0macPiZXU4WAh0xaVfw/kNQnLxQ2ROdMHG8JnKKmkMpCXgaGZRUvHRvXqV4CnUkw4Hb+llD9mitaIKbwWuwc+dcJyfrgITB6sNXJVZ54EyWKcVhmigJxpzXT7O1pGGG6azKrI+n8VVqn8ZR0Paz038LBRjdyFG1T2rAxMjgzIFLW2vG5q/+boCc675MAkZ9IUD0uv1DRmBvzXEqV21W3vwLq4BwfEcDjjn4zkiVRnqdvOo93eQOFiRGY09kCalDhb2w+Zq+Co3HWLWkNUI1CO3AQgllm+m7HHN+yR2CCFIrIRdvTSyifSFRjwdj1UlMCjv3zwWXytJvA1nZXszzHOTIehs7Yibie6T37W3sIslEgMlcEKE93JKB+vfjydw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab7c9bd6-1747-4fed-eb9e-08d879d8af23 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2020 17:58:03.3487 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S932dMxYZpKuXWN55kQ7wAEjvVwmMR3xWryfqJLi2+U4OZbbFQprpVq7iWHdCqsqrI5UJFsUVP/TUPF2sK1H6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4895 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 10/26/2020 7:11 PM, Iuliana Prodan wrote: > On 10/26/2020 5:36 PM, Horia Geantă wrote: >> On 10/21/2020 11:07 PM, Iuliana Prodan wrote: [...] >>> +#define CRYPTO_ENGINE_MAX_QLEN (2 * (JOBR_DEPTH - THRESHOLD)) >>> + >> What's the logic behind multiplying by 2? > > I added the 2 as the number of Job Rings. > My logic was that crypto-engine is one per CAAM (x no of JRs), while > JOB_DEPTH is per JR. Currently there is one crypto-engine per JR. crypto_engine_alloc_init() is called when caam/jr driver is probing. > I know there are targets with other than 2 JRs. Therefore, is there a > way to get this number automatically? > Most SoCs have CAAM configured with 4 JRs. Of course what's visible to the kernel might be different. Given there's one crypto-engine / JR, determining the number of JRs shouldn't be required. Horia