diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2014-12-03 00:08:48 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-12-04 10:50:23 -0500 |
commit | bc84b94a715f3505f5f5981af0ec0362aa3fe38b (patch) | |
tree | a23f88177d9f05c72b4a818d148e95a1c0871025 /drivers/crypto | |
parent | 5a2bb93f599247e049f5ae06a573f1152987c572 (diff) |
crypto: qat - fix problem with coalescing enable logic
Fixed issue reported by Dan Carpenter
410 if (adf_get_cfg_int(accel_dev, "Accelerator0",
411 ADF_ETRMGR_COALESCING_ENABLED_FORMAT,
412 bank_num, &coalesc_enabled) && coalesc_enabled)
This condition is reversed, so it only enables coalescing on error.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_transport.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_transport.c b/drivers/crypto/qat/qat_common/adf_transport.c index 5f3fa45348b4..589099202e54 100644 --- a/drivers/crypto/qat/qat_common/adf_transport.c +++ b/drivers/crypto/qat/qat_common/adf_transport.c | |||
@@ -376,8 +376,9 @@ static inline int adf_get_cfg_int(struct adf_accel_dev *accel_dev, | |||
376 | return 0; | 376 | return 0; |
377 | } | 377 | } |
378 | 378 | ||
379 | static void adf_enable_coalesc(struct adf_etr_bank_data *bank, | 379 | static void adf_get_coalesc_timer(struct adf_etr_bank_data *bank, |
380 | const char *section, uint32_t bank_num_in_accel) | 380 | const char *section, |
381 | uint32_t bank_num_in_accel) | ||
381 | { | 382 | { |
382 | if (adf_get_cfg_int(bank->accel_dev, section, | 383 | if (adf_get_cfg_int(bank->accel_dev, section, |
383 | ADF_ETRMGR_COALESCE_TIMER_FORMAT, | 384 | ADF_ETRMGR_COALESCE_TIMER_FORMAT, |
@@ -396,7 +397,7 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev, | |||
396 | struct adf_hw_device_data *hw_data = accel_dev->hw_device; | 397 | struct adf_hw_device_data *hw_data = accel_dev->hw_device; |
397 | struct adf_etr_ring_data *ring; | 398 | struct adf_etr_ring_data *ring; |
398 | struct adf_etr_ring_data *tx_ring; | 399 | struct adf_etr_ring_data *tx_ring; |
399 | uint32_t i, coalesc_enabled; | 400 | uint32_t i, coalesc_enabled = 0; |
400 | 401 | ||
401 | memset(bank, 0, sizeof(*bank)); | 402 | memset(bank, 0, sizeof(*bank)); |
402 | bank->bank_number = bank_num; | 403 | bank->bank_number = bank_num; |
@@ -407,10 +408,10 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev, | |||
407 | /* Enable IRQ coalescing always. This will allow to use | 408 | /* Enable IRQ coalescing always. This will allow to use |
408 | * the optimised flag and coalesc register. | 409 | * the optimised flag and coalesc register. |
409 | * If it is disabled in the config file just use min time value */ | 410 | * If it is disabled in the config file just use min time value */ |
410 | if (adf_get_cfg_int(accel_dev, "Accelerator0", | 411 | if ((adf_get_cfg_int(accel_dev, "Accelerator0", |
411 | ADF_ETRMGR_COALESCING_ENABLED_FORMAT, | 412 | ADF_ETRMGR_COALESCING_ENABLED_FORMAT, bank_num, |
412 | bank_num, &coalesc_enabled) && coalesc_enabled) | 413 | &coalesc_enabled) == 0) && coalesc_enabled) |
413 | adf_enable_coalesc(bank, "Accelerator0", bank_num); | 414 | adf_get_coalesc_timer(bank, "Accelerator0", bank_num); |
414 | else | 415 | else |
415 | bank->irq_coalesc_timer = ADF_COALESCING_MIN_TIME; | 416 | bank->irq_coalesc_timer = ADF_COALESCING_MIN_TIME; |
416 | 417 | ||