unsigned int tmo = scrub_timeout;
int rc;
- if (!nfit_spa->ars_required || !nfit_spa->nd_region)
+ if (!test_bit(ARS_REQ, &nfit_spa->ars_state) || !nfit_spa->nd_region)
return;
rc = ars_start(acpi_desc, nfit_spa);
* register them now to make data available.
*/
if (!nfit_spa->nd_region) {
- nfit_spa->ars_required = 1;
+ set_bit(ARS_REQ, &nfit_spa->ars_state);
acpi_nfit_register_region(acpi_desc, nfit_spa);
}
}
return 0;
}
-int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, u8 flags)
+int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags)
{
struct device *dev = acpi_desc->dev;
struct nfit_spa *nfit_spa;
if (nfit_spa_type(spa) != NFIT_SPA_PM)
continue;
- nfit_spa->ars_required = 1;
+ set_bit(ARS_REQ, &nfit_spa->ars_state);
}
- acpi_desc->ars_start_flags = flags;
+ acpi_desc->ars_start_flags = 0;
+ if (test_bit(ARS_SHORT, &flags))
+ acpi_desc->ars_start_flags |= ND_ARS_RETURN_PREV_DATA;
queue_work(nfit_wq, &acpi_desc->work);
dev_dbg(dev, "ars_scan triggered\n");
mutex_unlock(&acpi_desc->init_mutex);
static void acpi_nfit_uc_error_notify(struct device *dev, acpi_handle handle)
{
struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev);
- u8 flags = (acpi_desc->scrub_mode == HW_ERROR_SCRUB_ON) ?
- 0 : ND_ARS_RETURN_PREV_DATA;
+ unsigned long flags = (acpi_desc->scrub_mode == HW_ERROR_SCRUB_ON) ?
+ 0 : 1 << ARS_SHORT;
acpi_nfit_ars_rescan(acpi_desc, flags);
}
NFIT_NOTIFY_DIMM_HEALTH = 0x81,
};
+enum nfit_ars_state {
+ ARS_REQ,
+ ARS_DONE,
+ ARS_SHORT,
+ ARS_FAILED,
+};
+
struct nfit_spa {
struct list_head list;
struct nd_region *nd_region;
- unsigned int ars_required:1;
+ unsigned long ars_state;
u32 clear_err_unit;
u32 max_ars;
struct acpi_nfit_system_address spa[0];
extern struct list_head acpi_descs;
extern struct mutex acpi_desc_lock;
-int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, u8 flags);
+int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags);
#ifdef CONFIG_X86_MCE
void nfit_mce_register(void);