From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2D4F3DDFC0 for ; Fri, 8 Aug 2008 08:15:31 +1000 (EST) Subject: Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions. From: Benjamin Herrenschmidt To: Grant Likely In-Reply-To: References: <20080806055214.30717.86092.stgit@trillian.secretlab.ca> <20080806060223.30717.35175.stgit@trillian.secretlab.ca> <1218061585.24157.246.camel@pasglop> Content-Type: text/plain Date: Fri, 08 Aug 2008 08:09:11 +1000 Message-Id: <1218146951.24157.305.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, paulus@samba.org, miltonm@bga.com Reply-To: benh@kernel.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2008-08-06 at 17:11 -0600, Grant Likely wrote: > I'm not sure what you're asking. Are you asking about this particular > test, or are you asking why I don't also test the size? Badly worded. I meant BAT sizes are masks of bits. IE, they are power of 2 and the BAT address must be aligned to that power of 2 (ie, the BAT matching uses the size as a bit mask of relevant bits to compare). Unless I misread, your code doesn't provide the necessary tests/rounding of size and alignment of the virtual address.. does it ? > I do this particular test to make absolute sure that the caller > absolutely understands the limitations of the block mapping. If they > call this with something that isn't 128k aligned, then I make it fail > immediately so the coder is forced to go and understand what they are > allowed to do. Basically, I'm reinforcing the fact that this is not > the same as ioremap(). > > I haven't decided yet if I should test size in the same way. > Thoughts? Ben.