From: Andreas Bombe <andreas.bombe@munich.netsurf.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] yenta resource allocation fix
Date: Mon, 27 Aug 2001 00:58:46 +0200 [thread overview]
Message-ID: <20010827005846.B10483@storm.local> (raw)
This fixes the problem of the yenta_socket driver not allocating IO port
windows if they weren't already. This caused no ports to be available
to a inserted CardBus card which in turn made the tulip driver complain
since it can't run without IO ports.
I'm no expert on the PCI/CardBus bridge stuff, but let's see: The OR
operation on the range end register with 0xfff seems pretty bogus to me.
Also the "if (start && ..." was always true since start included the 32
bit IO flag. What my patch does is to mask out the IO flags on both
start and end if the resource is indeed an IO resource, which seems
correct to me.
Now everything works for me. If I had known the fix was so easy I would
never have bothered with pcmcia-cs. Well, there is a problem that it
only picks up every second card insertion, so I have to
insert/remove/insert for my card to be recognized, but then it works.
diff -ruN linux-2.4.orig/drivers/pcmcia/yenta.c linux-2.4/drivers/pcmcia/yenta.c
--- linux-2.4.orig/drivers/pcmcia/yenta.c Fri Jul 27 02:21:28 2001
+++ linux-2.4/drivers/pcmcia/yenta.c Sun Aug 26 23:26:17 2001
@@ -701,8 +701,14 @@
struct resource *root, *res;
u32 start, end;
u32 align, size, min, max;
+ u32 mask;
unsigned offset;
+ if (type & IORESOURCE_IO)
+ mask = PCI_CB_IO_RANGE_MASK;
+ else
+ mask = ~0U;
+
offset = 0x1c + 8*nr;
bus = socket->dev->subordinate;
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr;
@@ -715,8 +721,8 @@
if (!root)
return;
- start = config_readl(socket, offset);
- end = config_readl(socket, offset+4) | 0xfff;
+ start = config_readl(socket, offset) & mask;
+ end = config_readl(socket, offset+4) & mask;
if (start && end > start) {
res->start = start;
res->end = end;
--
Andreas E. Bombe <andreas.bombe@munich.netsurf.de> DSA key 0x04880A44
next reply other threads:[~2001-08-26 23:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-26 22:58 Andreas Bombe [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-08-28 23:33 [PATCH] yenta resource allocation fix Andreas Bombe
2001-08-29 1:23 ` Linus Torvalds
2001-08-29 13:48 ` Linus Torvalds
2001-08-29 21:20 ` Andreas Bombe
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=20010827005846.B10483@storm.local \
--to=andreas.bombe@munich.netsurf.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox