History

nfit: Continue init even if ARS commands are unimplemented

If firmware doesn't implement any of the ARS commands, take that to mean that ARS is unsupported, and continue to initialize regions without bad block lists. We cannot make the assumption that ARS commands will be unconditionally supported on all NVDIMMs.

Vishal Verma committed 10 years ago

Commit 6e2452d1 parent fc77dbd1 file · +11 −4Browse files

Unified · Split

drivers/acpi/nfit.c+11−4
@@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc, · 1589 unmodified lines
15901590 start = ndr_desc->res->start;
15911591 len = ndr_desc->res->end - ndr_desc->res->start + 1;
15921592
1593+ /*
1594+ * If ARS is unimplemented, unsupported, or if the 'Persistent Memory
1595+ * Scrub' flag in extended status is not set, skip this but continue
1596+ * initialization
1597+ */
15931598 rc = ars_get_cap(nd_desc, ars_cap, start, len);
1599+ if (rc == -ENOTTY) {
1600+ dev_dbg(acpi_desc->dev,
1601+ "Address Range Scrub is not implemented, won't create an error list\n");
1602+ rc = 0;
1603+ goto out;
1604+ }
15941605 if (rc)
15951606 goto out;
15961607
1597− /*
1598− * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in
1599− * extended status is not set, skip this but continue initialization
1600− */
16011608 if ((ars_cap->status & 0xffff) ||
16021609 !(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) {
16031610 dev_warn(acpi_desc->dev,