Commit e06596d5 authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen

scsi: hisi_sas: Add check for methods _PS0 and _PR0

To support system suspend/resume or runtime suspend/resume, need to use the
function pci_set_power_state() to change the power state which requires at
least method _PS0 or _PR0 be filled by platform for v3 hw. So check whether
the method is supported, if not, print a warning.

A Kconfig dependency is added as there is no stub for
acpi_device_power_manageable().

Link: https://lore.kernel.org/r/1601649038-25534-5-git-send-email-john.garry@huawei.comSigned-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 65ff4aef
...@@ -15,5 +15,6 @@ config SCSI_HISI_SAS_PCI ...@@ -15,5 +15,6 @@ config SCSI_HISI_SAS_PCI
tristate "HiSilicon SAS on PCI bus" tristate "HiSilicon SAS on PCI bus"
depends on SCSI_HISI_SAS depends on SCSI_HISI_SAS
depends on PCI depends on PCI
depends on ACPI
help help
This driver supports HiSilicon's SAS HBA based on PCI device This driver supports HiSilicon's SAS HBA based on PCI device
...@@ -903,6 +903,7 @@ static int reset_hw_v3_hw(struct hisi_hba *hisi_hba) ...@@ -903,6 +903,7 @@ static int reset_hw_v3_hw(struct hisi_hba *hisi_hba)
static int hw_init_v3_hw(struct hisi_hba *hisi_hba) static int hw_init_v3_hw(struct hisi_hba *hisi_hba)
{ {
struct device *dev = hisi_hba->dev; struct device *dev = hisi_hba->dev;
struct acpi_device *acpi_dev;
union acpi_object *obj; union acpi_object *obj;
guid_t guid; guid_t guid;
int rc; int rc;
...@@ -933,6 +934,9 @@ static int hw_init_v3_hw(struct hisi_hba *hisi_hba) ...@@ -933,6 +934,9 @@ static int hw_init_v3_hw(struct hisi_hba *hisi_hba)
else else
ACPI_FREE(obj); ACPI_FREE(obj);
acpi_dev = ACPI_COMPANION(dev);
if (!acpi_device_power_manageable(acpi_dev))
dev_notice(dev, "neither _PS0 nor _PR0 is defined\n");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment