[linux-fbdev] Re: copy_from_user in drivers/video/fbmem.c

James Simmons jsimmons at acsu.buffalo.edu
Sat Jun 17 00:04:22 EST 2000


> > Which do people think is wrong:
> > Is copy_from_user() on PPC wrong, because it can't write to uncached
> > space.
> > Is fbmem.c wrong, because it tries to use copy_from_user() to memory
> > mapped IO?
>
> Congratulations! You found a bug in fbmem.c! Fbmem.c should not use direct
> memory accesses to access the frame buffer, but must use fb_writel() and
> friends instead.

Let me guess, fb_write and fb_read. I have seen problems also with using
memset on a mmap framebuffer on the PPC. Geert I like to suggest we move
fb_write, fb_read, and fb_memset to fb.h so userland apps can use them.
Also I have though about having generic functions for register access
based on what is in atyfb.c for userland to use as well. Something like.

static inline u32 ld_le32(unsigned int regindex, struct fb_info *info);
etc.

Actually this problem is more general. We really should have a generic
access MMIO region function. I believe some sound cards can be mmapped as
well.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list