linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: christophe lombard <clombard@linux.vnet.ibm.com>
To: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, fbarrat@linux.vnet.ibm.com,
	andrew.donnellan@au1.ibm.com
Subject: Re: [PATCH V4] cxl: Add support for ASB_Notify on POWER9
Date: Wed, 20 Dec 2017 09:26:11 +0100	[thread overview]
Message-ID: <9070c615-209d-d12f-7c40-f4c2a01c50a2@linux.vnet.ibm.com> (raw)
In-Reply-To: <871sjpap1e.fsf@vajain21.in.ibm.com>

Le 20/12/2017 à 07:31, Vaibhav Jain a écrit :
> Hi Christophe,
> 
> Thanks for the changes to the patch. Few minor review comments:
>

Thanks for the review.

> Christophe Lombard <clombard@linux.vnet.ibm.com> writes:
> 
>> @@ -362,3 +363,17 @@ void cxl_context_mm_count_put(struct cxl_context *ctx)
>>   	if (ctx->mm)
>>   		mmdrop(ctx->mm);
>>   }
>> +
>> +int cxl_context_thread_tidr(struct cxl_context *ctx)
>> +{
>> +	int rc = 0;
>> +
>> +	if (!cxl_is_power9())
>> +		return -ENODEV;
> EINVAL might be a better return value instead of ENODEV in this case.

This return code has been already discussed (with mpe) on the first
version of the patch. "Either ENODEV or ENXIO would be best that
can be distinguished and interpreted correctly by userspace"

> 
>> --- a/drivers/misc/cxl/file.c
>> +++ b/drivers/misc/cxl/file.c
>> @@ -248,6 +248,13 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,
>>   	 */
>>   	smp_mb();
>>
>> +	/* Assign a unique TIDR (thread id) for the current thread */
>> +	if (work.flags & CXL_START_WORK_TID) {
>> +		rc = cxl_context_thread_tidr(ctx);
>> +		if (rc)
>> +			goto out;
> May need to copy the cxl_ioctl_start_work struct back to userspace with
> the value of tidr allocated.
>

In fact, it does not matter. I don't know what the userspace could do
with this value.

>> +	}
>> +
>>   	trace_cxl_attach(ctx, work.work_element_descriptor,
>> work.num_interrupts, amr);
> should update the tracing here to also report the tidr
> 

yep. I will provide a new patch to include this update.

>> diff --git a/include/uapi/misc/cxl.h b/include/uapi/misc/cxl.h
>> index 49e8fd0..980ee8f 100644
>> --- a/include/uapi/misc/cxl.h
>> +++ b/include/uapi/misc/cxl.h
>> @@ -31,9 +31,11 @@ struct cxl_ioctl_start_work {
> Should reserve a field in the cxl_ioctl_start_work struct to report the
> tidr back to userspace.
> 
> 

We could do that, but as we discussed previously. We want to minimize
the impact on libcxl.

  reply	other threads:[~2017-12-20  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 17:27 [PATCH V4] cxl: Add support for ASB_Notify on POWER9 Christophe Lombard
2017-12-20  6:31 ` Vaibhav Jain
2017-12-20  8:26   ` christophe lombard [this message]
2017-12-20  8:46     ` Vaibhav Jain
2017-12-20 12:51       ` christophe lombard
2017-12-20 13:43         ` Vaibhav Jain

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=9070c615-209d-d12f-7c40-f4c2a01c50a2@linux.vnet.ibm.com \
    --to=clombard@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vaibhav@linux.vnet.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).