[PATCH v5 00/10] crypto: hisilicon/qm - misc fixes

2020-08-15 Thread Yang Shen
This patchset fix some qm bugs: patch 1: store the string address before pass to 'strsep' patch 2: clear 'qp_status->used' when init the 'qp' patch 3: use 'dev_info_ratelimited' to avoid printk flooding. patch 4: fix the judgement of queue is full patch 7: save the vf configuration space to make su

[PATCH v5 06/10] crypto: hisilicon/qm - fix no stop reason when use 'hisi_qm_stop'

2020-08-15 Thread Yang Shen
Now, there are three reasons of stopping: 'NORMAL', 'SOFT_RESET' and 'FLR'. In order to keep this, explicitly pass the stop reason as an input parameter of 'hisi_qm_stop' function. Fixes: b67202e8ed30("crypto: hisilicon/qm - add state machine for QM") Signed-off-by: Shukun Tan Signed-off-by: Yang

[PATCH v5 05/10] crypto: hisilicon/qm - fix event queue depth to 2048

2020-08-15 Thread Yang Shen
From: Shukun Tan Increasing depth of 'event queue' from 1024 to 2048, which equals to twice depth of 'completion queue'. It will fix the easily happened 'event queue overflow' as using 1024 queue depth for 'event queue'. Fixes: 263c9959c937("crypto: hisilicon - add queue management driver...") S

[PATCH v5 04/10] crypto: hisilicon/qm - fix judgement of queue is full

2020-08-15 Thread Yang Shen
From: Hui Tang The queue depth is 1024, so the condition for judging the queue full should be 1023, otherwise the hardware cannot judge whether the queue is empty or full. Fixes: 263c9959c937("crypto: hisilicon - add queue management driver...") Signed-off-by: Hui Tang Signed-off-by: Yang Shen

[PATCH v5 07/10] crypto: hisilicon/qm - fix VF not available after PF FLR

2020-08-15 Thread Yang Shen
From: Shukun Tan When PF FLR, the hardware will actively trigger the VF FLR. Configuration space of VF needs to be saved and restored to ensure that it is available after the PF FLR. Fixes: 7ce396fa12a9("crypto: hisilicon - add FLR support") Signed-off-by: Shukun Tan Signed-off-by: Yang Shen R

[PATCH v5 10/10] crypto: hisilicon/qm - fix the process of register algorithms to crypto

2020-08-15 Thread Yang Shen
When the devices are removed or not existing, the corresponding algorithms which are registered by 'hisi-zip' driver can't be used. Move 'hisi_zip_register_to_crypto' from 'hisi_zip_init' to 'hisi_zip_probe'. The algorithms will be registered to crypto only when there is device bind on the driver.

[PATCH v5 09/10] crypto: hisilicon/qm - fix the call trace when unbind device

2020-08-15 Thread Yang Shen
From: Weili Qian Call trace will appear in the Hisilicon crypto driver unbinding or disabling SRIOV during task running with TFMs on the corresponding function. The log looks like this: [ 293.908078] Call trace: [ 293.908080] __queue_work+0x494/0x548 [ 293.908081] que

[PATCH v5 02/10] crypto: hisilicon/qm - clear used reference count when start qp

2020-08-15 Thread Yang Shen
From: Shukun Tan The used reference count is used for counting the number of 'sqe' which is under processing. This reference count should be cleared as starting 'qp', otherwise the 'used' will be messy when allocating this 'qp' again. Fixes: 5308f6600a39("crypto: hisilicon - QM memory management

[PATCH v5 08/10] crypto: hisilicon/qm - register callback function to 'pci_driver.shutdown'

2020-08-15 Thread Yang Shen
Since the drivers such as HPRE/SEC/ZIP do not implement 'pci_driver.shutdow', a RAS will be triggered at OS rebooting or shutting down as the hardware device is processing request. The log looks like this: NOTICE: [NimbusSecNodeType1]:[2372L]This is sec, Base = 0x14180 NOTICE:

[PATCH v5 01/10] crypto: hisilicon/qm - fix wrong release after using strsep

2020-08-15 Thread Yang Shen
From: Sihang Chen Save the string address before pass to strsep, release it at end. Because strsep will update the string address to point after the token. Fixes: c31dc9fe165d("crypto: hisilicon/qm - add DebugFS for xQC and...") Signed-off-by: Sihang Chen Signed-off-by: Yang Shen Reviewed-by:

[PATCH v5 03/10] crypto: hisilicon/qm - fix print frequence in hisi_qp_send

2020-08-15 Thread Yang Shen
Requests will be sent continuously as resetting, which will cause 'printk' flooding. Using 'dev_info_ratelimited' can solve this problem well. Fixes: b67202e8ed30("crypto: hisilicon/qm - add state machine for QM") Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/qm.c