[Prism54-users] Re: prism54: pci_request_regions failure

Alec H. Peterson ahp@hilander.com
Fri, 07 May 2004 11:36:54 -0600


--On Friday, May 7, 2004 7:40 PM +0200 J=F6rg Esser <jackfritt@boh.de> =
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=B4t 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 =3D config_readl(socket, offset) & mask;
>        end =3D 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 =3D res->end =3D 0;
>        }
>        else
># endif
>        if (start && end > start) {
>                res->start =3D start;
>
> but I=B4m not a programmer. Can you provide me some more Info ? Or a diff
> file (for the patch program)? Should I also change mask =3D ~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 =3D config_readl(socket, offset) & mask;
        end =3D 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=20
end %lx too small or not aligned.\n", socket->dev->slot_name, start, end);
+                 res->start =3D res->end =3D 0;
+         }
+         else
+ #endif
        if (start && end > start) {
                res->start =3D start;
                res->end =3D 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=20
if it is viable on a macro scale, but I've talked with a few friends and=20
they agree that it is straight-forward.

Alec