Re: Re: prism54: pci_request_regions failure

"Alec H. Peterson" <[email protected]>
Newsgroups gmane.linux.drivers.prism54.user
Message-ID <5C8F6F18EC2D83EA8A498F0D@[192.168.0.100]>
--On Friday, May 7, 2004 7:40 PM +0200 Jörg Esser <[email protected]> wrote:

>
> Ok this one works for me!

That was just a hack, the patch below is the way to go in the long run (you 
should pull out the mask change).

>
> I also tried your suggested patch but I don´t know how I should apply it
> right. (I use kernel 2.4.26 where the code looks the same)
>
> drivers/pcmcia/yenta.c that looks like this (in yenta_allocate_res(),
> kernel 2.4.25):
>
>        start = config_readl(socket, offset) & mask;
>        end = config_readl(socket, offset+4) | ~mask;
># if 1
>        if (!(type & IORESOURCE_IO) && (((end - start) < BRIDGE_SIZE_MIN)
> ||
>            (start & (end - start))))
>        {
>                printk(KERN_INFO "yenta %s: Preassigned resource start %lx
> end %lx too small or not aligned.\n", socket->dev->slot_name, start, end);
>                res->start = res->end = 0;
>        }
>        else
># endif
>        if (start && end > start) {
>                res->start = start;
>
> but I´m not a programmer. Can you provide me some more Info ? Or a diff
> file (for the patch program)? Should I also change mask = ~0x1fff; ?
> Or just apply the second code ?
>
> Let me know and I try my best.

I will attach a patch.  Change directories to drivers/pcmcia and apply this:

*** yenta.c.old Wed Feb 18 13:36:31 2004
--- yenta.c     Fri May  7 05:29:56 2004
***************
*** 753,758 ****
--- 753,767 ----

        start = config_readl(socket, offset) & mask;
        end = config_readl(socket, offset+4) | ~mask;
+ #if 1
+         if (!(type & IORESOURCE_IO) && (((end - start) < BRIDGE_SIZE_MIN) 
||
+             (start & (end - start))))
+       {
+               printk(KERN_INFO "yenta %s: Preassigned resource start %lx 
end %lx too small or not aligned.\n", socket->dev->slot_name, start, end);
+                 res->start = res->end = 0;
+         }
+         else
+ #endif
        if (start && end > start) {
                res->start = start;
                res->end = end;


>
> But the best is that with just the first patch all my problems are gone.
> My WG511 from Netgear now works out of the box.

That's fantastic!

I'm hoping to get feedback on my patch from the linux kernel people to see 
if it is viable on a macro scale, but I've talked with a few friends and 
they agree that it is straight-forward.

Alec
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.