linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>
Subject: Re: [PATCH] sisfb: limit POST memory test according to PCI resource length
Date: Wed, 10 Nov 2010 01:03:34 +0000	[thread overview]
Message-ID: <20101110010334.GA28852@linux-sh.org> (raw)
In-Reply-To: <1289341504-1038-1-git-send-email-aaro.koskinen@iki.fi>

On Wed, Nov 10, 2010 at 12:25:04AM +0200, Aaro Koskinen wrote:
> diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
> index b52f8e4..8a528aa 100644
> --- a/drivers/video/sis/sis_main.c
> +++ b/drivers/video/sis/sis_main.c
> @@ -4514,7 +4514,7 @@ sisfb_post_sis300(struct pci_dev *pdev)
>  	} else {
>  #endif
>  		/* Need to map max FB size for finding out about RAM size */
> -		mapsize = 64 << 20;
> +		mapsize = ivideo->video_size;
>  		sisfb_post_map_vram(ivideo, &mapsize, 4);
>  
>  		if(ivideo->video_vbase) {
> @@ -4680,7 +4680,7 @@ sisfb_post_xgi_ramsize(struct sis_video_info *ivideo)
>  	orSISIDXREG(SISSR, 0x20, (0x80 | 0x04));
>  
>  	/* Need to map max FB size for finding out about RAM size */
> -	mapsize = 256 << 20;
> +	mapsize = ivideo->video_size;
>  	sisfb_post_map_vram(ivideo, &mapsize, 32);
>  
>  	if(!ivideo->video_vbase) {
> 
sisfb_post_map_vram() expects that the mapsize >= min, and falls back on
the default aperture size otherwise. If you're going to pass in a
variable size for video_size then this expectation may no longer hold
true, and you've then changed the behaviour if an invalid size succeeds
on the initial ioremap() attempt.

Simply inserting a:

	if (*mapsize < min)
		return;

sanity check prior to the ioremap() should preserve the existing
behaviour.

      reply	other threads:[~2010-11-10  1:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 22:25 [PATCH] sisfb: limit POST memory test according to PCI resource length Aaro Koskinen
2010-11-10  1:03 ` Paul Mundt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101110010334.GA28852@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).