Re: [PATCHv2 01/10] fbdev: ssd1307fb: fix memory address smem_start.

2015-03-02 Thread Maxime Ripard
On Sun, Mar 01, 2015 at 11:27:54PM +0100, Thomas Niederprüm wrote:
> the smem_start pointer of the framebuffer info struct needs to hold the
> physical address rather than the virtual address. This patch fixes a
> driver crash on mmaping the framebuffer memory due to an access to the
> memory address.
> 
> Note however that the memory allocated by kzalloc is not page aligned,
> while the address presented on a mmap call is aligned to the next page
> boudary.
> 
> Signed-off-by: Thomas Niederprüm 

Acked-by: Maxime Ripard 

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCHv2 01/10] fbdev: ssd1307fb: fix memory address smem_start.

2015-03-02 Thread Maxime Ripard
On Sun, Mar 01, 2015 at 11:27:54PM +0100, Thomas Niederprüm wrote:
 the smem_start pointer of the framebuffer info struct needs to hold the
 physical address rather than the virtual address. This patch fixes a
 driver crash on mmaping the framebuffer memory due to an access to the
 memory address.
 
 Note however that the memory allocated by kzalloc is not page aligned,
 while the address presented on a mmap call is aligned to the next page
 boudary.
 
 Signed-off-by: Thomas Niederprüm nied...@physik.uni-kl.de

Acked-by: Maxime Ripard maxime.rip...@free-electrons.com

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


[PATCHv2 01/10] fbdev: ssd1307fb: fix memory address smem_start.

2015-03-01 Thread Thomas Niederprüm
the smem_start pointer of the framebuffer info struct needs to hold the
physical address rather than the virtual address. This patch fixes a
driver crash on mmaping the framebuffer memory due to an access to the
memory address.

Note however that the memory allocated by kzalloc is not page aligned,
while the address presented on a mmap call is aligned to the next page
boudary.

Signed-off-by: Thomas Niederprüm 
---
 drivers/video/fbdev/ssd1307fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index f7ed6d9..61e0ce8 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -515,7 +515,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
info->var.blue.offset = 0;
 
info->screen_base = (u8 __force __iomem *)vmem;
-   info->fix.smem_start = (unsigned long)vmem;
+   info->fix.smem_start = __pa(vmem);
info->fix.smem_len = vmem_size;
 
fb_deferred_io_init(info);
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 01/10] fbdev: ssd1307fb: fix memory address smem_start.

2015-03-01 Thread Thomas Niederprüm
the smem_start pointer of the framebuffer info struct needs to hold the
physical address rather than the virtual address. This patch fixes a
driver crash on mmaping the framebuffer memory due to an access to the
memory address.

Note however that the memory allocated by kzalloc is not page aligned,
while the address presented on a mmap call is aligned to the next page
boudary.

Signed-off-by: Thomas Niederprüm nied...@physik.uni-kl.de
---
 drivers/video/fbdev/ssd1307fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index f7ed6d9..61e0ce8 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -515,7 +515,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
info-var.blue.offset = 0;
 
info-screen_base = (u8 __force __iomem *)vmem;
-   info-fix.smem_start = (unsigned long)vmem;
+   info-fix.smem_start = __pa(vmem);
info-fix.smem_len = vmem_size;
 
fb_deferred_io_init(info);
-- 
2.3.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/