linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] atyfb: Fix 64 bits resources on 32 bits archs
@ 2008-04-22  1:26 Benjamin Herrenschmidt
  2008-04-22 15:43 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22  1:26 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: linuxppc-dev, linux-kernel, adaplas, Andrew Morton

This fixes atyfb to not truncate 64 bits resources on 32 bits
platforms. Unfortunately, there are still issues with addresses
returned to userspace via struct fb_fix_screeninfo. This will
have to be dealt with separately.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/video/aty/atyfb_base.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- linux-work.orig/drivers/video/aty/atyfb_base.c	2008-04-22 11:21:46.000000000 +1000
+++ linux-work/drivers/video/aty/atyfb_base.c	2008-04-22 11:23:58.000000000 +1000
@@ -2842,7 +2842,7 @@ static int atyfb_setcolreg(u_int regno, 
 #ifdef __sparc__
 
 static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
-			struct fb_info *info, unsigned long addr)
+			struct fb_info *info, resource_size_t addr)
 {
 	struct atyfb_par *par = info->par;
 	struct device_node *dp;
@@ -3334,11 +3334,11 @@ static int __devinit init_from_bios(stru
 }
 #endif /* __i386__ */
 
-static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, unsigned long addr)
+static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, resource_size_t addr)
 {
 	struct atyfb_par *par = info->par;
 	u16 tmp;
-	unsigned long raddr;
+	resource_size_t raddr;
 	struct resource *rrp;
 	int ret = 0;
 
@@ -3351,8 +3351,8 @@ static int __devinit atyfb_setup_generic
 		PRINTKI("using auxiliary register aperture\n");
 	}
 
-	info->fix.mmio_start = raddr;
-	par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000);
+	info->fix.mmio_start = (unsigned long)raddr;
+	par->ati_regbase = ioremap(raddr, 0x1000);
 	if (par->ati_regbase == 0)
 		return -ENOMEM;
 
@@ -3374,7 +3374,7 @@ static int __devinit atyfb_setup_generic
 #endif
 
 	/* Map in frame buffer */
-	info->fix.smem_start = addr;
+	info->fix.smem_start = (unsigned long)addr;
 	info->screen_base = ioremap(addr, 0x800000);
 	if (info->screen_base == NULL) {
 		ret = -ENOMEM;
@@ -3411,7 +3411,7 @@ atyfb_setup_generic_fail:
 
 static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	unsigned long addr, res_start, res_size;
+	resource_size_t addr, res_start, res_size;
 	struct fb_info *info;
 	struct resource *rp;
 	struct atyfb_par *par;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] atyfb: Fix 64 bits resources on 32 bits archs
  2008-04-22  1:26 [PATCH 3/3] atyfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
@ 2008-04-22 15:43 ` Sergei Shtylyov
  2008-04-22 22:20   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2008-04-22 15:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-fbdev-devel, linuxppc-dev, Andrew Morton, linux-kernel, adaplas

Benjamin Herrenschmidt wrote:

> This fixes atyfb to not truncate 64 bits resources on 32 bits
> platforms. Unfortunately, there are still issues with addresses
> returned to userspace via struct fb_fix_screeninfo. This will
> have to be dealt with separately.

> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[...]
> --- linux-work.orig/drivers/video/aty/atyfb_base.c	2008-04-22 11:21:46.000000000 +1000
> +++ linux-work/drivers/video/aty/atyfb_base.c	2008-04-22 11:23:58.000000000 +1000
> @@ -2842,7 +2842,7 @@ static int atyfb_setcolreg(u_int regno, 
>  #ifdef __sparc__
>  
>  static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
> -			struct fb_info *info, unsigned long addr)
> +			struct fb_info *info, resource_size_t addr)

    Not sure what that change gives us -- this function mostly treats 'addr' 
as unsigned long (casting it to char/void *), ot compares it to 'unsigned 
long' 'base' variable -- which should be made 'resource_size_t' in its turn 
being assigned resource's start value.  So, this part of patch looks incomplete
(and yet I'm not sure if SPARC really needs all that)...

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] atyfb: Fix 64 bits resources on 32 bits archs
  2008-04-22 15:43 ` Sergei Shtylyov
@ 2008-04-22 22:20   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22 22:20 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-fbdev-devel, linuxppc-dev, Andrew Morton, linux-kernel, adaplas


On Tue, 2008-04-22 at 19:43 +0400, Sergei Shtylyov wrote:
>     Not sure what that change gives us -- this function mostly treats 'addr' 
> as unsigned long (casting it to char/void *), ot compares it to 'unsigned 
> long' 'base' variable -- which should be made 'resource_size_t' in its turn 
> being assigned resource's start value.  So, this part of patch looks incomplete
> (and yet I'm not sure if SPARC really needs all that)...

I just wanted to make sure both setup functions has the same prototype. 

I think sparc doesn't need fixing in there.

Ben.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-22 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-22  1:26 [PATCH 3/3] atyfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
2008-04-22 15:43 ` Sergei Shtylyov
2008-04-22 22:20   ` Benjamin Herrenschmidt

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).