public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Multi-function PCI devices
@ 2001-04-07  8:06 Michael Reinelt
  2001-04-07  8:57 ` Jeff Garzik
                   ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Michael Reinelt @ 2001-04-07  8:06 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi there,

I've got a problem with my communication card: It's a PCI card with a
NetMos chip, and it provides two serial and one parallel port. It's not
officially supported by the linux kernel, so I wrote my own patch and
sent it to the parallel, serial and pci maintainer. The patch itself is
basically an extension of the pci id tables; and I hope it's in the
queue for the official kernel. 

The patch worked great for me with kernel 2.4.1 and .2, but no longer
with 2.4.3. The parallel port still works, but the serial port will not
be detected. I had a quite long debugging session last night (adding
printk's to the pci code takes some time, for you have to reboot to load
the new kernel), and I think I found the reason:

The card shows up on the PCI bus as one device. For the card provides
both serial and parallel ports, it will be driven by two subsystems, the
serial and the parallel driver.

I found that _either_ the parallel or the serial port works, depending
on which module you load first. The reason for this seems to be in
pci.c, especially in the pci_register_driver() function. It reads:

int pci_register_driver(struct pci_driver *drv)
{
	struct pci_dev *dev;
	int count = 0;

	list_add_tail(&drv->node, &pci_drivers);
	pci_for_each_dev(dev) {
		if (!pci_dev_driver(dev))
			count += pci_announce_device(drv, dev);
	}
	return count;
}


pci_announce_device() will be called only if there's no other driver
claiming the device. This explains why either the parallel or the serial
port will be detected: The first driver loaded will see the device, the
next drivers won't.

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?

In the meantime, what can I do to get both ports working?

TIA, Michael

-- 
netWorks       	                                  Vox: +43 316  692396
Michael Reinelt                                   Fax: +43 316  692343
Geisslergasse 4					  GSM: +43 676 3079941
A-8045 Graz, Austria			      e-mail: reinelt@eunet.at

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2001-04-19 16:34 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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     ` PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport) Gunther Mayer
2001-04-07 18:53       ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox