Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp431631pxt; Thu, 12 Aug 2021 01:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHIiRU5Fqw2TZP4tOS7n9IprN06otl3qWkGoHK/oBTIqFWSlsBbDqOqfgmRemj4OhKNbXd X-Received: by 2002:a05:6402:202d:: with SMTP id ay13mr289721edb.249.1628757708186; Thu, 12 Aug 2021 01:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628757708; cv=none; d=google.com; s=arc-20160816; b=Erz58I398a9dpKgvEhpCnD+2XhLR3JU3zc2pyTCfNY+ftoO8T6RsXJrN/ffM8Kuj8k QEc+bsMBKfIj2GbxrqBW/ZlrfrXem6jmFvurdg/ke4EeNWYyPEOnfFJfgwcKWKRq+ebz iMwZBpEi0Au1NpvjAm8Voy7NCIbmnW8lXggjHYoqfyadR9JyJdzotdy3apXsVe7cHM+2 IeiOkTEcT8Hm81kcc0rd0c5ok0P/fv77O7LErM7GjBJyh6Dl9ZCN12E30EgfHgMzrfEa 2eKz48iIAbok+mTN3lnTlqIIiXanvUG1cR9xu7LRFZb59hlgzczqDxBKonInUGxaqU5c vsbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BfyVJNKePH8hq7e9lDQWGYr0PUSMI4G9bU9yLLxQxDI=; b=Vs5cce74L5FwCyYVSBR8hBUJjK6XzB55ieFg8mAFSEswhuvR/GqW+TwtG/qGz7CFd/ eqgsvUMxuIzbcSILLGyCAVcVqR979F5co+y1K3qpHmtjSVVhPjRcKDipq86JuvsKK7Hl 1aJ7/aflLZxdn6hFgzERa1rIML9MQe9vVCWqKBEgLoR4y0m8h3xI4V6vxjgwejCyww2Q l/EK1zmoHgRF404i7HNQhLsR2WtQILAqEjJBoZJysnaQ/ywXpF8wlWbdgWySZNO7rmyH 1g2STqNwFt35oapiPhBWbjmUI5sZUVgVTTSIwRsjNwIx2Dnv03xLHzXLHPR3ME5A5c7O QYfQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si2166856edb.446.2021.08.12.01.41.22; Thu, 12 Aug 2021 01:41:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234224AbhHLITK (ORCPT + 99 others); Thu, 12 Aug 2021 04:19:10 -0400 Received: from mga14.intel.com ([192.55.52.115]:59643 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234086AbhHLITJ (ORCPT ); Thu, 12 Aug 2021 04:19:09 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10073"; a="215036155" X-IronPort-AV: E=Sophos;i="5.84,315,1620716400"; d="scan'208";a="215036155" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 01:18:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,315,1620716400"; d="scan'208";a="517348222" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314.ger.corp.intel.com) ([10.237.222.51]) by FMSMGA003.fm.intel.com with ESMTP; 12 Aug 2021 01:18:25 -0700 From: Giovanni Cabiddu To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, christophe.jaillet@wanadoo.fr, qat-linux@intel.com, u.kleine-koenig@pengutronix.de, Andy Shevchenko , Giovanni Cabiddu Subject: [PATCH v2 3/4] crypto: qat - disable AER if an error occurs in probe functions Date: Thu, 12 Aug 2021 09:18:15 +0100 Message-Id: <20210812081816.275405-4-giovanni.cabiddu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210812081816.275405-1-giovanni.cabiddu@intel.com> References: <20210812081816.275405-1-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Christophe JAILLET If an error occurs after a 'adf_enable_aer()' call, it must be undone by a corresponding 'adf_disable_aer()' call, as already done in the remove function. Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_c3xxx/adf_drv.c | 6 ++++-- drivers/crypto/qat/qat_c62x/adf_drv.c | 6 ++++-- drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c index 2df26643dbc9..cc6e75dc60de 100644 --- a/drivers/crypto/qat/qat_c3xxx/adf_drv.c +++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c @@ -201,12 +201,12 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_save_state(pdev)) { dev_err(&pdev->dev, "Failed to save pci state\n"); ret = -ENOMEM; - goto out_err_free_reg; + goto out_err_disable_aer; } ret = qat_crypto_dev_config(accel_dev); if (ret) - goto out_err_free_reg; + goto out_err_disable_aer; ret = adf_dev_init(accel_dev); if (ret) @@ -222,6 +222,8 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) adf_dev_stop(accel_dev); out_err_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable_aer: + adf_disable_aer(accel_dev); out_err_free_reg: pci_release_regions(accel_pci_dev->pci_dev); out_err_disable: diff --git a/drivers/crypto/qat/qat_c62x/adf_drv.c b/drivers/crypto/qat/qat_c62x/adf_drv.c index efdba841d720..bf251dfe74b3 100644 --- a/drivers/crypto/qat/qat_c62x/adf_drv.c +++ b/drivers/crypto/qat/qat_c62x/adf_drv.c @@ -201,12 +201,12 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_save_state(pdev)) { dev_err(&pdev->dev, "Failed to save pci state\n"); ret = -ENOMEM; - goto out_err_free_reg; + goto out_err_disable_aer; } ret = qat_crypto_dev_config(accel_dev); if (ret) - goto out_err_free_reg; + goto out_err_disable_aer; ret = adf_dev_init(accel_dev); if (ret) @@ -222,6 +222,8 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) adf_dev_stop(accel_dev); out_err_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable_aer: + adf_disable_aer(accel_dev); out_err_free_reg: pci_release_regions(accel_pci_dev->pci_dev); out_err_disable: diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c index e1c167507157..3976a81bd99b 100644 --- a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c +++ b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c @@ -201,12 +201,12 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_save_state(pdev)) { dev_err(&pdev->dev, "Failed to save pci state\n"); ret = -ENOMEM; - goto out_err_free_reg; + goto out_err_disable_aer; } ret = qat_crypto_dev_config(accel_dev); if (ret) - goto out_err_free_reg; + goto out_err_disable_aer; ret = adf_dev_init(accel_dev); if (ret) @@ -222,6 +222,8 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) adf_dev_stop(accel_dev); out_err_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable_aer: + adf_disable_aer(accel_dev); out_err_free_reg: pci_release_regions(accel_pci_dev->pci_dev); out_err_disable: -- 2.31.1