All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] crypto: qat - fixes and cleanups
@ 2021-08-12  8:18 Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 1/4] crypto: qat - simplify code and axe the use of a deprecated API Giovanni Cabiddu
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Giovanni Cabiddu @ 2021-08-12  8:18 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig,
	Giovanni Cabiddu

This is a rework of a set from Christophe JAILLET that implements a few
fixes and clean-ups in the QAT drivers with the addition of a related
patch.

This set removes the deprecated APIs pci_set_dma_mask() and
pci_set_consistent_dma_mask(), changes the DMA mask for QAT Gen2
devices, disables AER if an error occurs in the probe functions and
fixes a typo in the description of adf_disable_aer()

Changes from v1:
- Reworked patch #1 removing `else` related to 32 bits
- Reworked patch #1 to remove shadow return code
- Added patch to set DMA mask to 48 bits for QAT Gen2 devices

Christophe JAILLET (3):
  crypto: qat - simplify code and axe the use of a deprecated API
  crypto: qat - disable AER if an error occurs in probe functions
  crypto: qat - fix a typo in a comment

Giovanni Cabiddu (1):
  crypto: qat - set DMA mask to 48 bits for Gen2

 drivers/crypto/qat/qat_4xxx/adf_drv.c       | 14 ++++----------
 drivers/crypto/qat/qat_c3xxx/adf_drv.c      | 21 ++++++++-------------
 drivers/crypto/qat/qat_c3xxxvf/adf_drv.c    | 15 ++++-----------
 drivers/crypto/qat/qat_c62x/adf_drv.c       | 21 ++++++++-------------
 drivers/crypto/qat/qat_c62xvf/adf_drv.c     | 15 ++++-----------
 drivers/crypto/qat/qat_common/adf_aer.c     |  2 +-
 drivers/crypto/qat/qat_dh895xcc/adf_drv.c   | 21 ++++++++-------------
 drivers/crypto/qat/qat_dh895xccvf/adf_drv.c | 15 ++++-----------
 8 files changed, 41 insertions(+), 83 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] crypto: qat - simplify code and axe the use of a deprecated API
  2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
@ 2021-08-12  8:18 ` Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 2/4] crypto: qat - set DMA mask to 48 bits for Gen2 Giovanni Cabiddu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Giovanni Cabiddu @ 2021-08-12  8:18 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig,
	Andy Shevchenko, Giovanni Cabiddu

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

The wrappers in include/linux/pci-dma-compat.h should go away.

Replace 'pci_set_dma_mask/pci_set_consistent_dma_mask' by an equivalent
and less verbose 'dma_set_mask_and_coherent()' call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Co-developed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_4xxx/adf_drv.c       | 14 ++++----------
 drivers/crypto/qat/qat_c3xxx/adf_drv.c      | 15 ++++-----------
 drivers/crypto/qat/qat_c3xxxvf/adf_drv.c    | 15 ++++-----------
 drivers/crypto/qat/qat_c62x/adf_drv.c       | 15 ++++-----------
 drivers/crypto/qat/qat_c62xvf/adf_drv.c     | 15 ++++-----------
 drivers/crypto/qat/qat_dh895xcc/adf_drv.c   | 15 ++++-----------
 drivers/crypto/qat/qat_dh895xccvf/adf_drv.c | 15 ++++-----------
 7 files changed, 28 insertions(+), 76 deletions(-)

diff --git a/drivers/crypto/qat/qat_4xxx/adf_drv.c b/drivers/crypto/qat/qat_4xxx/adf_drv.c
index a8805c815d16..359fb7989dfb 100644
--- a/drivers/crypto/qat/qat_4xxx/adf_drv.c
+++ b/drivers/crypto/qat/qat_4xxx/adf_drv.c
@@ -221,16 +221,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* Set DMA identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration.\n");
-			ret = -EFAULT;
-			goto out_err;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration.\n");
+		goto out_err;
 	}
 
 	/* Get accelerator capabilities mask */
diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
index 7fb3343ae8b0..b561851cf955 100644
--- a/drivers/crypto/qat/qat_c3xxx/adf_drv.c
+++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_C3XXX_DEVICE_NAME)) {
diff --git a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
index 067ca5e17d38..5095ee30c6a0 100644
--- a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_C3XXXVF_DEVICE_NAME)) {
diff --git a/drivers/crypto/qat/qat_c62x/adf_drv.c b/drivers/crypto/qat/qat_c62x/adf_drv.c
index 1f5de442e1e6..f3ac4cda75e9 100644
--- a/drivers/crypto/qat/qat_c62x/adf_drv.c
+++ b/drivers/crypto/qat/qat_c62x/adf_drv.c
@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_C62X_DEVICE_NAME)) {
diff --git a/drivers/crypto/qat/qat_c62xvf/adf_drv.c b/drivers/crypto/qat/qat_c62xvf/adf_drv.c
index 51ea88c0b17d..7bd23438bcee 100644
--- a/drivers/crypto/qat/qat_c62xvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_c62xvf/adf_drv.c
@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_C62XVF_DEVICE_NAME)) {
diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
index a9ec4357144c..cc300a2662d5 100644
--- a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
+++ b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_DH895XCC_DEVICE_NAME)) {
diff --git a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
index 29999da716cc..da9c7434628c 100644
--- a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-			dev_err(&pdev->dev, "No usable DMA configuration\n");
-			ret = -EFAULT;
-			goto out_err_disable;
-		} else {
-			pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-		}
-
-	} else {
-		pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "No usable DMA configuration\n");
+		goto out_err_disable;
 	}
 
 	if (pci_request_regions(pdev, ADF_DH895XCCVF_DEVICE_NAME)) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] crypto: qat - set DMA mask to 48 bits for Gen2
  2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 1/4] crypto: qat - simplify code and axe the use of a deprecated API Giovanni Cabiddu
@ 2021-08-12  8:18 ` Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 3/4] crypto: qat - disable AER if an error occurs in probe functions Giovanni Cabiddu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Giovanni Cabiddu @ 2021-08-12  8:18 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig,
	Giovanni Cabiddu

Change the DMA mask from 64 to 48 for Gen2 devices as they cannot handle
addresses greater than 48 bits.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_c3xxx/adf_drv.c      | 2 +-
 drivers/crypto/qat/qat_c3xxxvf/adf_drv.c    | 2 +-
 drivers/crypto/qat/qat_c62x/adf_drv.c       | 2 +-
 drivers/crypto/qat/qat_c62xvf/adf_drv.c     | 2 +-
 drivers/crypto/qat/qat_dh895xcc/adf_drv.c   | 2 +-
 drivers/crypto/qat/qat_dh895xccvf/adf_drv.c | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
index b561851cf955..2df26643dbc9 100644
--- a/drivers/crypto/qat/qat_c3xxx/adf_drv.c
+++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c
@@ -159,7 +159,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
diff --git a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
index 5095ee30c6a0..7ef5a5185d29 100644
--- a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
@@ -141,7 +141,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
diff --git a/drivers/crypto/qat/qat_c62x/adf_drv.c b/drivers/crypto/qat/qat_c62x/adf_drv.c
index f3ac4cda75e9..efdba841d720 100644
--- a/drivers/crypto/qat/qat_c62x/adf_drv.c
+++ b/drivers/crypto/qat/qat_c62x/adf_drv.c
@@ -159,7 +159,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
diff --git a/drivers/crypto/qat/qat_c62xvf/adf_drv.c b/drivers/crypto/qat/qat_c62xvf/adf_drv.c
index 7bd23438bcee..c91beedd267c 100644
--- a/drivers/crypto/qat/qat_c62xvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_c62xvf/adf_drv.c
@@ -141,7 +141,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
index cc300a2662d5..e1c167507157 100644
--- a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
+++ b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c
@@ -159,7 +159,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
diff --git a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
index da9c7434628c..d332b68795f2 100644
--- a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
+++ b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c
@@ -141,7 +141,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set dma identifier */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (ret) {
 		dev_err(&pdev->dev, "No usable DMA configuration\n");
 		goto out_err_disable;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] crypto: qat - disable AER if an error occurs in probe functions
  2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 1/4] crypto: qat - simplify code and axe the use of a deprecated API Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 2/4] crypto: qat - set DMA mask to 48 bits for Gen2 Giovanni Cabiddu
@ 2021-08-12  8:18 ` Giovanni Cabiddu
  2021-08-12  8:18 ` [PATCH v2 4/4] crypto: qat - fix a typo in a comment Giovanni Cabiddu
  2021-08-21  7:49 ` [PATCH v2 0/4] crypto: qat - fixes and cleanups Herbert Xu
  4 siblings, 0 replies; 6+ messages in thread
From: Giovanni Cabiddu @ 2021-08-12  8:18 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig,
	Andy Shevchenko, Giovanni Cabiddu

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

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 <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] crypto: qat - fix a typo in a comment
  2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
                   ` (2 preceding siblings ...)
  2021-08-12  8:18 ` [PATCH v2 3/4] crypto: qat - disable AER if an error occurs in probe functions Giovanni Cabiddu
@ 2021-08-12  8:18 ` Giovanni Cabiddu
  2021-08-21  7:49 ` [PATCH v2 0/4] crypto: qat - fixes and cleanups Herbert Xu
  4 siblings, 0 replies; 6+ messages in thread
From: Giovanni Cabiddu @ 2021-08-12  8:18 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig,
	Andy Shevchenko, Giovanni Cabiddu

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

s/Enable/Disable/ when describing 'adf_disable_aer()'

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_common/adf_aer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_common/adf_aer.c b/drivers/crypto/qat/qat_common/adf_aer.c
index d2ae293d0df6..ed3e40bc56eb 100644
--- a/drivers/crypto/qat/qat_common/adf_aer.c
+++ b/drivers/crypto/qat/qat_common/adf_aer.c
@@ -194,7 +194,7 @@ int adf_enable_aer(struct adf_accel_dev *accel_dev)
 EXPORT_SYMBOL_GPL(adf_enable_aer);
 
 /**
- * adf_disable_aer() - Enable Advance Error Reporting for acceleration device
+ * adf_disable_aer() - Disable Advance Error Reporting for acceleration device
  * @accel_dev:  Pointer to acceleration device.
  *
  * Function disables PCI Advance Error Reporting for the
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] crypto: qat - fixes and cleanups
  2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
                   ` (3 preceding siblings ...)
  2021-08-12  8:18 ` [PATCH v2 4/4] crypto: qat - fix a typo in a comment Giovanni Cabiddu
@ 2021-08-21  7:49 ` Herbert Xu
  4 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2021-08-21  7:49 UTC (permalink / raw)
  To: Giovanni Cabiddu
  Cc: linux-crypto, christophe.jaillet, qat-linux, u.kleine-koenig

On Thu, Aug 12, 2021 at 09:18:12AM +0100, Giovanni Cabiddu wrote:
> This is a rework of a set from Christophe JAILLET that implements a few
> fixes and clean-ups in the QAT drivers with the addition of a related
> patch.
> 
> This set removes the deprecated APIs pci_set_dma_mask() and
> pci_set_consistent_dma_mask(), changes the DMA mask for QAT Gen2
> devices, disables AER if an error occurs in the probe functions and
> fixes a typo in the description of adf_disable_aer()
> 
> Changes from v1:
> - Reworked patch #1 removing `else` related to 32 bits
> - Reworked patch #1 to remove shadow return code
> - Added patch to set DMA mask to 48 bits for QAT Gen2 devices
> 
> Christophe JAILLET (3):
>   crypto: qat - simplify code and axe the use of a deprecated API
>   crypto: qat - disable AER if an error occurs in probe functions
>   crypto: qat - fix a typo in a comment
> 
> Giovanni Cabiddu (1):
>   crypto: qat - set DMA mask to 48 bits for Gen2
> 
>  drivers/crypto/qat/qat_4xxx/adf_drv.c       | 14 ++++----------
>  drivers/crypto/qat/qat_c3xxx/adf_drv.c      | 21 ++++++++-------------
>  drivers/crypto/qat/qat_c3xxxvf/adf_drv.c    | 15 ++++-----------
>  drivers/crypto/qat/qat_c62x/adf_drv.c       | 21 ++++++++-------------
>  drivers/crypto/qat/qat_c62xvf/adf_drv.c     | 15 ++++-----------
>  drivers/crypto/qat/qat_common/adf_aer.c     |  2 +-
>  drivers/crypto/qat/qat_dh895xcc/adf_drv.c   | 21 ++++++++-------------
>  drivers/crypto/qat/qat_dh895xccvf/adf_drv.c | 15 ++++-----------
>  8 files changed, 41 insertions(+), 83 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-21  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  8:18 [PATCH v2 0/4] crypto: qat - fixes and cleanups Giovanni Cabiddu
2021-08-12  8:18 ` [PATCH v2 1/4] crypto: qat - simplify code and axe the use of a deprecated API Giovanni Cabiddu
2021-08-12  8:18 ` [PATCH v2 2/4] crypto: qat - set DMA mask to 48 bits for Gen2 Giovanni Cabiddu
2021-08-12  8:18 ` [PATCH v2 3/4] crypto: qat - disable AER if an error occurs in probe functions Giovanni Cabiddu
2021-08-12  8:18 ` [PATCH v2 4/4] crypto: qat - fix a typo in a comment Giovanni Cabiddu
2021-08-21  7:49 ` [PATCH v2 0/4] crypto: qat - fixes and cleanups Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.