linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	maks@sternwelten.at, Wink Saville <wink@saville.com>
Subject: [patch 23/30] Patch for nvidia divide by zero error for 7600 pci-express card
Date: Wed, 15 Nov 2006 18:43:55 -0800	[thread overview]
Message-ID: <20061116024823.045613000@sous-sol.org> (raw)
In-Reply-To: 20061116024332.124753000@sous-sol.org

[-- Attachment #1: patch-for-nvidia-divide-by-zero-error-for-7600-pci-express-card.patch --]
[-- Type: text/plain, Size: 3956 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Wink Saville <wink@saville.com>

The following patch resolves the divide by zero error I encountered on my
system:

	http://marc.10east.com/?l=linux-fbdev-devel&m=116058257024413&w=2

I accomplished this by merging what I thought was appropriate from:

	http://webcvs.freedesktop.org/xorg/driver/xf86-video-nv/src/

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 drivers/video/nvidia/nv_hw.c    |   12 +++++++++---
 drivers/video/nvidia/nv_setup.c |   18 +++++++++++++++++-
 drivers/video/nvidia/nv_type.h  |    1 +
 drivers/video/nvidia/nvidia.c   |   24 ++++++++++++------------
 4 files changed, 39 insertions(+), 16 deletions(-)

--- linux-2.6.18.2.orig/drivers/video/nvidia/nv_hw.c
+++ linux-2.6.18.2/drivers/video/nvidia/nv_hw.c
@@ -145,12 +145,18 @@ static void nvGetClocks(struct nvidia_pa
 
 	if (par->Architecture >= NV_ARCH_40) {
 		pll = NV_RD32(par->PMC, 0x4020);
-		P = (pll >> 16) & 0x03;
+		P = (pll >> 16) & 0x07;
 		pll = NV_RD32(par->PMC, 0x4024);
 		M = pll & 0xFF;
 		N = (pll >> 8) & 0xFF;
-		MB = (pll >> 16) & 0xFF;
-		NB = (pll >> 24) & 0xFF;
+		if (((par->Chipset & 0xfff0) == 0x0290) ||
+				((par->Chipset & 0xfff0) == 0x0390)) {
+			MB = 1;
+			NB = 1;
+		} else {
+			MB = (pll >> 16) & 0xFF;
+			NB = (pll >> 24) & 0xFF;
+		}
 		*MClk = ((N * NB * par->CrystalFreqKHz) / (M * MB)) >> P;
 
 		pll = NV_RD32(par->PMC, 0x4000);
--- linux-2.6.18.2.orig/drivers/video/nvidia/nv_setup.c
+++ linux-2.6.18.2/drivers/video/nvidia/nv_setup.c
@@ -359,6 +359,7 @@ int NVCommonSetup(struct fb_info *info)
 	case 0x0186:
 	case 0x0187:
 	case 0x018D:
+	case 0x0228:
 	case 0x0286:
 	case 0x028C:
 	case 0x0316:
@@ -382,6 +383,10 @@ int NVCommonSetup(struct fb_info *info)
 	case 0x034C:
 	case 0x0160:
 	case 0x0166:
+	case 0x0169:
+	case 0x016B:
+	case 0x016C:
+	case 0x016D:
 	case 0x00C8:
 	case 0x00CC:
 	case 0x0144:
@@ -639,12 +644,23 @@ int NVCommonSetup(struct fb_info *info)
 		par->fpHeight = NV_RD32(par->PRAMDAC, 0x0800) + 1;
 		par->fpSyncs = NV_RD32(par->PRAMDAC, 0x0848) & 0x30000033;
 
-		printk("Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
+		printk("nvidiafb: Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
 	}
 
 	if (monA)
 		info->monspecs = *monA;
 
+	if (!par->FlatPanel || !par->twoHeads)
+		par->FPDither = 0;
+
+	par->LVDS = 0;
+	if (par->FlatPanel && par->twoHeads) {
+		NV_WR32(par->PRAMDAC0, 0x08B0, 0x00010004);
+		if (par->PRAMDAC0[0x08b4] & 1)
+			par->LVDS = 1;
+		printk("nvidiafb: Panel is %s\n", par->LVDS ? "LVDS" : "TMDS");
+	}
+
 	kfree(edidA);
 	kfree(edidB);
 done:
--- linux-2.6.18.2.orig/drivers/video/nvidia/nv_type.h
+++ linux-2.6.18.2/drivers/video/nvidia/nv_type.h
@@ -129,6 +129,7 @@ struct nvidia_par {
 	int fpHeight;
 	int PanelTweak;
 	int paneltweak;
+	int LVDS;
 	int pm_state;
 	u32 crtcSync_read;
 	u32 fpSyncs;
--- linux-2.6.18.2.orig/drivers/video/nvidia/nvidia.c
+++ linux-2.6.18.2/drivers/video/nvidia/nvidia.c
@@ -1145,20 +1145,20 @@ static u32 __devinit nvidia_get_arch(str
 	case 0x0340:		/* GeForceFX 5700 */
 		arch = NV_ARCH_30;
 		break;
-	case 0x0040:
-	case 0x00C0:
-	case 0x0120:
+	case 0x0040:		/* GeForce 6800 */
+	case 0x00C0:		/* GeForce 6800 */
+	case 0x0120:		/* GeForce 6800 */
 	case 0x0130:
-	case 0x0140:
-	case 0x0160:
-	case 0x01D0:
-	case 0x0090:
-	case 0x0210:
-	case 0x0220:
+	case 0x0140:		/* GeForce 6600 */
+	case 0x0160:		/* GeForce 6200 */
+	case 0x01D0:		/* GeForce 7200, 7300, 7400 */
+	case 0x0090:		/* GeForce 7800 */
+	case 0x0210:		/* GeForce 6800 */
+	case 0x0220:		/* GeForce 6200 */
 	case 0x0230:
-	case 0x0240:
-	case 0x0290:
-	case 0x0390:
+	case 0x0240:		/* GeForce 6100 */
+	case 0x0290:		/* GeForce 7900 */
+	case 0x0390:		/* GeForce 7600 */
 		arch = NV_ARCH_40;
 		break;
 	case 0x0020:		/* TNT, TNT2 */

--

  parent reply	other threads:[~2006-11-16  2:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16  2:43 [patch 00/30] -stable review Chris Wright
2006-11-16  2:43 ` [patch 01/30] S390: user readable uninitialised kernel memory, take 2 Chris Wright
2006-11-16  2:43 ` [patch 02/30] POWERPC: Make alignment exception always check exception table Chris Wright
2006-11-16  2:43 ` [patch 03/30] SPARC64: Fix futex_atomic_cmpxchg_inatomic implementation Chris Wright
2006-11-16  2:43 ` [patch 04/30] Fix sys_move_pages when a NULL node list is passed Chris Wright
2006-11-16  2:43 ` [patch 05/30] splice: fix problem introduced with inode diet Chris Wright
2006-11-17  2:52   ` Dave Jones
2006-11-17  6:16     ` [stable] " Chris Wright
2006-11-16  2:43 ` [patch 06/30] SPARC: Fix missed bump of NR_SYSCALLS Chris Wright
2006-11-16  2:43 ` [patch 07/30] bcm43xx: Drain TX status before starting IRQs Chris Wright
2006-11-16 16:09   ` Larry Finger
2006-11-16 18:38     ` Chris Wright
2006-11-18 19:06   ` Larry Finger
2006-11-19  4:11     ` Chris Wright
2006-11-19 23:51     ` Dan Williams
2006-11-16  2:43 ` [patch 08/30] fix UFS superblock alignment issues Chris Wright
2006-11-16  2:43 ` [patch 09/30] ipmi_si_intf.c sets bad class_mask with PCI_DEVICE_CLASS Chris Wright
2006-11-16  2:43 ` [patch 10/30] init_reap_node() initialization fix Chris Wright
2006-11-16  2:43 ` [patch 11/30] USB: failure in usblps error path Chris Wright
2006-11-16  2:43 ` [patch 12/30] usbtouchscreen: use endpoint address from endpoint descriptor Chris Wright
2006-11-16  2:43 ` [patch 13/30] e1000: Fix regression: garbled stats and irq allocation during swsusp Chris Wright
2006-11-16  2:43 ` [patch 14/30] NET: __alloc_pages() failures reported due to fragmentation Chris Wright
2006-11-16  2:43 ` [patch 15/30] Input: psmouse - fix attribute access on 64-bit systems Chris Wright
2006-11-16  2:43 ` [patch 16/30] x86_64: Fix FPU corruption Chris Wright
2006-11-16  2:43 ` [patch 17/30] correct keymapping on Powerbook built-in USB ISO keyboards Chris Wright
2006-11-16  2:43 ` [patch 18/30] TCP: Dont use highmem in tcp hash size calculation Chris Wright
2006-11-16  2:43 ` [patch 19/30] NET: Set truesize in pskb_copy Chris Wright
2006-11-16  2:43 ` [patch 20/30] fix via586 irq routing for pirq 5 Chris Wright
2006-11-16  2:43 ` [patch 21/30] security/seclvl.c: fix time wrap (CVE-2005-4352) Chris Wright
2006-11-16  2:43 ` [patch 22/30] CPUFREQ: Make acpi-cpufreq unsticky again Chris Wright
2006-11-16  2:43 ` Chris Wright [this message]
2006-11-16  2:43 ` [patch 24/30] pci: dont try to remove sysfs files before they are setup Chris Wright
2006-11-16  2:43 ` [patch 25/30] block: Fix bad data direction in SG_IO Chris Wright
2006-11-16  2:43 ` [patch 26/30] Char: isicom, fix close bug Chris Wright
2006-11-16  2:43 ` [patch 27/30] cpqarray: fix iostat Chris Wright
2006-11-16  2:44 ` [patch 28/30] cciss: " Chris Wright
2006-11-16  2:44 ` [patch 29/30] CIFS: report rename failure when target file is locked by Windows Chris Wright
2006-11-16  2:44 ` [patch 30/30] CIFS: New POSIX locking code not setting rc properly to zero on successful Chris Wright
2006-11-16 21:57 ` [patch 00/30] -stable review Dave Jones
2006-11-16 22:22   ` Chris Wright

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=20061116024823.045613000@sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maks@sternwelten.at \
    --cc=mkrufky@linuxtv.org \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=wink@saville.com \
    --cc=zwane@arm.linux.org.uk \
    /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).