From: Rene Herman <rene.herman@keyaccess.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: Fritz Elfert <fritz@isdn4linux.de>, Karsten Keil <kkeil@suse.de>,
isdn4linux@listserv.isdn4linux.de,
Linux Kernel <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: [PATCH] ISDN: make ICN not auto-grab port 0x320
Date: Sat, 09 Aug 2008 19:39:53 +0200 [thread overview]
Message-ID: <489DD669.2090207@keyaccess.nl> (raw)
[-- Attachment #1: Type: text/plain, Size: 69 bytes --]
Hi Andrew.
Stop Breaking Ingo's Randconfig Testing, Part II.
Rene.
[-- Attachment #2: 0001-ISDN-make-ICN-not-auto-grab-port-0x320.patch --]
[-- Type: text/plain, Size: 2928 bytes --]
>From 6f6a39c8dbc42d69d6dd654821cae8214ec382d5 Mon Sep 17 00:00:00 2001
From: Rene Herman <rene.herman@gmail.com>
Date: Sat, 9 Aug 2008 18:12:12 +0200
Subject: [PATCH] ISDN: make ICN not auto-grab port 0x320
Grabbing ISA bus resources without anything or anyone telling us we
should can break boot on randconfig/allyesconfig builds by keeping
resources that are in fact owned by different hardware busy and does
as reported by Ingo Molnar.
Generally it's also dangerous to just poke at random I/O ports and
especially those in the range where other old easily confused ISA
hardware might live.
For this old I4L ISA ISDN driver, insist that the user specify the
port before grabbing it.
Users of this driver are nonexistent or howling mad and a one time
echo "options icn baseport=0x320" >> /etc/modprobe.conf
away from the old behaviour.
This is a deprecated driver (stack, even) but as long as it's in the
tree, might as well fix it I guess.
Signed-off-by: Rene Herman <rene.herman@gmail.com>
---
drivers/isdn/icn/icn.c | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index bf7997a..56fc1bd 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -13,8 +13,9 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
+#include <linux/isa.h>
-static int portbase = ICN_BASEADDR;
+static int portbase;
static unsigned long membase = ICN_MEMADDR;
static char *icn_id = "\0";
static char *icn_id2 = "\0";
@@ -1623,7 +1624,20 @@ icn_setup(char *line)
__setup("icn=", icn_setup);
#endif /* MODULE */
-static int __init icn_init(void)
+static int __devinit icn_isa_match(struct device *isa_dev, unsigned int id)
+{
+ int match = portbase != 0;
+
+ if (match)
+ dev_info(isa_dev, "portbase = %#x, membase = %#lx\n",
+ portbase, membase);
+ else
+ dev_err(isa_dev, "please specify portbase\n");
+
+ return match;
+}
+
+static int __devinit icn_isa_probe(struct device *isa_dev, unsigned int id)
{
char *p;
char rev[10];
@@ -1646,7 +1660,7 @@ static int __init icn_init(void)
return (icn_addcard(portbase, icn_id, icn_id2));
}
-static void __exit icn_exit(void)
+static int __devexit icn_isa_remove(struct device *isa_dev, unsigned int id)
{
isdn_ctrl cmd;
icn_card *card = cards;
@@ -1685,6 +1699,27 @@ static void __exit icn_exit(void)
iounmap(dev.shmem);
release_mem_region(dev.memaddr, 0x4000);
}
+ return 0;
+}
+
+static struct isa_driver icn_isa_driver = {
+ .match = icn_isa_match,
+ .probe = icn_isa_probe,
+ .remove = __devexit_p(icn_isa_remove),
+
+ .driver = {
+ .name = "icn"
+ }
+};
+
+static int __init icn_init(void)
+{
+ return isa_register_driver(&icn_isa_driver, 1);
+}
+
+static void __exit icn_exit(void)
+{
+ isa_unregister_driver(&icn_isa_driver);
printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n");
}
--
1.5.5
next reply other threads:[~2008-08-09 17:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-09 17:39 Rene Herman [this message]
2008-08-09 20:50 ` [PATCH] ISDN: make ICN not auto-grab port 0x320 Alan Cox
2008-08-11 23:48 ` Andrew Morton
2008-08-12 5:02 ` Rene Herman
2008-08-12 5:30 ` Andrew Morton
2008-08-12 13:08 ` Adrian Bunk
2008-08-12 13:26 ` Rene Herman
2008-08-12 13:43 ` Adrian Bunk
2008-08-12 13:53 ` Rene Herman
2008-08-12 14:03 ` Adrian Bunk
2008-08-12 14:45 ` Rene Herman
2008-08-12 15:23 ` Adrian Bunk
2008-08-12 13:46 ` Rene Herman
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=489DD669.2090207@keyaccess.nl \
--to=rene.herman@keyaccess.nl \
--cc=akpm@osdl.org \
--cc=fritz@isdn4linux.de \
--cc=isdn4linux@listserv.isdn4linux.de \
--cc=kkeil@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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