From owner-freebsd-current@FreeBSD.ORG Tue Jun 17 06:22:22 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 020FA37B40C for ; Tue, 17 Jun 2003 06:22:22 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9158243F75 for ; Tue, 17 Jun 2003 06:22:17 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h5HDM8kA068188; Tue, 17 Jun 2003 07:22:08 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 17 Jun 2003 07:21:24 -0600 (MDT) Message-Id: <20030617.072124.84361707.imp@bsdimp.com> To: craig@xfoil.gank.org From: "M. Warner Losh" In-Reply-To: <20030615211800.1a8c1ece.craig@xfoil.gank.org> References: <20030615211800.1a8c1ece.craig@xfoil.gank.org> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: Multiple cardbus devices? (RFI) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2003 13:22:22 -0000 Does the following, untested, patch help any better than your gross kludges? It forces 12 bit aligment of the allocations for CardBus devices as well as for 'R2' 16-bit devices (which were already forced). One might be able to share the 4k range between devices if one had, say, two xl cards (I'd have to look hard at the code to be sure), but very few machines are so memory constrained as to make that a big win for the hair it would add to the code. Warner Index: pccbb.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pccbb/pccbb.c,v retrieving revision 1.78 diff -u -r1.78 pccbb.c --- pccbb.c 12 Jun 2003 06:06:14 -0000 1.78 +++ pccbb.c 17 Jun 2003 13:18:30 -0000 @@ -1543,6 +1550,9 @@ start = cbb_start_mem; if (end < start) end = start; + if (RF_ALIGNMENT(flags) < CBB_MEMALIGN_BITS) + flags = (flags & ~RF_ALIGNMENT_MASK) | + rman_make_alignment_flags(CBB_MEMALIGN); break; } Index: pccbbreg.h =================================================================== RCS file: /home/ncvs/src/sys/dev/pccbb/pccbbreg.h,v retrieving revision 1.12 diff -u -r1.12 pccbbreg.h --- pccbbreg.h 23 Nov 2002 23:09:45 -0000 1.12 +++ pccbbreg.h 17 Jun 2003 13:18:31 -0000 @@ -75,7 +75,9 @@ #define CBBR_IOBASE1 0x34 /* len=4 */ #define CBBR_IOLIMIT1 0x38 /* len=4 */ #define CBB_MEMALIGN 4096 +#define CBB_MEMALIGN_BITS 12 #define CBB_IOALIGN 4 +#define CBB_IOALIGN_BITS 2 #define CBBR_INTRLINE 0x3c /* len=1 */ #define CBBR_INTRPIN 0x3d /* len=1 */