Date: Tue, 06 Apr 2004 11:04:23 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: freebsd@newipnet.com Cc: marc@mit.edu Subject: Re: pccbb pccard rman - Something is very wrong somewhere Message-ID: <20040406.110423.35013927.imp@bsdimp.com> In-Reply-To: <200404061255150877.0875F2E3@192.168.128.16> References: <200404042342100749.00809B29@192.168.128.16> <200404061255150877.0875F2E3@192.168.128.16>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200404061255150877.0875F2E3@192.168.128.16> "Carlos Velasco" <freebsd@newipnet.com> writes: : Hello, : : Investigating this problem, I have discovered two issues. : : One minor bug (off-by-1) in subr_rman.c: : : diff -ur sys/kern/subr_rman.c sysnew/kern/subr_rman.c : --- sys/kern/subr_rman.c Wed Jun 11 00:56:57 2003 : +++ sysnew/kern/subr_rman.c Tue Apr 6 11:41:23 2004 : @@ -234,7 +234,7 @@ : rstart += bound - (rstart & ~bmask); : } while ((rstart & amask) != 0 && rstart < end && : rstart < s->r_end); : - rend = ulmin(s->r_end, ulmax(rstart + count, end)); : + rend = ulmin(s->r_end, ulmax(rstart + count - 1, end)); : if (rstart > rend) { : DPRINTF(("adjusted start exceeds end\n")); : continue; This looks correct. It surprises me that it is there... : And the real problem, an alignment issue that prevents pccard to work: This is almost the real problem. : diff -ur sys/dev/pccbb/pccbbreg.h sysnew/dev/pccbb/pccbbreg.h : --- sys/dev/pccbb/pccbbreg.h Sat Aug 9 20:49:22 2003 : +++ sysnew/dev/pccbb/pccbbreg.h Tue Apr 6 11:40:13 2004 : @@ -74,8 +74,8 @@ : #define CBBR_IOLIMIT0 0x30 /* len=4 */ : #define CBBR_IOBASE1 0x34 /* len=4 */ : #define CBBR_IOLIMIT1 0x38 /* len=4 */ : -#define CBB_MEMALIGN 4096 : -#define CBB_MEMALIGN_BITS 12 : +#define CBB_MEMALIGN 65536 : +#define CBB_MEMALIGN_BITS 16 : #define CBB_IOALIGN 4 : #define CBB_IOALIGN_BITS 2 this is bogus. : We are aligning to 0x1000 (4096) and we should align to, at least, 0x10000 : (65536). : This solves the problem. This is a problem. : Can anyone review these patches and commit them if they are right? This isn't right. However, I'll generate a fix from my p4 tree. I'm having big problems with the new acpi code on my laptop in my p4 tree :-(. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040406.110423.35013927.imp>