Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1193091pxt; Sat, 7 Aug 2021 03:37:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9DZ96RJkkQaULtjUhuAxmeGUVnZNKi6C1qlwRIya0bbkEw+416pL7ziIuW31jUTbW3Qiz X-Received: by 2002:a17:906:6011:: with SMTP id o17mr13583234ejj.157.1628332630098; Sat, 07 Aug 2021 03:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628332630; cv=none; d=google.com; s=arc-20160816; b=Q2ApM5LqpAv4ISKLdzBe1CDnmDaMhaZI0HecgpMKlNfnvhwQRvo+D36r3xUBSw2+xb 0HoSFQghUZKhqzMKfqo418/CvRxpQAsc/RBNFE+wf5O+45ZogoVmny0MtHHY+/DbRPpD TERdtSWuH5Sn+bXMxGk+wm/EMB0X9xFRrM2RSuZirt1UfSUmVcqag9JdF9ql31VM5Rmd KXoDEyXm6eFWyobRfveJjXkn1gzKtirLswj6xpefxOWaYTHFdk+YIendSW3NdjmTjb33 aVsnOxTlFKtAG9ZJilBvUoKqM8FEJaMs/+auRoYsn7Z/lDg2IMqz+zTG2zpfwnj4GTJW aBLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Ua0ieP4hkR3vIUdyWxozCYKGfd7nLOVor99XBNBQXLo=; b=gXOt12GvxFKPMK+dRvu4F2TMuoBxJmocQlGYDdgAZr1jOWEjvZ/oYJAPoxnqcAs33q Qz1xf+WhLECOBTP/SmZumBgYMFAckyWuMxAUrswv1PJyqPCK2RnHdfsmD0LD4ku7sWig 4+7abUMEiNXXxFf4cN7rfY/Qo5DDFEznbJWhD3DzhrwbygwJ6Hs6NrbBrMYriciYqikl RF/NhXktR51fIADIC1LilMeQ5FnGwrS9tiwUILcIQckdjTrjbAwEDKqwlozC8V33xtEf 29J4s3ziY7pI5RGlGgyOXVJ29AGHhzqmvG+DKp5lN4A5cw1tzJC59ee6rfJEnd9OoyJv IQDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si12316146edj.487.2021.08.07.03.36.33; Sat, 07 Aug 2021 03:37:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbhHGKgh (ORCPT + 99 others); Sat, 7 Aug 2021 06:36:37 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:7806 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbhHGKgg (ORCPT ); Sat, 7 Aug 2021 06:36:36 -0400 Received: from dggeme768-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Ghdzr0N6dzYhPP; Sat, 7 Aug 2021 18:36:08 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggeme768-chm.china.huawei.com (10.3.19.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 7 Aug 2021 18:36:17 +0800 From: Weili Qian To: , CC: , , , Subject: [PATCH 5/5] crypto: hisilicon - check _PS0 and _PR0 method Date: Sat, 7 Aug 2021 18:32:36 +0800 Message-ID: <1628332356-33278-6-git-send-email-qianweili@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1628332356-33278-1-git-send-email-qianweili@huawei.com> References: <1628332356-33278-1-git-send-email-qianweili@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme768-chm.china.huawei.com (10.3.19.114) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/hisilicon/qm.c | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.8.1