[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for kernel 2.6.10-rc2
- From: Flavio Stanchina <flavio at stanchina dot net>
- Date: Mon, 15 Nov 2004 15:56:31 +0100
Jan De Luyck wrote:
Upgraded today to 2.6.10-rc2, the fglrx driver compiles but fails to insert
because of missing pci_find_class() function. This has been superseded by
pci_get_class(), changing the calls makes it work again.
Alexandru Fomin did the same patch, but I peeked at 2.6.10-rc1's
drivers/pci/search.c on www.kernel.org and I'm not sure it's correct to
just replace the old function with the new one: the comment on
pci_get_class() says that "the reference count to the device is
incremented" so I guess that calling it two times is not good. I'd
expect that we need to store the device pointer returned in pass 1 and
reuse it in pass 3.
Alex answered my concerns like this:
"I looked into it a little last night and I think we should decrement
the reference count by running pci_dev_put() after we finish useing the
device, or if it doesn't have the capabilities that we need. I didn't
understood yet verry well for what the refcount is used, but from
logical point of view, it's not right to let the kernel think a device
has more users then it really has."
"Personally, because I couldn't find the devices returned by
pci_get_class() reused in any other function, I would be tempted to run
pci_dev_put() as the last command of the while loops. I'm runing now a
version that just implements this, and I don't have any bugs yet, but I
want to test/learn more until I publish any patch."
Until we can get a firm answer on this (any kernel gurus on the list?)
I'm not including this patch in my sources. Also, AFAIK your patch would
not work on 2.6.9 because pci_get_class() doesn't exist before
2.6.10-rc1. Note however that the patch from Alex is included in a
subdirectory called "limbo" and it conditionally uses pci_get_class() or
pci_find_class() so it should compile correctly. I'll let you decide if
it also runs correctly. :)
--
Ciao, Flavio