Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Ionut Nicu <ionut.nicu@mindbit.ro>
To: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>,
	Sapiens Rene <rene.sapiens@ti.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Fernando Guzman Lugo <x0095840@ti.com>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/2] staging: tidspbridge: rmgr/node.c code cleanup
Date: Fri, 10 Dec 2010 00:22:32 +0200	[thread overview]
Message-ID: <1291933352.23672.52.camel@atlantis.mindbit.ro> (raw)
In-Reply-To: <1291931258-30744-2-git-send-email-ionut.nicu@mindbit.ro>

Hi Omar,

On Thu, 2010-12-09 at 23:47 +0200, Ionut Nicu wrote:
> Reorganized some code in rmgr/node.c to increase its
> readability. Most of the changes reduce the code
> indentation level and simplifiy the code. No functional
> changes were done.

<snip>

>  	/*
>  	 * Check stream mode. Default is STRMMODE_PROCCOPY.
>  	 */
> -	if (!status && pattrs) {
> -		if (pattrs->strm_mode != STRMMODE_PROCCOPY)
> -			status = -EPERM;	/* illegal stream mode */
> -
> -	}
> -	if (status)
> -		goto func_end;
> +	if (pattrs && pattrs->strm_mode != STRMMODE_PROCCOPY)
> +		return -EPERM;	/* illegal stream mode */
>  

While cleaning up and reviewing the code I saw this check,  which unless
it's intentional I think it looks like a bug. See comment below.

<snip>
> +		strm_mode = pattrs ? pattrs->strm_mode : STRMMODE_PROCCOPY;
> +		switch (strm_mode) {
> +		case STRMMODE_RDMA:

...

> +				
> +		case STRMMODE_ZEROCOPY:

...

> +		case STRMMODE_PROCCOPY:

It looks like all modes are handled here although the only one that
could escape the validation from above is STRMMODE_PROCCOPY.

I tried removing the first check and tested with the
userspace-dspbridge strmcopy application, but I noticed the DSP hangs if
I try to use it with anything else than the copy mode.

Are the other modes (rdma, zerocopy) not supported at all?

Thanks,
Ionut.


  reply	other threads:[~2010-12-09 22:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 21:47 [PATCH 0/2] staging: tidspbridge: various cleanups Ionut Nicu
2010-12-09 21:47 ` [PATCH 1/2] staging: tidspbridge: rmgr/node.c code cleanup Ionut Nicu
2010-12-09 22:22   ` Ionut Nicu [this message]
2010-12-09 23:02     ` Felipe Contreras
2010-12-09 23:03     ` Ramirez Luna, Omar
2010-12-12 14:20       ` Ionut Nicu
2010-12-14  4:01         ` Ramirez Luna, Omar
2010-12-22 18:07   ` Ramirez Luna, Omar
2010-12-09 21:47 ` [PATCH 2/2] staging: tidspbridge: rmgr " Ionut Nicu
2010-12-22 20:52   ` Ramirez Luna, Omar
2010-12-24 11:33     ` Ionut Nicu

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=1291933352.23672.52.camel@atlantis.mindbit.ro \
    --to=ionut.nicu@mindbit.ro \
    --cc=andy.shevchenko@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=omar.ramirez@ti.com \
    --cc=rene.sapiens@ti.com \
    --cc=x0095840@ti.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