Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Apr 2004 09:21:46 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        freebsd@newipnet.com
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: pccbb pccard rman - Something is very wrong somewhere
Message-ID:  <20040407.092146.40772577.imp@bsdimp.com>
In-Reply-To: <200404071245040782.0D909C4C@192.168.128.16>
References:  <20040406.162834.02299817.imp@bsdimp.com> <20040406.231324.131273745.imp@bsdimp.com> <200404071245040782.0D909C4C@192.168.128.16>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200404071245040782.0D909C4C@192.168.128.16>
            "Carlos Velasco" <freebsd@newipnet.com> writes:
: On 06/04/2004 at 23:13 M. Warner Losh wrote:
: 
: >: There's code that fails to properly align requests larger than 4k to
: >: the appropriate boundary.  Upping things to 64k just papers over that
: >: problem, and tends to be somewhat wasteful of resources.
: >
: >Hmmm, I should make the CIS mapping be on a 64k boundary and try a
: >bunch of the 'problem children' cards.  That might fix a lot of
: >problems...
: 
: That's that my patch does (or pretend):
: cbb0: PCI Memory allocated: 88000000
: cbb1: PCI Memory allocated: 88001000
: cis mem map 0xdc538000 (resource: 0x88010000)
: pccard0: ccr_res == 88010000-880103ff, base=ff80

Cool!  There's some unintended effects of doing this for ALL memory
allocations on the CardBus cards.  However, it is relatively easy to
fix in a slightly different way.  Here's the diffs I have in my tree.
Do they also solve the problems for you?  I've run with a 4k
allocation boundary locally, but that only helps slightly.

Warner

--- /dell/imp/FreeBSD/src/sys/dev/pccard/pccard_cis.c	Sun Oct 19 11:32:23 2003
+++ ./pccard_cis.c	Wed Apr  7 09:18:42 2004
@@ -126,9 +127,15 @@
 
 	/* allocate some memory */
 
+	/*
+	 * Some reports from the field suggest that a 64k memory boundary
+	 * helps card CIS being able to be read.  Try it here and see what
+	 * the results actually are.  I'm not sure I understand why this
+	 * would make cards work better, but it is easy enough to test.
+	 */
 	rid = 0;
-	res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 
-	    PCCARD_CIS_SIZE, RF_ACTIVE);
+	res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0,
+	    PCCARD_CIS_SIZE, RF_ACTIVE | rman_make_alignment_flags(64*1024));
 	if (res == NULL) {
 		device_printf(dev, "can't alloc memory to read attributes\n");
 		return -1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040407.092146.40772577.imp>