Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 04-16-09, 04:46 PM   #1
pavlinux
Registered User
 
pavlinux's Avatar
 
Join Date: Feb 2006
Location: Moscow, Russia
Posts: 57
Talking Thank you Nvidia, for say thank for my patch 180.44 -> 180.50

Неre diff from my 180.44-2.6.30-rc2
180.44-2.6.30-rc2 patch and 180.50

Code:
--- ../../../../180.44/usr/src/nv/nv.c  2009-04-16 18:32:25.187243389 +0400
+++ nv.c        2009-04-15 07:59:01.000000000 +0400
@@ -16,7 +16,6 @@
 #include "os-agp.h"
 #include "nv-vm.h"
 #include "nv-reg.h"
-#include <linux/version.h>

 #ifdef MODULE_ALIAS_CHARDEV_MAJOR
 MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER);
@@ -594,11 +593,12 @@
      * Set the module owner to ensure that the reference
      * count reflects accesses to the proc files.
      */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
     proc_nvidia->owner = THIS_MODULE;
     proc_nvidia_cards->owner = THIS_MODULE;
     proc_nvidia_warnings->owner = THIS_MODULE;
 #endif
+
     for (j = 0; j < num_nv_devices; j++)
     {
         nvl = &nv_linux_devices[j];
@@ -617,9 +617,10 @@

         entry->data = nv;
         entry->read_proc = nv_kern_read_cardinfo;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
         entry->owner = THIS_MODULE;
 #endif
+
         if (nv_find_pci_capability(dev, PCI_CAP_ID_AGP))
         {
             /*
@@ -631,8 +632,9 @@
                 NV_PCI_DEV_PUT(dev);
                 goto failed;
             }
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-            entry->owner = THIS_MODULE;
+
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+            entry->owner = THIS_MODULE;
 #endif
             proc_nvidia_agp = entry;

@@ -644,9 +646,10 @@

             entry->data = nv;
             entry->read_proc = nv_kern_read_status;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-            entry->owner = THIS_MODULE;
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+            entry->owner = THIS_MODULE;
 #endif
+
             entry = create_proc_entry("host-bridge", flags, proc_nvidia_agp);
             if (!entry) {
                 NV_PCI_DEV_PUT(dev);
@@ -655,8 +658,8 @@

             entry->data = NULL;
             entry->read_proc = nv_kern_read_agpinfo;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-            entry->owner = THIS_MODULE;
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+            entry->owner = THIS_MODULE;
 #endif

             entry = create_proc_entry("card", flags, proc_nvidia_agp);
@@ -667,8 +670,8 @@

             entry->data = nv;
             entry->read_proc = nv_kern_read_agpinfo;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-            entry->owner = THIS_MODULE;
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+            entry->owner = THIS_MODULE;
 #endif
         }

@@ -680,16 +683,17 @@
         goto failed;

     entry->read_proc = nv_kern_read_version;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-    entry->owner = THIS_MODULE;
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+    entry->owner = THIS_MODULE;
 #endif
+
     entry = create_proc_entry("registry", flags, proc_nvidia);
     if (!entry)
         goto failed;

     entry->read_proc = nv_kern_read_registry;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-    entry->owner = THIS_MODULE;
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
+    entry->owner = THIS_MODULE;
 #endif

     return;
@@ -717,7 +721,7 @@

     entry->data = (void *)message;
     entry->read_proc = nv_kern_read_warning;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
     entry->owner = THIS_MODULE;
 #endif
 #endif

Variable NV_PROC_DIR_ENTRY_HAS_OWNER calculated via configure and equal #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
pavlinux is offline   Reply With Quote
Old 04-16-09, 05:12 PM   #2
Fackamato
User
 
Join Date: Mar 2005
Posts: 366
Default Re: Thank you Nvidia, for say thank for my patch 180.44 -> 180.50

I don't understand. You thank NVIDIA for breaking your patch...?
Fackamato is offline   Reply With Quote
Old 04-16-09, 05:20 PM   #3
zander
NVIDIA Corporation
 
zander's Avatar
 
Join Date: Aug 2002
Posts: 3,740
Default Re: Thank you Nvidia, for say thank for my patch 180.44 -> 180.50

pavlinux, patches submitted to NVIDIA via this forum or via linux-bugs@nvidia.com are always welcome and appreciated, especially if they enable other users to use kernels that are not supported out-of-the-box. We therefore do thank you for the patches you posted to address this problem, and apologize if you feel your were not given credit where credit was due.

However, please note that the number of options available to solve this particular problem are limited: the code could either be updated to never initialize the owner field, which might cause regressions on older Linux kernels, or the field initializations could be made conditional using the C pre-processor. If the latter option is chosen, the #if constructs will naturally look very similar. Please also note that the NV_PROC_DIR_ENTRY_HAS_OWNER #define is the result of a compile test that determines if the structure's owner field is available, rather than keying off of the Linux kernel version. This is because the Linux kernel version is insufficient: distributors commonly back-port upstream changes to distribution kernels - future Linux kernels with versions < 2.6.30 may pick up the changes. Further, it's not clear that 2.6.30 is the right cut-off.
zander is offline   Reply With Quote
Old 04-16-09, 05:23 PM   #4
pavlinux
Registered User
 
pavlinux's Avatar
 
Join Date: Feb 2006
Location: Moscow, Russia
Posts: 57
Default Re: Thank you Nvidia, for say thank for my patch 180.44 -> 180.50

Quote:
Originally Posted by zander View Post
We therefore do thank you for the patches you posted to address this problem
pavlinux is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
NVIDIA Driver 295.53 installs into kernel 3.4 without a patch! jdmcdaniel3 NVIDIA Linux 3 06-08-12 09:41 AM
Need Help Installing NVIDIA Tesla M2070Q in Linux RHEL5 Ferianto85 NVIDIA Linux 0 05-18-12 08:35 PM

All times are GMT -5. The time now is 11:55 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.