mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Frans Pop <elendil@planet.nl>,
	linux-kernel@vger.kernel.org,
	Arjan van de Ven <arjan@infradead.org>,
	tglx@tglx.de, mingo@elte.hu
Subject: Re: Warning/Oops report of the week of September 16th, 2008
Date: Fri, 26 Sep 2008 11:28:15 +0100	[thread overview]
Message-ID: <20080926112815.0f8e9de6@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <alpine.LFD.1.10.0809241541320.3265@nehalem.linux-foundation.org>

> In the meantime, that warning is just best ignored entirely. It's not a 
> kernel bug per se, or even anything that is fixable without changing 
> exported user interfaces that in my opinion aren't necessarily even 
> _worth_ changing (the only reasonable change is extending on the insane 
> interface that nobody cares about).

How about a quickfix for the moment. This ought to do the job. BTW I
disagree that the link should be to first, it would be best a link to the
active driver IMHO.

Has been Torvalds-tested only (ie it compiled)

--

parport: quickfix the proc registration bug

From: Alan Cox <alan@redhat.com>

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.

Signed-off-by: Alan Cox <alan@redhat.com>
---

 drivers/parport/share.c   |   13 ++++++++++---
 drivers/serial/8250_pci.c |    4 ++--
 include/linux/parport.h   |    4 ++++
 3 files changed, 16 insertions(+), 5 deletions(-)


diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index a8a62bb..0750dcb 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 6a0d7cd..986252e 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -326,6 +326,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];
 };

  parent reply	other threads:[~2008-09-26 10:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 16:22 Arjan van de Ven
2008-09-17  0:40 ` Jay Cliburn
2008-09-24 22:36 ` Frans Pop
2008-09-24 22:45   ` Linus Torvalds
2008-09-24 22:57     ` Arjan van de Ven
2008-09-24 23:00     ` Linus Torvalds
2008-09-24 23:12     ` Frans Pop
2008-09-24 23:18       ` Linus Torvalds
2008-09-26 10:28     ` Alan Cox [this message]
2008-09-27 15:21       ` Frans Pop

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=20080926112815.0f8e9de6@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=elendil@planet.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@tglx.de \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®