From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Vaibhav Jain <vaibhav@linux.ibm.com>, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, Oliver O'Halloran <oohall@gmail.com>
Subject: Re: [PATCH v2 2/2] powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error
Date: Tue, 24 Sep 2019 16:29:14 +0530 [thread overview]
Message-ID: <87a7auot8d.fsf@linux.ibm.com> (raw)
In-Reply-To: <87v9u8tuma.fsf@vajain21.in.ibm.com>
Vaibhav Jain <vaibhav@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
next prev parent reply other threads:[~2019-09-24 11:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 12:34 [PATCH v2 1/2] powerpc/nvdimm: Use HCALL error as the return value Aneesh Kumar K.V
2019-09-03 12:34 ` [PATCH v2 2/2] powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error Aneesh Kumar K.V
2019-09-04 6:59 ` Vaibhav Jain
2019-09-24 10:59 ` Aneesh Kumar K.V [this message]
2019-09-04 5:39 ` [PATCH v2 1/2] powerpc/nvdimm: Use HCALL error as the return value Vaibhav Jain
2019-09-24 11:02 ` Aneesh Kumar K.V
2019-09-25 11:05 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a7auot8d.fsf@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=oohall@gmail.com \
--cc=vaibhav@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).