public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gunther.Mayer@t-online.de (Gunther Mayer)
To: linux-kernel@vger.kernel.org, mj@suse.cz, reinelt@eunet.at,
	twaugh@redhat.com, jgarzik@mandrakesoft.com
Subject: Re: PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport)
Date: Sat, 07 Apr 2001 20:42:35 +0200	[thread overview]
Message-ID: <3ACF5F9B.AA42F1BD@t-online.de> (raw)
In-Reply-To: <3ACECA8F.FEC9439@eunet.at> <3ACED679.7E334234@mandrakesoft.com> <20010407111419.B530@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3473 bytes --]

Tim Waugh wrote:
> 
> On Sat, Apr 07, 2001 at 04:57:29AM -0400, Jeff Garzik wrote:
> 
> > Where is this patch available?  I haven't heard of an extension to the
> > pci id tables, so I wonder if it's really in the queue for the official
> > kernel.
> 
> It is.  <URL:http://people.redhat.com/twaugh/patches/>  The
> 'extension' is just 'more entries', AFAIR.
> 
> > > I'm afraid this is not a bug, but a design issue, and will be hard to
> > > solve. Maybe we need a flag for such devices which allows it to be
> > > claimed ba more thean one driver?
> >
> > Not so hard.
> 
> *sigh* Jeff, when I spoke to you about this last year you said
>  'tough', or words to that effect. :-(
> 
> > There is no need to register more than one driver per PCI device -- just
> > create a PCI driver whose probe routine registers serial and parallel,
> > and whose remove routine unregisters same.
> 
> *cough* modularity *cough*
> 
> Wnat to show us some elegant code that does that?

Hardware has always needed quirks (linux-2.4.3 has about 60 occurences
of the word "quirks", not to mention workaround, blacklist and other synonyms)!

Please apply this little patch instead of wasting time by finger-pointing
and arguing.

Martin, comments?


Regards, Gunther 



--- linux-2.4.3-orig/include/linux/pci.h        Wed Apr  4 19:46:49 2001
+++ linux/include/linux/pci.h   Sat Apr  7 20:01:51 2001
@@ -454,6 +454,9 @@
        void (*remove)(struct pci_dev *dev);    /* Device removed (NULL if not a hot-plug capable driver) */
        void (*suspend)(struct pci_dev *dev);   /* Device suspended */
        void (*resume)(struct pci_dev *dev);    /* Device woken up */
+       int multifunction_quirks;               /* Quirks for PCI serial+parport cards,
+                                                   here multiple drivers are allowed to register
+                                                   for the same pci id match */
 };


--- linux-2.4.3-orig/drivers/pci/pci.c  Wed Apr  4 19:46:46 2001
+++ linux/drivers/pci/pci.c     Sat Apr  7 19:59:47 2001
@@ -453,7 +453,7 @@

        list_add_tail(&drv->node, &pci_drivers);
        pci_for_each_dev(dev) {
-               if (!pci_dev_driver(dev))
+               if (!pci_dev_driver(dev) || drv->multifunction_quirks)
                        count += pci_announce_device(drv, dev);
        }
        return count;
--- linux-2.4.3-orig/drivers/parport/parport_pc.c       Wed Apr  4 19:46:46 2001
+++ linux/drivers/parport/parport_pc.c  Sat Apr  7 20:18:37 2001
@@ -2539,6 +2539,7 @@
        name:           "parport_pc",
        id_table:       parport_pc_pci_tbl,
        probe:          parport_pc_pci_probe,
+       multifunction_quirks: 1,
 };

 static int __init parport_pc_init_superio (void)
--- linux-2.4.3-orig/drivers/char/serial.c      Wed Apr  4 19:46:43 2001
+++ linux/drivers/char/serial.c Sat Apr  7 20:00:00 2001
@@ -4178,7 +4178,7 @@
        for (i=0; timedia_data[i].num; i++) {
                ids = timedia_data[i].ids;
                for (j=0; ids[j]; j++) {
-                       if (pci_get_subvendor(dev) == ids[j]) {
+                       if (pci_get_subdevice(dev) == ids[j]) {
                                board->num_ports = timedia_data[i].num;
                                return 0;
                        }
@@ -4718,6 +4718,7 @@
        probe:          serial_init_one,
        remove:        serial_remove_one,
        id_table:       serial_pci_tbl,
+       multifunction_quirks: 1,
 };

[-- Attachment #2: gmdiff-lx243-pci-multi_io --]
[-- Type: application/octet-stream, Size: 1814 bytes --]

--- linux-2.4.3-orig/include/linux/pci.h	Wed Apr  4 19:46:49 2001
+++ linux/include/linux/pci.h	Sat Apr  7 20:01:51 2001
@@ -454,6 +454,9 @@
 	void (*remove)(struct pci_dev *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
 	void (*suspend)(struct pci_dev *dev);	/* Device suspended */
 	void (*resume)(struct pci_dev *dev);	/* Device woken up */
+	int multifunction_quirks;		/* Quirks for PCI serial+parport cards,
+						    here multiple drivers are allowed to register
+						    for the same pci id match */
 };
 
 
--- linux-2.4.3-orig/drivers/pci/pci.c	Wed Apr  4 19:46:46 2001
+++ linux/drivers/pci/pci.c	Sat Apr  7 19:59:47 2001
@@ -453,7 +453,7 @@
 
 	list_add_tail(&drv->node, &pci_drivers);
 	pci_for_each_dev(dev) {
-		if (!pci_dev_driver(dev))
+		if (!pci_dev_driver(dev) || drv->multifunction_quirks)
 			count += pci_announce_device(drv, dev);
 	}
 	return count;
--- linux-2.4.3-orig/drivers/parport/parport_pc.c	Wed Apr  4 19:46:46 2001
+++ linux/drivers/parport/parport_pc.c	Sat Apr  7 20:18:37 2001
@@ -2539,6 +2539,7 @@
 	name:		"parport_pc",
 	id_table:	parport_pc_pci_tbl,
 	probe:		parport_pc_pci_probe,
+	multifunction_quirks: 1,
 };
 
 static int __init parport_pc_init_superio (void)
--- linux-2.4.3-orig/drivers/char/serial.c	Wed Apr  4 19:46:43 2001
+++ linux/drivers/char/serial.c	Sat Apr  7 20:00:00 2001
@@ -4178,7 +4178,7 @@
 	for (i=0; timedia_data[i].num; i++) {
 		ids = timedia_data[i].ids;
 		for (j=0; ids[j]; j++) {
-			if (pci_get_subvendor(dev) == ids[j]) {
+			if (pci_get_subdevice(dev) == ids[j]) {
 				board->num_ports = timedia_data[i].num;
 				return 0;
 			}
@@ -4718,6 +4718,7 @@
        probe:          serial_init_one,
        remove:	       serial_remove_one,
        id_table:       serial_pci_tbl,
+       multifunction_quirks: 1,
 };
 
 

  reply	other threads:[~2001-04-07 18:42 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-07  8:06 Multi-function PCI devices Michael Reinelt
2001-04-07  8:57 ` Jeff Garzik
2001-04-07 10:14   ` Tim Waugh
2001-04-07 18:42     ` Gunther Mayer [this message]
2001-04-07 18:53       ` PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport) Jeff Garzik
2001-04-07 19:06         ` Tim Waugh
2001-04-07 20:24         ` Gunther Mayer
2001-04-07 22:26           ` Jeff Garzik
2001-04-08 20:45         ` Martin Mares
2001-04-19 16:33           ` [patch, take 1] parport_serial (was Re: PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport)) Tim Waugh
2001-04-07 19:03       ` PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport) Tim Waugh
2001-04-07 16:22         ` Gérard Roudier
2001-04-07 20:47           ` Gunther Mayer
2001-04-07 19:23         ` Jeff Garzik
2001-04-07 19:31           ` Tim Waugh
2001-04-07 20:21           ` Gunther Mayer
2001-04-07 21:45             ` Tim Waugh
2001-04-07 22:29             ` Jeff Garzik
2001-04-07 20:31           ` Gunther Mayer
2001-04-07 21:52             ` Jeff Garzik
2001-04-07 11:33   ` Multi-function PCI devices Michael Reinelt
2001-04-07 12:16     ` Tim Waugh
2001-04-07 14:06       ` Michael Reinelt
2001-04-07 13:18         ` Gérard Roudier
2001-04-07 18:36           ` Michael Reinelt
2001-04-07 18:44             ` Jeff Garzik
2001-04-08 11:38               ` Michael Reinelt
2001-04-13 22:51                 ` Jeff Garzik
2001-04-14  0:34                   ` Michael Reinelt
2001-04-07 17:23       ` Jeff Garzik
2001-04-07 19:08         ` Tim Waugh
2001-04-07 19:31           ` Jeff Garzik
2001-04-08 10:25           ` Kai Henningsen
2001-04-09 13:15   ` Henning P. Schmiedehausen
2001-04-07  9:04 ` Gérard Roudier
2001-04-07 13:24   ` Brian Gerst
2001-04-07 14:03     ` Michael Reinelt
2001-04-07 13:01       ` Gérard Roudier
2001-04-07 19:14         ` Tim Waugh
2001-04-07 17:26     ` Jeff Garzik
2001-04-07 19:00   ` Tim Waugh
2001-04-07 19:40     ` Jeff Garzik
2001-04-07 19:52       ` Tim Waugh
2001-04-08 12:05         ` Michael Reinelt
2001-04-08 12:41           ` Tim Waugh
2001-04-07 21:34 ` Linus Torvalds
     [not found] ` <200104072134.OAA11307@penguin.transmeta.com>
2001-04-07 21:58   ` Jeff Garzik

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=3ACF5F9B.AA42F1BD@t-online.de \
    --to=gunther.mayer@t-online.de \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@suse.cz \
    --cc=reinelt@eunet.at \
    --cc=twaugh@redhat.com \
    /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