mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Zhang <nvmarkzhang@gmail.com>
To: "Terje Bergström" <tbergstrom@nvidia.com>
Cc: "thierry.reding@avionic-design.de"
	<thierry.reding@avionic-design.de>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"dev@lynxeye.de" <dev@lynxeye.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv4 3/8] gpu: host1x: Add channel support
Date: Wed, 02 Jan 2013 17:31:03 +0800	[thread overview]
Message-ID: <50E3FE57.5070702@gmail.com> (raw)
In-Reply-To: <50E3FE8C.8000309@nvidia.com>

On 01/02/2013 05:31 PM, Terje Bergström wrote:
> On 02.01.2013 09:40, Mark Zhang wrote:
>> On 12/21/2012 07:39 PM, Terje Bergstrom wrote:
>>> Add support for host1x client modules, and host1x channels to submit
>>> work to the clients. The work is submitted in GEM CMA buffers, so
>>> this patch adds support for them.
>>>
>>> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
>>> ---
>> [...]
>>> +/*
>>> + * Begin a cdma submit
>>> + */
>>> +int host1x_cdma_begin(struct host1x_cdma *cdma, struct host1x_job *job)
>>> +{
>>> +	struct host1x *host1x = cdma_to_host1x(cdma);
>>> +
>>> +	mutex_lock(&cdma->lock);
>>> +
>>> +	if (job->timeout) {
>>> +		/* init state on first submit with timeout value */
>>> +		if (!cdma->timeout.initialized) {
>>> +			int err;
>>> +			err = host1x->cdma_op.timeout_init(cdma,
>>> +					job->syncpt_id);
>>> +			if (err) {
>>> +				mutex_unlock(&cdma->lock);
>>> +				return err;
>>> +			}
>>> +		}
>>> +	}
>>> +	if (!cdma->running)
>>> +		host1x->cdma_op.start(cdma);
>>> +
>>> +	cdma->slots_free = 0;
>>> +	cdma->slots_used = 0;
>>> +	cdma->first_get = host1x->cdma_pb_op.putptr(&cdma->push_buffer);
>>> +
>>> +	trace_host1x_cdma_begin(job->ch->dev->name);
>>
>> Seems missing "mutex_unlock(&cdma->lock);" here.
> 
> That's intentional. Writing a job to channel is atomic, so lock is taken
> from host1x_cdma_begin() until host1x_cdma_end().
> 

Okay. So can we consider that lock and unlock this mutex in the function
which calls host1x_cdma_begin and host1x_cdma_end, that means, in
current implementation, function "channel_submit"?

Mark
> Terje
> 

  reply	other threads:[~2013-01-02  9:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21 11:39 [PATCHv4 0/8] Support for Tegra 2D hardware Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 1/8] gpu: host1x: Add host1x driver Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 2/8] gpu: host1x: Add syncpoint wait and interrupts Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 3/8] gpu: host1x: Add channel support Terje Bergstrom
2012-12-22  4:17   ` Steven Rostedt
2013-01-02  9:31     ` Terje Bergström
2013-01-02  7:40   ` Mark Zhang
2013-01-02  9:31     ` Terje Bergström
2013-01-02  9:31       ` Mark Zhang [this message]
2013-01-02  9:43         ` Terje Bergström
2012-12-21 11:39 ` [PATCHv4 4/8] gpu: host1x: Add debug support Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 5/8] drm: tegra: Remove redundant host1x Terje Bergstrom
2012-12-21 14:36   ` Thierry Reding
2012-12-22  6:50     ` Terje Bergström
2012-12-25  5:25       ` Stephen Warren
2012-12-28 21:21         ` Thierry Reding
2012-12-31  6:43           ` Terje Bergström
2013-01-03 17:58     ` Terje Bergström
2012-12-21 11:39 ` [PATCHv4 6/8] ARM: tegra: Add board data and 2D clocks Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 7/8] drm: tegra: Add gr2d device Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 8/8] gpu: host1x: Register DRM dummy device Terje Bergstrom
2012-12-21 13:53   ` Lucas Stach
2012-12-21 14:09     ` Thierry Reding
2012-12-21 13:50 ` [PATCHv4 0/8] Support for Tegra 2D hardware Lucas Stach
2012-12-21 13:57   ` Terje Bergström
2012-12-21 13:59     ` Lucas Stach
2013-01-03  6:14   ` Terje Bergström
2012-12-26  9:42 ` Mark Zhang
2013-01-02  9:25   ` Terje Bergström
2013-01-03  2:36     ` Mark Zhang
2012-12-28  9:14 ` Mark Zhang
2013-01-02  9:42   ` Terje Bergström
2013-01-03  3:31     ` Mark Zhang
2013-01-03  5:50       ` Terje Bergström
2013-01-03  5:55         ` Mark Zhang

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=50E3FE57.5070702@gmail.com \
    --to=nvmarkzhang@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dev@lynxeye.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@avionic-design.de \
    /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

Powered by JetHome