All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver-core: Log the BUG() causing driver
@ 2018-03-07  9:49 Florian Schmaus
  2018-03-07 15:13 ` Greg Kroah-Hartman
  2018-05-04 13:23 ` [PATCH v2] driver-core: Return EBUSY error instead of BUG_ON() Florian Schmaus
  0 siblings, 2 replies; 39+ messages in thread
From: Florian Schmaus @ 2018-03-07  9:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Florian Schmaus

I triggerd the BUG_ON(), which was added in
f48f3febb2cbfd0f2ecee7690835ba745c1034a4, when booting a domU Xen
domain. Since there was no contextual information logged, I needed to
attach kgdb to determine the culprit (the wmi-bmof driver in my case).

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
---
 drivers/base/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index ba912558a510..55f8db41df2b 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -148,7 +148,11 @@ int driver_register(struct device_driver *drv)
 	int ret;
 	struct device_driver *other;
 
-	BUG_ON(!drv->bus->p);
+	if (!drv->bus->p) {
+		printk(KERN_ERR "Driver '%s' was unable to register bus_type\n",
+			   drv->name);
+		BUG();
+	}
 
 	if ((drv->bus->probe && drv->probe) ||
 	    (drv->bus->remove && drv->remove) ||
-- 
2.13.6

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

end of thread, other threads:[~2018-05-25 16:22 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07  9:49 [PATCH] driver-core: Log the BUG() causing driver Florian Schmaus
2018-03-07 15:13 ` Greg Kroah-Hartman
2018-03-07 15:36   ` Florian Schmaus
2018-05-04 13:23 ` [PATCH v2] driver-core: Return EBUSY error instead of BUG_ON() Florian Schmaus
2018-05-04 17:37   ` Greg Kroah-Hartman
2018-05-04 17:38   ` Greg Kroah-Hartman
2018-05-15 13:51   ` [PATCH v3 0/3] return EINVAL " Florian Schmaus
2018-05-16 12:05     ` [PATCH v4 " Florian Schmaus
2018-05-16 16:08       ` [PATCH v5 " Florian Schmaus
2018-05-23 15:59         ` [PATCH v6 0/3] driver-core: " Florian Schmaus
2018-05-25 16:21           ` Greg Kroah-Hartman
2018-05-23 15:59         ` [PATCH v6 1/3] " Florian Schmaus
2018-05-23 15:59         ` [PATCH v6 2/3] driver-core: record error on bus registration Florian Schmaus
2018-05-23 15:59         ` [PATCH v6 3/3] driver-core: print bus registration error value Florian Schmaus
2018-05-16 16:08       ` [PATCH v5 1/3] driver-core: return EINVAL error instead of BUG_ON() Florian Schmaus
2018-05-16 16:35         ` Greg Kroah-Hartman
2018-05-16 16:08       ` [PATCH v5 2/3] driver-core: record error on bus registration Florian Schmaus
2018-05-16 16:35         ` Greg Kroah-Hartman
2018-05-16 16:08       ` [PATCH v5 3/3] driver-core: print bus registration error value Florian Schmaus
2018-05-16 16:37         ` Greg Kroah-Hartman
2018-05-16 12:05     ` [PATCH v4 1/3] driver-core: return EINVAL error instead of BUG_ON() Florian Schmaus
2018-05-16 15:39       ` Greg Kroah-Hartman
2018-05-16 16:07         ` Florian Schmaus
2018-05-16 12:05     ` [PATCH v4 2/3] driver-core: record error on bus registration Florian Schmaus
2018-05-17 13:08       ` kbuild test robot
2018-05-16 12:05     ` [PATCH v4 3/3] driver-core: print bus registration error value Florian Schmaus
2018-05-16 12:09       ` Florian Schmaus
2018-05-16 15:38         ` Greg Kroah-Hartman
2018-05-16 15:37       ` Greg Kroah-Hartman
2018-05-17  8:10       ` kbuild test robot
2018-05-15 13:51   ` [PATCH v3 1/3] driver-core: return EINVAL error instead of BUG_ON() Florian Schmaus
2018-05-15 15:10     ` Greg Kroah-Hartman
2018-05-15 15:13       ` Greg Kroah-Hartman
2018-05-15 13:51   ` [PATCH v3 2/3] driver-core: record error on bus registration Florian Schmaus
2018-05-16  8:50     ` kbuild test robot
2018-05-15 13:51   ` [PATCH v3 3/3] driver-core: print bus registration error value Florian Schmaus
2018-05-15 15:12     ` Greg Kroah-Hartman
2018-05-16  8:24     ` kbuild test robot
2018-05-16  8:35     ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.