Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2203899iof; Tue, 7 Jun 2022 23:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGsRE+tK0j+ghLCGybIZQWmVqFqnRIX+EhVnQ1+bK4JHYGIVSFOB51pkB0toSJb9z0kgQo X-Received: by 2002:a17:902:ab05:b0:164:21:6802 with SMTP id ik5-20020a170902ab0500b0016400216802mr32270209plb.56.1654668439002; Tue, 07 Jun 2022 23:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668438; cv=none; d=google.com; s=arc-20160816; b=QdwSVhAbbEjobeqn3VB55h5pib4AmmWmfmbmxF3Y1oy93y2b9CNsDsv+pfPzE18+F/ OWuENYhpFa+G46ElPWtdzV3Ux0SJfjgvCz9cuxXsi0Smy+NDQUMZt0LvX7e+Q7w8Wlkv i2rBOGziWKZDqdQjKcueXEQuHU2hHis+3y/RdJudK6NVvmg3CNONa0bnfWefJelINpjV 06pRohx/O3/P3AbRF9qW6RXXM0YC/Vrh7GPkUGYLs8ts681T+5NSg5CjrpoPg4oo4ZU+ S/X6a68pfz5anUMY/h9FK1E29k+7U+pozBLO4hoK8/xpq+NS73v8Y2IDKtHYjpoX42El 5OjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XLAy4XXRZQ1eSnWUjuuh7WXKCwnquLpWbT8to7zHFbU=; b=HjF/qM7KPDdfAzmh1iFc3+c1O80jKBAa+UvA5nk0i1vYH9n5Q+TxfBoZgk1d/KHY+I skVbM/kmli11MHhhTdfoBk6rrS/YkKqsirwMlKMQgO8L4Txu2T8BfYgG1g5hvlZiraxl 9TGfZbyM0OYduJCiNd4meWS2UxxXfkk/AoVlNc24MpvzbHPqdvviXiCkT8QopYcH5Ame QaJgsLGGYpV24dZZMd70hxKrbktuJpkWhlGCZr0H0sIuTW2cAfoasWhLivVdAyFyx+St X3r5IiKDFPzlXmM/88csm2SpfRvxIniOG9tGafvigICCNrjAEu5g0z/BpsruNkEPX9ne FpkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lhR0FUnO; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h63-20020a638342000000b003fe29d0c24esi1956639pge.344.2022.06.07.23.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:07:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lhR0FUnO; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A31C71E8125; Tue, 7 Jun 2022 22:30:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445018AbiFHBIp (ORCPT + 99 others); Tue, 7 Jun 2022 21:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383274AbiFGVxA (ORCPT ); Tue, 7 Jun 2022 17:53:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABF262431AB; Tue, 7 Jun 2022 12:11:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E9B24B823AF; Tue, 7 Jun 2022 19:10:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55636C385A2; Tue, 7 Jun 2022 19:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629058; bh=Dj50xF/Cx05yHTw1UmRpKXoSA61hVVmCLVX9Gzhm0fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lhR0FUnOmPSjIikivBuIWgoUhtO8bsS7w27PfxC7MJSM99GkOqyxFT1kmmkMxbE8g Zgev/R3JeTUr1JT0PRsn/t8TpE6b8mI6ZUVYcNJ/sCN2x7ZNvZ7SM99DdQ52+HiMTK Q1tXZvpmAYEGNHqUfSc6YcmpowaNe1OSVJ+L4uRg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Giovanni Cabiddu , Marco Chiappero , Herbert Xu , Sasha Levin Subject: [PATCH 5.18 555/879] crypto: qat - set CIPHER capability for DH895XCC Date: Tue, 7 Jun 2022 19:01:13 +0200 Message-Id: <20220607165018.975643273@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Giovanni Cabiddu [ Upstream commit 6a23804cb8bcb85c6998bf193d94d4036db26f51 ] Set the CIPHER capability for QAT DH895XCC devices if the hardware supports it. This is done if both the CIPHER and the AUTHENTICATION engines are available on the device. Fixes: ad1332aa67ec ("crypto: qat - add support for capability detection") Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- .../crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c b/drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c index 1e7bed8b011f..8a526badf5bf 100644 --- a/drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c +++ b/drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c @@ -60,17 +60,23 @@ static u32 get_accel_cap(struct adf_accel_dev *accel_dev) capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + ICP_ACCEL_CAPABILITIES_AUTHENTICATION | + ICP_ACCEL_CAPABILITIES_CIPHER; /* Read accelerator capabilities mask */ pci_read_config_dword(pdev, ADF_DEVICE_LEGFUSE_OFFSET, &legfuses); - if (legfuses & ICP_ACCEL_MASK_CIPHER_SLICE) + /* A set bit in legfuses means the feature is OFF in this SKU */ + if (legfuses & ICP_ACCEL_MASK_CIPHER_SLICE) { capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; + capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + } if (legfuses & ICP_ACCEL_MASK_PKE_SLICE) capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; - if (legfuses & ICP_ACCEL_MASK_AUTH_SLICE) + if (legfuses & ICP_ACCEL_MASK_AUTH_SLICE) { capabilities &= ~ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + } if (legfuses & ICP_ACCEL_MASK_COMPRESS_SLICE) capabilities &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; -- 2.35.1