Commit 4e190a57 authored by Adam Guerin's avatar Adam Guerin Committed by Herbert Xu
Browse files

crypto: qat - preserve ADF_GENERAL_SEC



The ADF_GENERAL_SEC configuration section contains values that must be
preserved during state transitions (down -> up, up -> down).
This patch modifies the logic in adf_dev_shutdown() to maintain all
key values within this section, rather than selectively saving and
restoring only the ADF_SERVICES_ENABLED attribute.

To achieve this, a new function has been introduced that deletes all
configuration sections except for the one specified by name.
This function is invoked during adf_dev_down(), with ADF_GENERAL_SEC
as the argument. Consequently, the adf_dev_shutdown_cache_cfg() function
has been removed as it is now redundant.

Additionally, this patch eliminates the cache_config parameter from
the adf_dev_down() function since ADF_GENERAL_SEC should always be
retained. This change does not cause any side effects because all
entries in the key-value store are cleared when a module is unloaded.

Signed-off-by: default avatarAdam Guerin <adam.guerin@intel.com>
Co-developed-by: default avatarMichal Witwicki <michal.witwicki@intel.com>
Signed-off-by: default avatarMichal Witwicki <michal.witwicki@intel.com>
Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 47d96252
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	return ret;

out_err_dev_stop:
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
out_err:
	adf_cleanup_accel(accel_dev);
	return ret;
@@ -177,7 +177,7 @@ static void adf_remove(struct pci_dev *pdev)
		pr_err("QAT: Driver removal failed\n");
		return;
	}
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
	adf_cleanup_accel(accel_dev);
}

+2 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	return ret;

out_err_dev_stop:
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
out_err:
	adf_cleanup_accel(accel_dev);
	return ret;
@@ -179,7 +179,7 @@ static void adf_remove(struct pci_dev *pdev)
		pr_err("QAT: Driver removal failed\n");
		return;
	}
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
	adf_cleanup_accel(accel_dev);
}

+2 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	return ret;

out_err_dev_stop:
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
out_err_free_reg:
	pci_release_regions(accel_pci_dev->pci_dev);
out_err_disable:
@@ -221,7 +221,7 @@ static void adf_remove(struct pci_dev *pdev)
		pr_err("QAT: Driver removal failed\n");
		return;
	}
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
	adf_cleanup_accel(accel_dev);
	adf_cleanup_pci_dev(accel_dev);
	kfree(accel_dev);
+2 −2
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	return ret;

out_err_dev_stop:
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
out_err_free_reg:
	pci_release_regions(accel_pci_dev->pci_dev);
out_err_disable:
@@ -196,7 +196,7 @@ static void adf_remove(struct pci_dev *pdev)
		return;
	}
	adf_flush_vf_wq(accel_dev);
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
	adf_cleanup_accel(accel_dev);
	adf_cleanup_pci_dev(accel_dev);
	kfree(accel_dev);
+2 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	return ret;

out_err_dev_stop:
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
out_err_free_reg:
	pci_release_regions(accel_pci_dev->pci_dev);
out_err_disable:
@@ -221,7 +221,7 @@ static void adf_remove(struct pci_dev *pdev)
		pr_err("QAT: Driver removal failed\n");
		return;
	}
	adf_dev_down(accel_dev, false);
	adf_dev_down(accel_dev);
	adf_cleanup_accel(accel_dev);
	adf_cleanup_pci_dev(accel_dev);
	kfree(accel_dev);
Loading