* Re: + add-cpia2-camera-support.patch added to -mm tree [not found] <200602240049.k1O0nuQn023548@shell0.pdx.osdl.net> @ 2006-02-24 9:06 ` Arjan van de Ven 2006-02-24 11:16 ` Alan Cox 0 siblings, 1 reply; 3+ messages in thread From: Arjan van de Ven @ 2006-02-24 9:06 UTC (permalink / raw) To: linux-kernel; +Cc: alan, alan, mchehab, akpm > + > +/* 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... ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: + add-cpia2-camera-support.patch added to -mm tree 2006-02-24 9:06 ` + add-cpia2-camera-support.patch added to -mm tree Arjan van de Ven @ 2006-02-24 11:16 ` Alan Cox 2006-02-24 12:59 ` Hugh Dickins 0 siblings, 1 reply; 3+ messages in thread From: Alan Cox @ 2006-02-24 11:16 UTC (permalink / raw) To: Arjan van de Ven; +Cc: linux-kernel, alan, alan, mchehab, akpm On Fri, Feb 24, 2006 at 10:06:55AM +0100, Arjan van de Ven wrote: > 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 :) Heading that way, which is fine by me. > > +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... Good idea. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: + add-cpia2-camera-support.patch added to -mm tree 2006-02-24 11:16 ` Alan Cox @ 2006-02-24 12:59 ` Hugh Dickins 0 siblings, 0 replies; 3+ messages in thread From: Hugh Dickins @ 2006-02-24 12:59 UTC (permalink / raw) To: Alan Cox; +Cc: Arjan van de Ven, linux-kernel, alan, mchehab, akpm On Fri, 24 Feb 2006, Alan Cox wrote: > On Fri, Feb 24, 2006 at 10:06:55AM +0100, Arjan van de Ven wrote: > > 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 :) > > Heading that way, which is fine by me. Just go with what you have: one day one of us will come along and vanish all those rvmallocs and SetPageReserveds; but until that day it's easiest for everyone if you continue with your rvmalloc #14. Hugh ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-24 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200602240049.k1O0nuQn023548@shell0.pdx.osdl.net>
2006-02-24 9:06 ` + add-cpia2-camera-support.patch added to -mm tree Arjan van de Ven
2006-02-24 11:16 ` Alan Cox
2006-02-24 12:59 ` Hugh Dickins
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox