diff options
Diffstat (limited to 'drivers/acpi/nfit/core.c')
| -rw-r--r-- | drivers/acpi/nfit/core.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 629cf91649d2..5c9eb8d700d3 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
| @@ -2652,7 +2652,10 @@ static int ars_start(struct acpi_nfit_desc *acpi_desc, | |||
| 2652 | 2652 | ||
| 2653 | if (rc < 0) | 2653 | if (rc < 0) |
| 2654 | return rc; | 2654 | return rc; |
| 2655 | return cmd_rc; | 2655 | if (cmd_rc < 0) |
| 2656 | return cmd_rc; | ||
| 2657 | set_bit(ARS_VALID, &acpi_desc->scrub_flags); | ||
| 2658 | return 0; | ||
| 2656 | } | 2659 | } |
| 2657 | 2660 | ||
| 2658 | static int ars_continue(struct acpi_nfit_desc *acpi_desc) | 2661 | static int ars_continue(struct acpi_nfit_desc *acpi_desc) |
| @@ -2745,6 +2748,17 @@ static int ars_status_process_records(struct acpi_nfit_desc *acpi_desc) | |||
| 2745 | */ | 2748 | */ |
| 2746 | if (ars_status->out_length < 44) | 2749 | if (ars_status->out_length < 44) |
| 2747 | return 0; | 2750 | return 0; |
| 2751 | |||
| 2752 | /* | ||
| 2753 | * Ignore potentially stale results that are only refreshed | ||
| 2754 | * after a start-ARS event. | ||
| 2755 | */ | ||
| 2756 | if (!test_and_clear_bit(ARS_VALID, &acpi_desc->scrub_flags)) { | ||
| 2757 | dev_dbg(acpi_desc->dev, "skip %d stale records\n", | ||
| 2758 | ars_status->num_records); | ||
| 2759 | return 0; | ||
| 2760 | } | ||
| 2761 | |||
| 2748 | for (i = 0; i < ars_status->num_records; i++) { | 2762 | for (i = 0; i < ars_status->num_records; i++) { |
| 2749 | /* only process full records */ | 2763 | /* only process full records */ |
| 2750 | if (ars_status->out_length | 2764 | if (ars_status->out_length |
| @@ -3229,6 +3243,7 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc) | |||
| 3229 | struct nfit_spa *nfit_spa; | 3243 | struct nfit_spa *nfit_spa; |
| 3230 | int rc; | 3244 | int rc; |
| 3231 | 3245 | ||
| 3246 | set_bit(ARS_VALID, &acpi_desc->scrub_flags); | ||
| 3232 | list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { | 3247 | list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { |
| 3233 | switch (nfit_spa_type(nfit_spa->spa)) { | 3248 | switch (nfit_spa_type(nfit_spa->spa)) { |
| 3234 | case NFIT_SPA_VOLATILE: | 3249 | case NFIT_SPA_VOLATILE: |
