Skip to contentSkip to conversation

sc1200_wdt: Fix oops

PATCH In review Alan 2 participants 4 messages Dec 4, 2013 – Dec 5, 2013

Subsystems (2)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 sc1200_wdt: Fix oops

If loaded with isapnp = 0 the driver explodes. This is catching people out now and then. What should happen in the working case is a complete mystery and the code appears terminally confused, but we can at least make the error path work properly.

Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991

---
 drivers/watchdog/sc1200wdt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/sc1200wdt.c +2 -1
index 3b9fff9..131193a 100644
@@ -409,8 +409,9 @@ static int __init sc1200wdt_init(void)
 #if defined CONFIG_PNP
 	/* now that the user has specified an IO port and we haven't detected
 	 * any devices, disable pnp support */
+	if (isapnp)
+		pnp_unregister_driver(&scl200wdt_pnp_driver);
 	isapnp = 0;
-	pnp_unregister_driver(&scl200wdt_pnp_driver);
 #endif
 
 	if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Alan

If loaded with isapnp = 0 the driver explodes. This is catching people out now and then. What should happen in the working case is a complete mystery and the code appears terminally confused, but we

Looks like it uses the pnp infrastructure only to auto-detect the "io" address, and assumes that pnp_register_driver() calls the pnp probe function immediately. Afterwards it unregisters and works (or is supposed to work) outside the pnp subsystem. Brr.

Quoted 4 lines

can at least make the error path work properly.

Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991

Actually, I think it fully resolves it, because the other part (sc520 driver not working on SC1100 CPU) isn't a bug. It isn't working on an ARM or PPC CPU either, nor on any Intel CPU.

Anyway,

Quoted 25 lines
---
 drivers/watchdog/sc1200wdt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/sc1200wdt.c +2 -2
index 3b9fff9..131193a 100644
@@ -409,8 +409,9 @@ static int __init sc1200wdt_init(void)
 #if defined CONFIG_PNP
 	/* now that the user has specified an IO port and we haven't detected
 	 * any devices, disable pnp support */
+	if (isapnp)
+		pnp_unregister_driver(&scl200wdt_pnp_driver);
 	isapnp = 0;
-	pnp_unregister_driver(&scl200wdt_pnp_driver);
 #endif
 
 	if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
 
--

To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 10 lines · On Wed, 4 Dec 2013 08:31:18 -0800 Guenter Roeck <[email protected]> wrote:
Quoted 3 lines · Alan

If loaded with isapnp = 0 the driver explodes. This is catching people out now and then. What should happen in the working case is a complete mystery and the code appears terminally confused, but we

Looks like it uses the pnp infrastructure only to auto-detect the "io" address, and assumes that pnp_register_driver() calls the pnp probe function immediately. Afterwards it unregisters and works (or is supposed to work) outside the pnp subsystem. Brr.

Quoted 8 lines
Quoted 4 lines

can at least make the error path work properly.

Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991

Actually, I think it fully resolves it, because the other part (sc520 driver not working on SC1100 CPU) isn't a bug. It isn't working on an ARM or PPC CPU either, nor on any Intel CPU.

As far as I can tell the fact it fails on the sc1100 is also a bug - but the mess of idefs around PNP is impossible to figure out without some actual docs, time and real hardware.

Alan

maintainer
#3 lore raw
Quoted 18 lines · One Thousand Gnomes
Quoted 15 lines · On Wed, 4 Dec 2013 08:31:18 -0800 Guenter Roeck <[email protected]> wrote:
Quoted 3 lines · Alan

If loaded with isapnp = 0 the driver explodes. This is catching people out now and then. What should happen in the working case is a complete mystery and the code appears terminally confused, but we

Looks like it uses the pnp infrastructure only to auto-detect the "io" address, and assumes that pnp_register_driver() calls the pnp probe function immediately. Afterwards it unregisters and works (or is supposed to work) outside the pnp subsystem. Brr.

Quoted 4 lines

can at least make the error path work properly.

Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991

Quoted 8 lines
Quoted 3 lines

Actually, I think it fully resolves it, because the other part (sc520 driver not working on SC1100 CPU) isn't a bug. It isn't working on an ARM or PPC CPU either, nor on any Intel CPU.

As far as I can tell the fact it fails on the sc1100 is also a bug - but the mess of idefs around PNP is impossible to figure out without some actual docs, time and real hardware.

... unless isapnp was set to 0 via module parameter, or if SC1100 is not compatible with SC1200. But I agree, hard to say w/o datasheet and hw.

Either case, seems to me the driver is screaming for a substantial overhaul.

Guenter