Re: pccbb pccard rman - Something is very wrong somewhere

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Tue, 06 Apr 2004 11:04:23 -0600 (MDT)
In message: <200404061255150877.0875F2E3_at_192.168.128.16>
            "Carlos Velasco" <freebsd_at_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
: _at__at_ -234,7 +234,7 _at__at_
:  				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
: _at__at_ -74,8 +74,8 _at__at_
:  #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
Received on Tue Apr 06 2004 - 08:05:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:50 UTC