Message ID | 20210320034033.396854-2-gwendal@chromium.org |
---|---|
State | New |
Headers | show |
Series | [1/2] driver: ahci: Allow disabling dlpm for all bios version | expand |
Hello! On 20.03.2021 6:40, Gwendal Grignou wrote: > 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 is be empty in case a problem is not fixed in any s/is/to/? > BIOS version. > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org> [...] MBR, Sergei
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 is be empty in case a problem is not fixed in any BIOS version. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- drivers/ata/ahci.c | 3 +++ 1 file changed, 3 insertions(+)