[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070420182029.GF20118@redhat.com>
Date: Fri, 20 Apr 2007 14:20:29 -0400
From: Dave Jones <davej@...hat.com>
To: "Preston A. Elder" <prez@...h.net>
Cc: linux-kernel@...r.kernel.org, greg@...ah.com
Subject: Re: AGPGart / AMD K7
On Fri, Apr 20, 2007 at 02:04:45PM -0400, Preston A. Elder wrote:
> Dave Jones wrote:
> > On Fri, Apr 20, 2007 at 12:53:31PM -0400, Preston A. Elder wrote:
> >
> > > Linux agpgart interface v0.101 (c) Dave Jones
> > > agpgart: DEBUG 0
> > > agpgart: DEBUG 1
> > > __pci_register_driver: In function
> > > __pci_register_driver: driver = agpgart-amdk7, multithread = 0
> > > __pci_register_driver: Before Spinlock
> > > __pci_register_driver: Before List Init
> > > __pci_register_driver: Before Driver Register
> > > __pci_register_driver: Error = 0
> > > __pci_register_driver: Returning 0
> > >
> > > The DEBUG 0 and 1 are coming from agp_amdk7_init()
> > > There is a DEBUG 2 at the top of agp_amdk7_probe(), even before
> > > pci_find_capability, but the function never gets called.
> >
> > bus_add_driver() returns 0 on error, but there's a few different
> > cases it can fail, which isn't helpful.
Actually I misparsed this function, see below..
> > Add some printk's to
> > the error cases there, and see if that gives any more clues.
> >
> Here you go:
This is odd..
> > > __pci_register_driver: Before Driver Register
> > > __pci_register_driver: Error = 0
> > > __pci_register_driver: Returning 0
That __pci_register_driver code is (presumably with your printk's added..)
error = driver_register(&drv->driver);
printk("Error = %d\n", error);
if (error) {
printk("Returning %d\n" error);
return error;
}
Which doesn't make much sense. If 'error' is 0, we shouldn't be
taking that second printk & return. What compiler version is this?
btw Greg, wtf does driver_register return a 0 as 'success' if it
completes the function, and 0 as 'failure' if !bus ?
That seems doomed to failure.
> Linux agpgart interface v0.101 (c) Dave Jones
> agpgart: DEBUG 0
> agpgart: DEBUG 1
> __pci_register_driver: In function
> __pci_register_driver: driver = agpgart-amdk7, multithread = 0
> __pci_register_driver: Before Spinlock
> __pci_register_driver: Before List Init
> __pci_register_driver: Before Driver Register
> bus_add_driver: In Function
> bus_add_driver: Before kobject_set_name (agpgart-amdk7)
> bus_add_driver: error = 0
> bus_add_driver: Before kobject_register
> bus_add_driver: error = 0
> bus_add_driver: Before driver_attach
> bus_add_driver: error = 0
> bus_add_driver: Before klist_add_tail
> bus_add_driver: Before module_add_driver
> bus_add_driver: Before driver_add_attrs
> bus_add_driver: error = 0
> bus_add_driver: Before add_bind_files
> bus_add_driver: error = 0
> bus_add_driver: Returning 0
> __pci_register_driver: Error = 0
> __pci_register_driver: Returning 0
So we completed bus_add_driver without failing, then popped back
up to __pci_register_driver and were somehow treated as
if we failed. *scratches head*
Dave
--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists