From: Arjan van de Ven <arjan@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk, alan@redhat.com, mchehab@infradead.org,
akpm@osdl.org
Subject: Re: + add-cpia2-camera-support.patch added to -mm tree
Date: Fri, 24 Feb 2006 10:06:55 +0100 [thread overview]
Message-ID: <1140772015.2874.14.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <200602240049.k1O0nuQn023548@shell0.pdx.osdl.net>
> +
> +/* Here we want the physical address of the memory.
> + * This is used when initializing the contents of the
> + * area and marking the pages as reserved.
> + */
> +static inline unsigned long kvirt_to_pa(unsigned long adr)
> +{
> + unsigned long kva, ret;
> +
> + kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
> + kva |= adr & (PAGE_SIZE-1); /* restore the offset */
> + ret = __pa(kva);
> + return ret;
> +}
> +
> +static void *rvmalloc(unsigned long size)
> +{
> + void *mem;
> + unsigned long adr;
> +
> + /* Round it off to PAGE_SIZE */
> + size = PAGE_ALIGN(size);
> +
> + mem = vmalloc_32(size);
> + if (!mem)
> + return NULL;
> +
> + memset(mem, 0, size); /* Clear the ram out, no junk to the user */
> + adr = (unsigned long) mem;
> +
> + while ((long)size > 0) {
> + SetPageReserved(vmalloc_to_page((void *)adr));
> + adr += PAGE_SIZE;
> + size -= PAGE_SIZE;
> + }
> + return mem;
> +}
you are adding rvmalloc copy number 14; seems you own the task to make
it generic now ;)
Also I thought SetPageReserved and friends are deprecated :)
> +struct camera_data {
> + /* locks */
> + struct semaphore busy_lock; /* guard against SMP multithreading */
> + struct v4l2_prio_state prio;
> +
please make this use mutexes; adding new semaphores for no reason is not
a good idea...
next parent reply other threads:[~2006-02-24 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200602240049.k1O0nuQn023548@shell0.pdx.osdl.net>
2006-02-24 9:06 ` Arjan van de Ven [this message]
2006-02-24 11:16 ` Alan Cox
2006-02-24 12:59 ` Hugh Dickins
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=1140772015.2874.14.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
/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
all inboxes | Powered by JetHome®