[PATCH v2] driver-core: Return EBUSY error instead of BUG_ON()

2018-05-04 Thread Florian Schmaus
into a BUG_ON() we print an error message identifying the driver but continue booting. Signed-off-by: Florian Schmaus <f...@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 ba9125

[PATCH v3 3/3] driver-core: print bus registration error value

2018-05-15 Thread Florian Schmaus
Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- drivers/base/driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/driver.c b/drivers/base/driver.c index afd5b08b7677..c68d35139c0f 100644 --- a/drivers/base/driver.c +++ b/drivers/base/dr

[PATCH v3 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-15 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - return EINVAL (instead of EBUSY) - follow common patt

[PATCH v3 0/3] return EINVAL error instead of BUG_ON()

2018-05-15 Thread Florian Schmaus
if you have further suggestions. Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 2 ++ drivers/base/driver.c | 7 ++- include/linux/device.h

[PATCH v3 2/3] driver-core: record error on bus registration

2018-05-15 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- drivers/base/bus.c | 2 ++ include/linux/device.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/base/bus.c b/d

[PATCH v5 2/3] driver-core: record error on bus registration

2018-05-16 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Also record ENOMEM error code. drivers/base/bus.c | 6 +- include/linux/device.h | 1 + 2 files changed, 6 inse

Re: [PATCH v4 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
On 16.05.2018 17:39, Greg Kroah-Hartman wrote: > On Wed, May 16, 2018 at 02:05:25PM +0200, Florian Schmaus wrote: >> I triggerd the BUG_ON() in driver_register() when booting a domU Xen >> domain. Since there was no contextual information logged, I needed to >> attach kgdb to

[PATCH v5 0/3] return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
gister() was never called before. Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 6 +- drivers/base/driver.c | 12 +++- include

[PATCH v5 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
If driver_register() is called with an device driver which previously called bus_register() but failed, then print out the bus_register() error code. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Do not split long strings across lines. drivers/base/driver.

[PATCH v5 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Do not split long strings across lines. drivers/base/driver

[PATCH v4 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Use correct member name 'bus_register_error' - Only print out error code if it is non-zero drivers/base/bus.c| 4 +++- drivers/base/driver.c | 13 ++--- 2 files changed, 13 insertions(+), 4 deletions(-)

[PATCH v4 2/3] driver-core: record error on bus registration

2018-05-16 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Also record ENOMEM error if initial alloc fails drivers/base/bus.c | 2 ++ include/linux/device.h | 1 + 2 files c

[PATCH v4 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: - Also print out the bus name - Use pr_err() instead of pr

[PATCH v4 0/3] return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
. The third and final patch of the series extends the first patch so that the recorded error code is also print out if non-zero. Otherwhise, if drv->bus->p is NULL but the error code is zero, then probably bus_register() was never called before. Florian Schmaus (3): driver-core: return EINVAL

Re: [PATCH v4 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
On 16.05.2018 14:05, Florian Schmaus wrote: > Signed-off-by: Florian Schmaus <f...@geekplace.eu> > --- > > Notes: > - Use correct member name 'bus_register_error' > - Only print out error code if it is non-zero > > drivers/base/bus.c| 4 +++-

[PATCH v6 3/3] driver-core: print bus registration error value

2018-05-23 Thread Florian Schmaus
If driver_register() is called with an device driver which previously called bus_register() but failed, then print out the bus_register() error code. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: Make it clear in the error message that the error code is from t

[PATCH v6 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-23 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: Make it clear in the error message that the bus was

[PATCH v6 0/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-23 Thread Florian Schmaus
;20180516163707.gd20...@kroah.com> Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 9 +++-- drivers/base/driver.c | 12 +++- incl

[PATCH v6 2/3] driver-core: record error on bus registration

2018-05-23 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus <f...@geekplace.eu> --- Notes: Also record ENOMEM error drivers/base/bus.c | 9 +++-- include/linux/device.h | 1 + 2 files changed, 8 inse

[PATCH 3/3] bcache: do not assign in if condition in bcache_device_init()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers

[PATCH 0/3] bcache: Fix variable assignment in if condition in super.c

2018-06-18 Thread Florian Schmaus
This patch set attempts to improve bcache's super.c code by moving the assignment of variables out of 'if' conditions. It does not address all occurences of this style issue (which is reported as error by checkpatch.pl). Florian Schmaus (3): bcache: do not assign in if condition register_bcache

[PATCH 2/3] bcache: do not assign in if condition in bcache_init()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md

[PATCH 1/3] bcache: do not assign in if condition register_bcache()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache

Re: [PATCH] driver-core: Log the BUG() causing driver

2018-03-07 Thread Florian Schmaus
On 07.03.2018 16:13, Greg Kroah-Hartman wrote: > On Wed, Mar 07, 2018 at 10:49:02AM +0100, Florian Schmaus wrote: >> I triggerd the BUG_ON(), which was added in >> f48f3febb2cbfd0f2ecee7690835ba745c1034a4, when booting a domU Xen >> domain. > > How? Basically just

[PATCH] driver-core: Log the BUG() causing driver

2018-03-07 Thread 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 &l

[PATCH v3 3/3] driver-core: print bus registration error value

2018-05-15 Thread Florian Schmaus
Signed-off-by: Florian Schmaus --- drivers/base/driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/driver.c b/drivers/base/driver.c index afd5b08b7677..c68d35139c0f 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -149,8 +149,9 @@ int

[PATCH v3 2/3] driver-core: record error on bus registration

2018-05-15 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus --- drivers/base/bus.c | 2 ++ include/linux/device.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/base/bus.c b/drivers/base/bus.c index

[PATCH v3 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-15 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus --- Notes: - return EINVAL (instead of EBUSY) - follow common pattern when quoting commits

[PATCH v3 0/3] return EINVAL error instead of BUG_ON()

2018-05-15 Thread Florian Schmaus
if you have further suggestions. Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 2 ++ drivers/base/driver.c | 7 ++- include/linux/device.h

[PATCH v2] driver-core: Return EBUSY error instead of BUG_ON()

2018-05-04 Thread Florian Schmaus
into a BUG_ON() we print an error message identifying the driver but continue booting. Signed-off-by: Florian Schmaus --- 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..63baec586eba 100644

[PATCH v4 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
Signed-off-by: Florian Schmaus --- Notes: - Use correct member name 'bus_register_error' - Only print out error code if it is non-zero drivers/base/bus.c| 4 +++- drivers/base/driver.c | 13 ++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/base

[PATCH v4 2/3] driver-core: record error on bus registration

2018-05-16 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus --- Notes: - Also record ENOMEM error if initial alloc fails drivers/base/bus.c | 2 ++ include/linux/device.h | 1 + 2 files changed, 3 insertions

[PATCH v4 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus --- Notes: - Also print out the bus name - Use pr_err() instead of printk() drivers/base/dr

[PATCH v4 0/3] return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
. The third and final patch of the series extends the first patch so that the recorded error code is also print out if non-zero. Otherwhise, if drv->bus->p is NULL but the error code is zero, then probably bus_register() was never called before. Florian Schmaus (3): driver-core: return EINVAL

Re: [PATCH v4 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
On 16.05.2018 14:05, Florian Schmaus wrote: > Signed-off-by: Florian Schmaus > --- > > Notes: > - Use correct member name 'bus_register_error' > - Only print out error code if it is non-zero > > drivers/base/bus.c| 4 +++- > drivers/base/driver.c |

Re: [PATCH v4 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
On 16.05.2018 17:39, Greg Kroah-Hartman wrote: > On Wed, May 16, 2018 at 02:05:25PM +0200, Florian Schmaus wrote: >> I triggerd the BUG_ON() in driver_register() when booting a domU Xen >> domain. Since there was no contextual information logged, I needed to >> attach kgdb to

[PATCH v5 0/3] return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
gister() was never called before. Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 6 +- drivers/base/driver.c | 12 +++- include

[PATCH v5 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-16 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus --- Notes: - Do not split long strings across lines. drivers/base/driver.c | 6 +- 1 file

[PATCH v5 2/3] driver-core: record error on bus registration

2018-05-16 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus --- Notes: - Also record ENOMEM error code. drivers/base/bus.c | 6 +- include/linux/device.h | 1 + 2 files changed, 6 insertions(+), 1 deletion

[PATCH v5 3/3] driver-core: print bus registration error value

2018-05-16 Thread Florian Schmaus
If driver_register() is called with an device driver which previously called bus_register() but failed, then print out the bus_register() error code. Signed-off-by: Florian Schmaus --- Notes: - Do not split long strings across lines. drivers/base/driver.c | 10 -- 1 file changed

[PATCH] driver-core: Log the BUG() causing driver

2018-03-07 Thread 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 --- drivers

Re: [PATCH] driver-core: Log the BUG() causing driver

2018-03-07 Thread Florian Schmaus
On 07.03.2018 16:13, Greg Kroah-Hartman wrote: > On Wed, Mar 07, 2018 at 10:49:02AM +0100, Florian Schmaus wrote: >> I triggerd the BUG_ON(), which was added in >> f48f3febb2cbfd0f2ecee7690835ba745c1034a4, when booting a domU Xen >> domain. > > How? Basically just

[PATCH v6 1/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-23 Thread Florian Schmaus
river with bus_type not registered"). Instead of running into a BUG_ON() we print an error message identifying the, likely faulty, driver but continue booting. Signed-off-by: Florian Schmaus --- Notes: Make it clear in the error message that the bus was not initialized and *not*

[PATCH v6 0/3] driver-core: return EINVAL error instead of BUG_ON()

2018-05-23 Thread Florian Schmaus
;20180516163707.gd20...@kroah.com> Florian Schmaus (3): driver-core: return EINVAL error instead of BUG_ON() driver-core: record error on bus registration driver-core: print bus registration error value drivers/base/bus.c | 9 +++-- drivers/base/driver.c | 12 +++- incl

[PATCH v6 2/3] driver-core: record error on bus registration

2018-05-23 Thread Florian Schmaus
If bus_register() fails on a driver then record the error code so that it can be inspected later on. Signed-off-by: Florian Schmaus --- Notes: Also record ENOMEM error drivers/base/bus.c | 9 +++-- include/linux/device.h | 1 + 2 files changed, 8 insertions(+), 2 deletions

[PATCH v6 3/3] driver-core: print bus registration error value

2018-05-23 Thread Florian Schmaus
If driver_register() is called with an device driver which previously called bus_register() but failed, then print out the bus_register() error code. Signed-off-by: Florian Schmaus --- Notes: Make it clear in the error message that the error code is from the bus registration

[PATCH 2/3] bcache: do not assign in if condition in bcache_init()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md

[PATCH 1/3] bcache: do not assign in if condition register_bcache()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache

[PATCH 0/3] bcache: Fix variable assignment in if condition in super.c

2018-06-18 Thread Florian Schmaus
This patch set attempts to improve bcache's super.c code by moving the assignment of variables out of 'if' conditions. It does not address all occurences of this style issue (which is reported as error by checkpatch.pl). Florian Schmaus (3): bcache: do not assign in if condition register_bcache

[PATCH 3/3] bcache: do not assign in if condition in bcache_device_init()

2018-06-18 Thread Florian Schmaus
Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus --- drivers/md/bcache/super.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers