Message ID | 20210322080838.1640805-2-gwendal@chromium.org |
---|---|
State | New |
Headers | show |
Series | Disable SATA DPLM on Fizz chromebox | expand |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 5f1f049063dd2..9132201f1353e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1279,6 +1279,9 @@ static bool ahci_broken_lpm(struct pci_dev *pdev) if (!dmi) return false; + if (!dmi->driver_data) + return true; + dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
In ahci_broken_lpm(), dmi->driver_data is encoded as a date: if the date of the current BIOS is older than driver_data, the LPM horkage is not applied. Allow dmi->driver_data to be empty in case a problem is not fixed in any BIOS version. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- Changes in v2: Fix cut and paste error in commit message. drivers/ata/ahci.c | 3 +++ 1 file changed, 3 insertions(+)