All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Cc: linux-media@vger.kernel.org, k.debski@samsung.com,
	kyungmin.park@samsung.com, jtp.park@samsung.com,
	linux-samsung-soc@vger.kernel.org, m.chehab@samsung.com
Subject: Re: [PATCH] media: v4l2: make alloction alogthim more robust and flexible
Date: Tue, 11 Nov 2014 13:13:38 +0200	[thread overview]
Message-ID: <20141111111338.GC8214@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <1406692532-31800-1-git-send-email-zhaowei.yuan@samsung.com>

Hi Zhaowei,

My apologies for the delayed reply.

On Wed, Jul 30, 2014 at 11:55:32AM +0800, Zhaowei Yuan wrote:
> Current algothim relies on the fact that caller will align the
> size to PAGE_SIZE, otherwise order will be decreased to negative
> when remain size is less than PAGE_SIZE, it makes the function
> hard to be migrated.
> This patch sloves the hidden problem.
> 
> Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
> ---
>  drivers/media/v4l2-core/videobuf2-dma-sg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c
> index adefc31..40d18aa 100644
> --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
> +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
> @@ -58,7 +58,7 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf,
> 
>  		order = get_order(size);
>  		/* Dont over allocate*/
> -		if ((PAGE_SIZE << order) > size)
> +		if (order > 0 && (PAGE_SIZE << order) > size)
>  			order--;
> 
>  		pages = NULL;

With comments from Andreas taken into account,

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

I'd consider this for the stable series as well.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

      parent reply	other threads:[~2014-11-11 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  3:55 [PATCH] media: v4l2: make alloction alogthim more robust and flexible Zhaowei Yuan
2014-07-30 14:07 ` Andreas Färber
2014-11-11 11:13 ` Sakari Ailus [this message]

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=20141111111338.GC8214@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=jtp.park@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=zhaowei.yuan@samsung.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.