Re: PCI memory reservation failures

[email protected] (Luis R. Rodriguez)
Newsgroups gmane.linux.drivers.prism54.user,gmane.linux.drivers.madwifi.user
Organization Rutgers University Student Linux Users Group
Message-ID <[email protected]>
Hello Alec,

Post/fwd this to the [email protected]. You'll get more 
replies there with people with more experience. 

	Luis

On Thu, May 06, 2004 at 07:45:41PM -0600, Alec H. Peterson wrote:
> Sorry for the crosspost, but this issue seems to have surfaced for users of 
> both of these drivers.  And yes I know this is not describing a problem 
> with either of the drivers represented on these lists, but hopefully people 
> will find it relevant.
> 
> I believe I have found a fix to these problems.  The root cause of the 
> problem is the fact that the BIOS in question is not aligning the memory it 
> is assigning to the CardBus slots.  So the kernel is attempting to align it 
> on its own, but then another problem comes up because in this case there is 
> only 8K of memory available, and that is how much some of the cards need 
> (in some cases they need even more).  According to the yenta driver the 
> minimum amount of memory that should be allocated to each slot is 16K. 
> Anyway, I have put a patch into 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;
> 
> Basically it is doing sanity checking on the memory that the PCI BIOS has 
> pre-allocated, and if the sanity check fails it goes ahead and allocates a 
> new block of memory (that happens automatically further along in 
> yenta_allocate_res()).  With this patch in place I can now initialize and 
> use both PrismGT and Atheros cards with no problems.
> 
> I welcome any feedback or input about this.  If this is good, bad, or an 
> abomination against the kernel I would really like to hear about it.  I've 
> sent it to the linux-kernel list as well (I received some helpful 
> suggestions there) but I have not yet had any feedback about whether or not 
> this is a good thing.  I don't have a huge variety of systems to test this 
> against so I would really love to hear how this works on other systems.
> 
> Thanks!
> 
> Alec
> 
> _______________________________________________
> Prism54-users mailing list
> [email protected]
> http://prism54.org/mailman/listinfo/prism54-users

-- 
GnuPG Key fingerprint = 113F B290 C6D2 0251 4D84  A34A 6ADD 4937 E20A 525E
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAnxgwat1JN+IKUl4RAoejAKCBakQ6An0mpM8Iapex1B5Zh0Nz7QCdEhDE
PYY460TdEYpG1NV5D0COoqg=
=znjK
-----END PGP SIGNATURE-----
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.