From: Jiri Slaby <jirislaby@gmail.com>
To: "Ingo Korb" <ingo@akana.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: stallion driver dmesg notice
Date: Mon, 4 Jun 2007 10:44:17 +0200 (CEST) [thread overview]
Message-ID: <21118142571565213847@wsc.cz> (raw)
In-Reply-To: <466362EA.6369.44946011@ingo.akana.de>
Ingo Korb wrote:
> > > Should I test it with an EC8/64-PCI? The /32 (ab)uses an IDE controller
> > > chip as PCI interface, the /64 uses a PLX PCI9050.
> >
> > I don't undestand this. IDE grabs the device? This is possible and if yes,
> > I'll fix the IDE driver.
>
> Yes, IDE (specifically: generic IDE PCI support, generic.ko - not
> compiled into my kernel) can grab the device. It's using an IDE
> controller chip that reports itself as such, so that's not completely
> unreasonable.
Good, thanks for the info.
> > Could you please try the patch below?
>
> Oopsed:
>
> === Cut ===
> Unloading Stallion Multiport Serial Driver: version 5.6.0
> Stallion Multiport Serial Driver: version 5.6.0
> stallion 0000:00:0b.0: please, report this to LKML: 100b/d001/ffffff
> STALLION: EC8/32-PCI found, board=0 io=d200 irq=17 nrpanels=1 nrports=8
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000074
Okay, tty alloc after pci init, attached patch should fix it. Could you
retest?
> > stallion, don't fail with less than max panels
>
> I could try with more than one panel if neccecary - I think I have four 8-
> Port-Panels, one 8-Port-XP-Panel (different UART) and one 16-Port-Panel
> stored somewhere.
Doesn't matter, needs fix anyway.
--
stallion, alloc tty before pci devices init
this causes oops, because pci prboe function calls tty_register_device for
each device found.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit f6d5d1877b0f7ac82f5e1fec2ead0429eeb069c8
tree 31beaaee84ef718acc5401b3cb07a7f2e340f0fe
parent a6c3fb453e98ba32291a4fc5a7d843fb27359182
author Jiri Slaby <jirislaby@gmail.com> Mon, 04 Jun 2007 10:39:41 +0200
committer Jiri Slaby <jirislaby@gmail.com> Mon, 04 Jun 2007 10:39:41 +0200
drivers/char/stallion.c | 73 ++++++++++++++++++++++-------------------------
1 files changed, 34 insertions(+), 39 deletions(-)
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 9820f49..45bf2a2 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -4714,6 +4714,29 @@ static int __init stallion_module_init(void)
spin_lock_init(&stallion_lock);
spin_lock_init(&brd_lock);
+ stl_serial = alloc_tty_driver(STL_MAXBRDS * STL_MAXPORTS);
+ if (!stl_serial) {
+ retval = -ENOMEM;
+ goto err;
+ }
+
+ stl_serial->owner = THIS_MODULE;
+ stl_serial->driver_name = stl_drvname;
+ stl_serial->name = "ttyE";
+ stl_serial->major = STL_SERIALMAJOR;
+ stl_serial->minor_start = 0;
+ stl_serial->type = TTY_DRIVER_TYPE_SERIAL;
+ stl_serial->subtype = SERIAL_TYPE_NORMAL;
+ stl_serial->init_termios = stl_deftermios;
+ stl_serial->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
+ tty_set_operations(stl_serial, &stl_ops);
+
+ retval = tty_register_driver(stl_serial);
+ if (retval) {
+ printk("STALLION: failed to register serial driver\n");
+ goto err_frtty;
+ }
+
/*
* Find any dynamically supported boards. That is via module load
* line options.
@@ -4743,13 +4766,9 @@ static int __init stallion_module_init(void)
/* this has to be _after_ isa finding because of locking */
retval = pci_register_driver(&stl_pcidriver);
- if (retval && stl_nrbrds == 0)
- goto err;
-
- stl_serial = alloc_tty_driver(STL_MAXBRDS * STL_MAXPORTS);
- if (!stl_serial) {
- retval = -ENOMEM;
- goto err_pcidr;
+ if (retval && stl_nrbrds == 0) {
+ printk(KERN_ERR "STALLION: can't register pci driver\n");
+ goto err_unrtty;
}
/*
@@ -4760,43 +4779,18 @@ static int __init stallion_module_init(void)
printk("STALLION: failed to register serial board device\n");
stallion_class = class_create(THIS_MODULE, "staliomem");
- if (IS_ERR(stallion_class)) {
- retval = PTR_ERR(stallion_class);
- goto err_reg;
- }
+ if (IS_ERR(stallion_class))
+ printk("STALLION: failed to create class\n");
for (i = 0; i < 4; i++)
class_device_create(stallion_class, NULL,
MKDEV(STL_SIOMEMMAJOR, i), NULL,
"staliomem%d", i);
- stl_serial->owner = THIS_MODULE;
- stl_serial->driver_name = stl_drvname;
- stl_serial->name = "ttyE";
- stl_serial->major = STL_SERIALMAJOR;
- stl_serial->minor_start = 0;
- stl_serial->type = TTY_DRIVER_TYPE_SERIAL;
- stl_serial->subtype = SERIAL_TYPE_NORMAL;
- stl_serial->init_termios = stl_deftermios;
- stl_serial->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
- tty_set_operations(stl_serial, &stl_ops);
-
- retval = tty_register_driver(stl_serial);
- if (retval) {
- printk("STALLION: failed to register serial driver\n");
- goto err_clsdev;
- }
-
return 0;
-err_clsdev:
- for (i = 0; i < 4; i++)
- class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
- class_destroy(stallion_class);
-err_reg:
- unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
+err_unrtty:
+ tty_unregister_driver(stl_serial);
+err_frtty:
put_tty_driver(stl_serial);
-err_pcidr:
- pci_unregister_driver(&stl_pcidriver);
- stl_free_isabrds();
err:
return retval;
}
@@ -4825,8 +4819,6 @@ static void __exit stallion_module_exit(void)
tty_unregister_device(stl_serial,
brdp->brdnr * STL_MAXPORTS + j);
}
- tty_unregister_driver(stl_serial);
- put_tty_driver(stl_serial);
for (i = 0; i < 4; i++)
class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
@@ -4838,6 +4830,9 @@ static void __exit stallion_module_exit(void)
pci_unregister_driver(&stl_pcidriver);
stl_free_isabrds();
+
+ tty_unregister_driver(stl_serial);
+ put_tty_driver(stl_serial);
}
module_init(stallion_module_init);
next prev parent reply other threads:[~2007-06-04 8:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-03 20:08 stallion driver dmesg notice Ingo Korb
2007-06-03 21:14 ` Jiri Slaby
2007-06-03 22:13 ` [PATCH 1/1] Char: stallion, don't fail with less than max panels, " Jiri Slaby
[not found] ` <466362EA.6369.44946011@ingo.akana.de>
2007-06-04 8:44 ` Jiri Slaby [this message]
2007-06-04 10:19 ` Ingo Korb
2007-06-04 20:38 ` Ingo Korb
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=21118142571565213847@wsc.cz \
--to=jirislaby@gmail.com \
--cc=ingo@akana.de \
--cc=linux-kernel@vger.kernel.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 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.