linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: steiner@sgi.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 12/13] GRU - update gru kernel self tests
Date: Thu, 9 Apr 2009 15:37:15 -0700	[thread overview]
Message-ID: <20090409153715.f77bfbd4.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090406161015.670990000@sgi.com>

On Mon, 06 Apr 2009 11:08:21 -0500
steiner@sgi.com wrote:

> From: Jack Steiner <steiner@sgi.com>
> 
> Change the kernel self tests that can be optionally executed on
> GRU initialization. This is primarily for testing.
> 
> Eliminate the BUG statements on failure and return bad status.
> Add ioctl interface to execute the tests on demand.
> 
> ...
>
> +static int quicktest2(unsigned long arg)
> +{
> +	static struct completion cmp;
> +	static int inited;
> +	unsigned long han;
> +	int blade_id = 0;
> +	int numcb = 4;
> +	int ret = 0;
> +	unsigned long *buf;
> +	void *cb0, *cb;
> +	int i, k, istatus, bytes;
> +
> +	bytes = numcb * 4 * 8;
> +	buf = kmalloc(bytes, GFP_KERNEL);
> +	if (!buf)
> +		return -ENOMEM;
> +
> +	ret = -EBUSY;
> +	if (!inited)
> +		init_completion(&cmp);

This could have been done at compile time?

> +	inited = 1;
> +	han = gru_reserve_async_resources(blade_id, numcb, 0, &cmp);
> +	if (!han)
> +		goto done;
> +
> +	gru_lock_async_resource(han, &cb0, NULL);
> +	memset(buf, 0xee, bytes);
> +	for (i = 0; i < numcb; i++)
> +		gru_vset(cb0 + i * GRU_HANDLE_STRIDE, uv_gpa(&buf[i * 4]), 0,
> +				XTYPE_DW, 4, 1, IMA_INTERRUPT);
> +
> +	ret = 0;
> +	for (k = 0; k < numcb; k++) {
> +		gru_wait_async_cbr(han);
> +		for (i = 0; i < numcb; i++) {
> +			cb = cb0 + i * GRU_HANDLE_STRIDE;
> +			istatus = gru_check_status(cb);
> +			if (istatus == CBS_ACTIVE)
> +				continue;
> +			if (istatus == CBS_EXCEPTION)
> +				ret = -EFAULT;
> +			else if (buf[i] || buf[i + 1] || buf[i + 2] ||
> +					buf[i + 3])
> +				ret = -EIO;
> +		}
> +	}
> +	BUG_ON(cmp.done);
> +
> +	gru_unlock_async_resource(han);
> +	gru_release_async_resources(han);
> +done:
> +	kfree(buf);
> +	return ret;
> +}


  reply	other threads:[~2009-04-09 22:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 16:08 [patch 00/13] GRU - GRU Driver updates steiner
2009-04-06 16:08 ` [patch 01/13] GRU - bug fixes for GRU exception handling steiner
2009-04-06 16:08 ` [patch 02/13] GRU - dump chiplet state steiner
2009-04-09 22:37   ` Andrew Morton
2009-04-10 13:22     ` Jack Steiner
2009-04-06 16:08 ` [patch 03/13] GRU - dynamic allocation of kernel contexts steiner
2009-04-09 22:37   ` Andrew Morton
2009-04-10 13:24     ` Jack Steiner
2009-04-11  0:22       ` Andrew Morton
2009-04-06 16:08 ` [patch 04/13] GRU - change context load and unload steiner
2009-04-06 16:08 ` [patch 05/13] GRU - support cch_allocate for kernel threads steiner
2009-04-06 16:08 ` [patch 06/13] GRU - change resource assignment " steiner
2009-04-06 16:08 ` [patch 07/13] GRU - support contexts with zero dsrs or cbrs steiner
2009-04-06 16:08 ` [patch 08/13] GRU - fix handling of mesq failures steiner
2009-04-06 16:08 ` [patch 09/13] GRU - check context state on reload steiner
2009-04-06 16:08 ` [patch 10/13] GRU - support instruction completion interrupts steiner
2009-04-06 16:08 ` [patch 11/13] GRU - support for asynchronous gru instructions steiner
2009-04-06 16:08 ` [patch 12/13] GRU - update gru kernel self tests steiner
2009-04-09 22:37   ` Andrew Morton [this message]
2009-04-10 13:26     ` Jack Steiner
2009-04-06 16:08 ` [patch 13/13] GRU - update to rev 0.9 of gru spec steiner
2009-04-09 22:37 ` [patch 00/13] GRU - GRU Driver updates Andrew Morton
2009-04-10 12:31   ` Jack Steiner
2009-04-10 20:47     ` Andrew Morton

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=20090409153715.f77bfbd4.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steiner@sgi.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).