| @@ -1044,7 +1044,7 @@ static ssize_t scrub_store(struct device *dev, · 1043 unmodified lines |
| 1044 | 1044 | if (nd_desc) { |
| 1045 | 1045 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
| 1046 | 1046 | |
| 1047 | | − rc = acpi_nfit_ars_rescan(acpi_desc); |
| 1047 | + rc = acpi_nfit_ars_rescan(acpi_desc, 0); |
| 1048 | 1048 | } |
| 1049 | 1049 | device_unlock(dev); |
| 1050 | 1050 | if (rc) |
| @@ -2137,6 +2137,7 @@ static int ars_start(struct acpi_nfit_desc *acpi_desc, struct nfit_spa *nfit_spa · 1086 unmodified lines |
| 2137 | 2137 | memset(&ars_start, 0, sizeof(ars_start)); |
| 2138 | 2138 | ars_start.address = spa->address; |
| 2139 | 2139 | ars_start.length = spa->length; |
| 2140 | + ars_start.flags = acpi_desc->ars_start_flags; |
| 2140 | 2141 | if (nfit_spa_type(spa) == NFIT_SPA_PM) |
| 2141 | 2142 | ars_start.type = ND_ARS_PERSISTENT; |
| 2142 | 2143 | else if (nfit_spa_type(spa) == NFIT_SPA_VOLATILE) |
| @@ -2163,6 +2164,7 @@ static int ars_continue(struct acpi_nfit_desc *acpi_desc) · 20 unmodified lines |
| 2163 | 2164 | ars_start.address = ars_status->restart_address; |
| 2164 | 2165 | ars_start.length = ars_status->restart_length; |
| 2165 | 2166 | ars_start.type = ars_status->type; |
| 2167 | + ars_start.flags = acpi_desc->ars_start_flags; |
| 2166 | 2168 | rc = nd_desc->ndctl(nd_desc, NULL, ND_CMD_ARS_START, &ars_start, |
| 2167 | 2169 | sizeof(ars_start), &cmd_rc); |
| 2168 | 2170 | if (rc < 0) |
| @@ -2684,6 +2686,7 @@ static void acpi_nfit_scrub(struct work_struct *work) · 515 unmodified lines |
| 2684 | 2686 | list_for_each_entry(nfit_spa, &acpi_desc->spas, list) |
| 2685 | 2687 | acpi_nfit_async_scrub(acpi_desc, nfit_spa); |
| 2686 | 2688 | acpi_desc->scrub_count++; |
| 2689 | + acpi_desc->ars_start_flags = 0; |
| 2687 | 2690 | if (acpi_desc->scrub_count_state) |
| 2688 | 2691 | sysfs_notify_dirent(acpi_desc->scrub_count_state); |
| 2689 | 2692 | mutex_unlock(&acpi_desc->init_mutex); |
| @@ -2702,6 +2705,7 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc) · 12 unmodified lines |
| 2702 | 2705 | return rc; |
| 2703 | 2706 | } |
| 2704 | 2707 | |
| 2708 | + acpi_desc->ars_start_flags = 0; |
| 2705 | 2709 | if (!acpi_desc->cancel) |
| 2706 | 2710 | queue_work(nfit_wq, &acpi_desc->work); |
| 2707 | 2711 | return 0; |
| @@ -2906,7 +2910,7 @@ static int acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc, · 198 unmodified lines |
| 2906 | 2910 | return 0; |
| 2907 | 2911 | } |
| 2908 | 2912 | |
| 2909 | | −int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc) |
| 2913 | +int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, u8 flags) |
| 2910 | 2914 | { |
| 2911 | 2915 | struct device *dev = acpi_desc->dev; |
| 2912 | 2916 | struct nfit_spa *nfit_spa; |
| @@ -2928,6 +2932,7 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc) · 15 unmodified lines |
| 2928 | 2932 | |
| 2929 | 2933 | nfit_spa->ars_required = 1; |
| 2930 | 2934 | } |
| 2935 | + acpi_desc->ars_start_flags = flags; |
| 2931 | 2936 | queue_work(nfit_wq, &acpi_desc->work); |
| 2932 | 2937 | dev_dbg(dev, "%s: ars_scan triggered\n", __func__); |
| 2933 | 2938 | mutex_unlock(&acpi_desc->init_mutex); |
| @@ -3104,8 +3109,10 @@ static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle) · 170 unmodified lines |
| 3104 | 3109 | static void acpi_nfit_uc_error_notify(struct device *dev, acpi_handle handle) |
| 3105 | 3110 | { |
| 3106 | 3111 | struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev); |
| 3112 | + u8 flags = (acpi_desc->scrub_mode == HW_ERROR_SCRUB_ON) ? |
| 3113 | + 0 : ND_ARS_RETURN_PREV_DATA; |
| 3107 | 3114 | |
| 3108 | | − acpi_nfit_ars_rescan(acpi_desc); |
| 3115 | + acpi_nfit_ars_rescan(acpi_desc, flags); |
| 3109 | 3116 | } |
| 3110 | 3117 | |
| 3111 | 3118 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event) |