Re: Memory region check in drivers/pcmcia/rsrc_mgr.c

Linus Torvalds (torvalds@transmeta.com)
Sat, 7 Jul 2001 11:13:40 -0700 (PDT)


On Sat, 7 Jul 2001, Paul Mackerras wrote:
>
> The patch below does this (and makes a similar correction for I/O
> space). With this patch applied, the pcmcia stuff works fine on my
> powerbook, and I end up with something like this in /proc/iomem:

This is wrong.

The reason it currently uses the rather fascist check_resource() is that
the thing needs a completely _unallocated_ region.

By changing it to use "check_region" instead of "check_resource()", you
allow the PCMCIA code to use an already allocated (but not in use) PCI
region. That is not what the code is meant to do - you might find that the
yenta code suddenly starts allocating the PCMCIA resources inside another
PCI device that just hasn't marked its resources busy yet.

This is, in fact, exactly what happens for you: it allocates the resources
inside your PCI bridge mappings. Which happens to be what you want in this
case, but it's not right in general.

> Linus, would you apply this patch to your tree?

I don't think so.

HOWEVER, you can change the resource checking to use the proper "parent
resource" instead of using the root resource. I absolutely agree that
using the root resource is wrong per se - it depends (incorrectly) on the
fact that on all laptops the PCMCIA controller tends to be on the root
bus.

Note that the CardBus side gets this all right - I assume that a 32-bit
CardBus card with a PCI driver should work on your powerbook even without
this patch, no?

It's only the old-style PCMCIA resource management that is fairly broken.
It may be that you rpatch might be an acceptable band-aid, but I really
think that the problem should be solved differently.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/