LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Interesting locking in vivi driver
@ 2007-03-25 19:53 Alexey Dobriyan
  0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2007-03-25 19:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: mchehab, video4linux-list

I have some question: what's going on? How can it work?

Local spinlock _on_stack_, initialized, acquired and dropped.

drivers/media/video/vivi.c:
   271	static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
   272			     int hmax, int line, char *timestr)
   273	#else
   274	static void gen_line(char *basep,int inipos,int wmax,
   275			     int hmax, int line, char *timestr)
   276	#endif
   277	{
   278		int  w,i,j,pos=inipos,y;
   279		char *p,*s;
   280		u8   chr,r,g,b,color;
   281	#ifdef CONFIG_VIVI_SCATTER
   282		int pgpos,oldpg;
   283		char *basep;
   284		struct page *pg;
   285
   286		unsigned long flags;
   287	===>	spinlock_t spinlock;			<===
   288
   289	===>	spin_lock_init(&spinlock);		<===
   290
   291		/* Get first addr pointed to pixel position */
   292		oldpg=get_addr_pos(pos,pages,to_addr);
   293		pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT);
   294	===>	spin_lock_irqsave(&spinlock,flags);	<===
   295		basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset;
   296	#endif


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-25 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-25 19:53 Interesting locking in vivi driver Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).