[PATCH v2 2/2] powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error
Aneesh Kumar K.V
aneesh.kumar at linux.ibm.com
Tue Sep 24 20:59:14 AEST 2019
Vaibhav Jain <vaibhav at linux.ibm.com> writes:
>> +err_out:
>> + dev_info(&p->pdev->dev,
>> + "Failed to query, trying an unbind followed by bind");
>> + drc_pmem_unbind(p);
>> + return drc_pmem_bind(p);
>> +}
> Would have preferred error handling for bind failure to be done at
> single location i.e in papr_scm_probe() rather than in
> drc_pmem_query_n_bind().
>
IMHO the final code looks simpler.
/* request the hypervisor to bind this region to somewhere in memory */
rc = drc_pmem_bind(p);
/* If phyp says drc memory still bound then force unbound and retry */
if (rc == H_OVERLAP)
rc = drc_pmem_query_n_bind(p);
if (rc != H_SUCCESS) {
dev_err(&p->pdev->dev, "bind err: %d\n", rc);
rc = -ENXIO;
goto err;
}
-aneesh
More information about the Linuxppc-dev
mailing list