From: Weili Qian Date: Fri, 13 Aug 2021 09:50:09 +0000 (+0800) Subject: crypto: hisilicon - check _PS0 and _PR0 method X-Git-Tag: v5.15~479^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e1d2c52b2045ba7f90966b02daeb6c438432570;p=platform%2Fkernel%2Flinux-starfive.git crypto: hisilicon - check _PS0 and _PR0 method To support runtime PM, use the function 'pci_set_power_state' to change the power state. Therefore, method _PS0 or _PR0 needs to be filled by platform. So check whether the method is supported, if not, print a prompt information. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index e29ff97..369562d 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -3282,6 +3282,10 @@ static void hisi_qm_pre_init(struct hisi_qm *qm) init_rwsem(&qm->qps_lock); qm->qp_in_used = 0; qm->misc_ctl = false; + if (qm->fun_type == QM_HW_PF && qm->ver > QM_HW_V2) { + if (!acpi_device_power_manageable(ACPI_COMPANION(&pdev->dev))) + dev_info(&pdev->dev, "_PS0 and _PR0 are not defined"); + } } static void qm_cmd_uninit(struct hisi_qm *qm)