All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>,
	Vinod Koul <vinod.koul@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition
Date: Thu, 19 Feb 2015 20:53:55 +0100	[thread overview]
Message-ID: <87mw498yp8.fsf@free.fr> (raw)
In-Reply-To: <54E5BB06.6000106@zonque.org> (Daniel Mack's message of "Thu, 19 Feb 2015 11:29:26 +0100")

Daniel Mack <daniel@zonque.org> writes:

> Hi Robert,
>
> Thanks for pushing this topic :)
> One minor nit:
>
>> +int mmp_pdma_toggle_reserved_channel(int legacy_channel)
>> +{
>> +	if (legacy_unavailable & (1 << legacy_channel))
>> +		return -EBUSY;
>> +	legacy_reserved ^= 1 << legacy_channel;
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(mmp_pdma_toggle_reserved_channel);
>
> My concern is that if pxa_request_dma() is called more than once for
> whatever reason by a legacy implementation, the toggled bit mask might
> get out of sync.
This is not possible.
The first call to pxa_request_dma() sets dma_channels[i].name to a non-NULL
value.
The second call to pxa_request_dma() cannot take the same i as
!dma_channels[i].name is not fullfilled.

> As we know exactly on the caller site what we want to achieve, let's make the
> API explicit with something like:
>
> int mmp_pdma_set_reserved_channel(int legacy_channel, bool reserved)
Even if I have no strong opinion about it, I'll let the patch as it is, unless
you really want me to add the reserved parameter, in which case I'll release a
v3.

Cheers.

-- 
Robert

WARNING: multiple messages have this Message-ID (diff)
From: robert.jarzmik@free.fr (Robert Jarzmik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition
Date: Thu, 19 Feb 2015 20:53:55 +0100	[thread overview]
Message-ID: <87mw498yp8.fsf@free.fr> (raw)
In-Reply-To: <54E5BB06.6000106@zonque.org> (Daniel Mack's message of "Thu, 19 Feb 2015 11:29:26 +0100")

Daniel Mack <daniel@zonque.org> writes:

> Hi Robert,
>
> Thanks for pushing this topic :)
> One minor nit:
>
>> +int mmp_pdma_toggle_reserved_channel(int legacy_channel)
>> +{
>> +	if (legacy_unavailable & (1 << legacy_channel))
>> +		return -EBUSY;
>> +	legacy_reserved ^= 1 << legacy_channel;
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(mmp_pdma_toggle_reserved_channel);
>
> My concern is that if pxa_request_dma() is called more than once for
> whatever reason by a legacy implementation, the toggled bit mask might
> get out of sync.
This is not possible.
The first call to pxa_request_dma() sets dma_channels[i].name to a non-NULL
value.
The second call to pxa_request_dma() cannot take the same i as
!dma_channels[i].name is not fullfilled.

> As we know exactly on the caller site what we want to achieve, let's make the
> API explicit with something like:
>
> int mmp_pdma_set_reserved_channel(int legacy_channel, bool reserved)
Even if I have no strong opinion about it, I'll let the patch as it is, unless
you really want me to add the reserved parameter, in which case I'll release a
v3.

Cheers.

-- 
Robert

  reply	other threads:[~2015-02-19 19:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 22:47 [PATCH RFC 0/2] Prepare smooth PXA transition to dmaengine Robert Jarzmik
2015-02-14 22:47 ` Robert Jarzmik
2015-02-14 22:47 ` [PATCH RFC 1/2] dma: mmp_dma: add support for legacy transition Robert Jarzmik
2015-02-14 22:47   ` Robert Jarzmik
2015-02-14 22:47 ` [PATCH RFC 2/2] ARM: pxa: transition to dmaengine phase 1 Robert Jarzmik
2015-02-14 22:47   ` Robert Jarzmik
2015-02-16 10:28   ` Arnd Bergmann
2015-02-16 10:28     ` Arnd Bergmann
2015-02-16 11:12     ` robert.jarzmik
2015-02-16 11:12       ` robert.jarzmik at free.fr
2015-02-16 11:33       ` Arnd Bergmann
2015-02-16 11:33         ` Arnd Bergmann
2015-02-16 11:37       ` Daniel Mack
2015-02-16 11:37         ` Daniel Mack
2015-02-16 11:14   ` Vasily Khoruzhick
2015-02-16 11:14     ` Vasily Khoruzhick
2015-02-16 11:23     ` Daniel Mack
2015-02-16 11:23       ` Daniel Mack
2015-02-16 16:54     ` Robert Jarzmik
2015-02-16 16:54       ` Robert Jarzmik
2015-02-16 17:00       ` Vasily Khoruzhick
2015-02-16 17:00         ` Vasily Khoruzhick
2015-02-16 18:03         ` Robert Jarzmik
2015-02-16 18:03           ` Robert Jarzmik
2015-02-17 20:39 ` [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition Robert Jarzmik
2015-02-17 20:39   ` Robert Jarzmik
2015-02-17 20:39   ` [PATCH v2 2/2] ARM: pxa: transition to dmaengine phase 1 Robert Jarzmik
2015-02-17 20:39     ` Robert Jarzmik
2015-02-19 10:29   ` [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition Daniel Mack
2015-02-19 10:29     ` Daniel Mack
2015-02-19 19:53     ` Robert Jarzmik [this message]
2015-02-19 19:53       ` Robert Jarzmik

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=87mw498yp8.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=anarsoul@gmail.com \
    --cc=arnd@arndb.de \
    --cc=daniel@zonque.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.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.