All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
To: "Oliver O'Halloran" <oohall@gmail.com>
Cc: Vaibhav Jain <vaibhav@linux.ibm.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>
Subject: Re: [PATCH v5 4/4] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails
Date: Wed, 24 Jul 2019 11:27:37 +0200	[thread overview]
Message-ID: <ee9b6b91-3e43-9436-6e3a-b0dc73179dd1@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAOSf1CFA14eRY66J0gHAvNnWGzFTFmb3-RKQ3+XjrqdG0jxk6g@mail.gmail.com>

Le 24/07/2019 à 11:24, Oliver O'Halloran a écrit :
> On Wed, Jul 24, 2019 at 7:17 PM Laurent Dufour
> <ldufour@linux.vnet.ibm.com> wrote:
>>
>> Le 23/07/2019 à 18:13, Vaibhav Jain a écrit :
>>> *snip*
>>> @@ -404,6 +409,14 @@ static int papr_scm_probe(struct platform_device *pdev)
>>>
>>>        /* 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 == -EBUSY) {
>>> +             dev_warn(&pdev->dev, "Retrying bind after unbinding\n");
>>> +             drc_pmem_unbind(p);
>>> +             rc = drc_pmem_bind(p);
>>
>> In the unlikely case where H_SCM_BIND_MEM is returning H_OVERLAP once the
>> unbinding has been done, the error would be silently processed. That sounds
>> really unlikely, but should an error message be displayed in this
>> particular case ?
> 
> drc_pmem_bind() prints the h-call error code if we get one, so it's not silent

That's no more the case whith this patch, H_OVERLAP is handled before 
writing the error message, which would make sense for the first try.

For the record, the patch introduces:

@@ -65,6 +66,10 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
  	} while (rc == H_BUSY);

  	if (rc) {
+		/* H_OVERLAP needs a separate error path */
+		if (rc == H_OVERLAP)
+			return -EBUSY;
+
  		dev_err(&p->pdev->dev, "bind err: %lld\n", rc);
  		return -ENXIO;
  	}


  reply	other threads:[~2019-07-24  9:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 16:13 [PATCH v5 0/4] powerpc/papr_scm: Workaround for failure of drc bind after kexec Vaibhav Jain
2019-07-23 16:13 ` [DOC][PATCH v5 1/4] powerpc: Document some HCalls for Storage Class Memory Vaibhav Jain
2019-07-24  9:08   ` Laurent Dufour
2019-07-24 12:59     ` Michal Suchánek
2019-07-30  5:28       ` Vaibhav Jain
2019-07-30 12:06   ` Michael Ellerman
2019-07-23 16:13 ` [PATCH v5 2/4] powerpc/pseries: Update SCM hcall op-codes in hvcall.h Vaibhav Jain
2019-07-26  8:53   ` David Gibson
2019-07-30 11:26     ` Michael Ellerman
2019-07-23 16:13 ` [PATCH v5 3/4] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL Vaibhav Jain
2019-07-23 16:13 ` [PATCH v5 4/4] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails Vaibhav Jain
2019-07-24  9:17   ` Laurent Dufour
2019-07-24  9:24     ` Oliver O'Halloran
2019-07-24  9:27       ` Laurent Dufour [this message]
2019-07-24  9:45         ` Oliver O'Halloran
2019-07-24 10:04 ` [PATCH v5 0/4] powerpc/papr_scm: Workaround for failure of drc bind after kexec Aneesh Kumar K.V

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=ee9b6b91-3e43-9436-6e3a-b0dc73179dd1@linux.vnet.ibm.com \
    --to=ldufour@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.