public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: linux-kernel@vger.kernel.org
Cc: Alessandro Suardi <alessandro.suardi@oracle.com>,
	Patrick Mochel <mochel@osdl.org>
Subject: Re: 2.5.19 OOPS in pcmcia setup code
Date: 01 Jun 2002 23:19:55 +0200	[thread overview]
Message-ID: <m2g006n1c4.fsf@ppro.localdomain> (raw)
In-Reply-To: <3CF6843C.6090101@oracle.com> <m2bsavpe0p.fsf@ppro.localdomain>

Peter Osterlund <petero2@telia.com> writes:

> My laptop also oopses on boot, but this patch makes things work again:

I get an oops also in pci_unregister_driver, which happens because
driver_list in the device structure is never initialized. I'm now
running with this patch which seems to work:

diff -u -r linux.orig/drivers/base/driver.c linux/drivers/base/driver.c
--- linux.orig/drivers/base/driver.c	Sat Jun  1 19:48:49 2002
+++ linux/drivers/base/driver.c	Sat Jun  1 13:28:41 2002
@@ -37,6 +37,7 @@
 	write_lock(&drv->bus->lock);
 	list_add(&drv->bus_list,&drv->bus->drivers);
 	write_unlock(&drv->bus->lock);
+	INIT_LIST_HEAD(&drv->devices);
 	driver_make_dir(drv);
 	put_driver(drv);
 	return 0;
diff -u -r linux.orig/drivers/pci/hotplug.c linux/drivers/pci/hotplug.c
--- linux.orig/drivers/pci/hotplug.c	Sat Jun  1 19:48:49 2002
+++ linux/drivers/pci/hotplug.c	Sat Jun  1 10:52:05 2002
@@ -61,7 +61,7 @@
 	struct list_head *ln;
 
 	for(ln=pci_bus_type.drivers.next; ln != &pci_bus_type.drivers; ln=ln->next) {
-		struct pci_driver *drv = list_entry(ln, struct pci_driver, node);
+		struct pci_driver *drv = list_entry(ln, struct pci_driver, driver.bus_list);
 		if (drv->remove && pci_announce_device(drv, dev))
 			break;
 	}
diff -u -r linux.orig/drivers/pci/pci-driver.c linux/drivers/pci/pci-driver.c
--- linux.orig/drivers/pci/pci-driver.c	Sat Jun  1 19:48:49 2002
+++ linux/drivers/pci/pci-driver.c	Sat Jun  1 19:41:58 2002
@@ -52,6 +52,7 @@
 	dev_probe_lock();
 	if (drv->probe(dev, id) >= 0) {
 		dev->driver = drv;
+		list_add_tail(&dev->dev.driver_list, &drv->driver.devices);
 		ret = 1;
 	}
 	dev_probe_unlock();
@@ -169,6 +170,7 @@
 		pci_dev->driver = NULL;
 		dev->driver = NULL;
 		list_del_init(&dev->driver_list);
+		node = drv->driver.devices.next;
 	}
 	put_driver(&drv->driver);
 }
diff -u -r linux.orig/include/linux/device.h linux/include/linux/device.h
--- linux.orig/include/linux/device.h	Sat Jun  1 19:48:50 2002
+++ linux/include/linux/device.h	Sat Jun  1 13:24:52 2002
@@ -125,7 +125,7 @@
 	struct list_head g_list;        /* node in depth-first order list */
 	struct list_head node;		/* node in sibling list */
 	struct list_head bus_list;	/* node in bus's list */
-	struct list_head driver_list;
+	struct list_head driver_list;	/* node in device_driver's list */
 	struct list_head children;
 	struct device 	* parent;
 

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

      reply	other threads:[~2002-06-01 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-30 19:57 2.5.19 OOPS in pcmcia setup code Alessandro Suardi
2002-06-01  9:03 ` Peter Osterlund
2002-06-01 21:19   ` Peter Osterlund [this message]

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=m2g006n1c4.fsf@ppro.localdomain \
    --to=petero2@telia.com \
    --cc=alessandro.suardi@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.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