rpms/kernel/F-11 linux-2.6-parport-quickfix-the-proc-registration-bug.patch, NONE, 1.1 kernel.spec, 1.1645, 1.1646

Chuck Ebbert cebbert at fedoraproject.org
Mon Jun 15 23:29:41 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17536

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-parport-quickfix-the-proc-registration-bug.patch 
Log Message:
Get rid of the annoying parport sysctl registration warning (#503773)
  (linux-2.6-parport-quickfix-the-proc-registration-bug.patch)

linux-2.6-parport-quickfix-the-proc-registration-bug.patch:

--- NEW FILE linux-2.6-parport-quickfix-the-proc-registration-bug.patch ---
From: Alan Cox <alan at etchedpixels.co.uk>
Date: Tue, 2 Jun 2009 15:58:10 +0000 (+0100)
Subject: parport: quickfix the proc registration bug
X-Git-Tag: v2.6.30-rc8~2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=05ad709d04799125ed85dd816fdb558258102172

parport: quickfix the proc registration bug

Ideally we should have a directory of drivers and a link to the 'active'
driver. For now just show the first device which is effectively the existing
semantics without a warning.

This is an update on the original buggy patch that I then forgot to
resubmit. Confusingly it was proposed by Red Hat, written by Etched Pixels
fixed and submitted by Intel ...

Resolves-Bug: http://bugzilla.kernel.org/show_bug.cgi?id=9749
Signed-off-by: Alan Cox <alan at linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 0ebca45..dffa5d4 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -614,7 +614,10 @@ parport_register_device(struct parport *port, const char *name,
 	 * pardevice fields. -arca
 	 */
 	port->ops->init_state(tmp, tmp->state);
-	parport_device_proc_register(tmp);
+	if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) {
+		port->proc_device = tmp;
+		parport_device_proc_register(tmp);
+	}
 	return tmp;
 
  out_free_all:
@@ -646,10 +649,14 @@ void parport_unregister_device(struct pardevice *dev)
 	}
 #endif
 
-	parport_device_proc_unregister(dev);
-
 	port = dev->port->physport;
 
+	if (port->proc_device == dev) {
+		port->proc_device = NULL;
+		clear_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags);
+		parport_device_proc_unregister(dev);
+	}
+
 	if (port->cad == dev) {
 		printk(KERN_DEBUG "%s: %s forgot to release port\n",
 		       port->name, dev->name);
diff --git a/include/linux/parport.h b/include/linux/parport.h
index e1f83c5..38a423e 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -324,6 +324,10 @@ struct parport {
 	int spintime;
 	atomic_t ref_count;
 
+	unsigned long devflags;
+#define PARPORT_DEVPROC_REGISTERED	0
+	struct pardevice *proc_device;	/* Currently register proc device */
+
 	struct list_head full_list;
 	struct parport *slaves[3];
 };


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1645
retrieving revision 1.1646
diff -u -p -r1.1645 -r1.1646
--- kernel.spec	15 Jun 2009 22:09:51 -0000	1.1645
+++ kernel.spec	15 Jun 2009 23:29:08 -0000	1.1646
@@ -764,6 +764,8 @@ Patch9304: linux-2.6-xen-check-for-nx-su
 Patch9305: linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
 Patch9307: linux-2.6.29-xen-disable-gbpages.patch
 
+Patch11000: linux-2.6-parport-quickfix-the-proc-registration-bug.patch
+
 # via nano: disable mwait, enable 64-bit padlock support
 Patch11100: via-centaur-merge-32-64-bit-init.patch
 Patch11101: via-nano-disable-mwait.patch
@@ -1440,6 +1442,9 @@ ApplyPatch linux-2.6-xen-check-for-nx-su
 ApplyPatch linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
 ApplyPatch linux-2.6.29-xen-disable-gbpages.patch
 
+# finally fix the proc registration bug (F11#503773 and others)
+ApplyPatch linux-2.6-parport-quickfix-the-proc-registration-bug.patch
+
 # via nano: disable mwait, add 64-bit padlock support
 ApplyPatch via-centaur-merge-32-64-bit-init.patch
 ApplyPatch via-nano-disable-mwait.patch
@@ -2038,6 +2043,10 @@ fi
 # and build.
 
 %changelog
+* Mon Jun 15 2009 Chuck Ebbert <cebbert at redhat.com> - 2.6.29.5-184
+- Get rid of the annoying parport sysctl registration warning (#503773)
+  (linux-2.6-parport-quickfix-the-proc-registration-bug.patch)
+
 * Mon Jun 15 2009 Chuck Ebbert <cebbert at redhat.com> - 2.6.29.5-183
 - Linux 2.6.29.5
 




More information about the fedora-extras-commits mailing list