From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262872AbTG2BxL (ORCPT ); Mon, 28 Jul 2003 21:53:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263319AbTG2BxL (ORCPT ); Mon, 28 Jul 2003 21:53:11 -0400 Received: from dns1.atmark-techno.com ([61.199.192.114]:7687 "EHLO dns1.atmark-techno.com") by vger.kernel.org with ESMTP id S262872AbTG2BxJ (ORCPT ); Mon, 28 Jul 2003 21:53:09 -0400 Date: Tue, 29 Jul 2003 10:53:06 +0900 From: Yasushi SHOJI To: Alan Cox Cc: Linux Kernel Mailing List Subject: Re: request_region for no dynamic bus sizing In-Reply-To: <1059439949.1870.6.camel@dhcp22.swansea.linux.org.uk> References: <20030728235555.5D4C03E610@dns1.atmark-techno.com> <1059439949.1870.6.camel@dhcp22.swansea.linux.org.uk> User-Agent: User-Agent: Wanderlust/2.10.1 MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Message-Id: <20030729015306.D4B613E610@dns1.atmark-techno.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At 29 Jul 2003 01:52:29 +0100, Alan Cox wrote: > > On Maw, 2003-07-29 at 00:55, Yasushi SHOJI wrote: > > the problem is, however, that because there is two memory region for > > one bus address, I have to call two request_region()s to avoid misuse. > > > > what i'd like to ask is that "is anyone using such kind of board to > > run linux? if so, how do you do?" > > Is there any reason you cannot fix request_region for your platform to > request both itself ? no, there is not. Actualy, I was looking at __request_region after I sent the previous message. What'd be the proper way to fix request_region for no dynamic bus sizing platform? use #ifdef in linux/ioport.h and call __request_region twice or fix __request_region? how about something like this? (haven't even compile) #define ADDR_OFFSET(x) WHATEVER(x) #define request_region(start,n,name) \ ({ struct resource * __r, __s; \ __r = __request_region(&ioport_resource, (start), (n), (name)); \ if (__r) { \ __s = __request_region(&ioport_resource, (ADDR_OFFSET(start)), (n), (name)); \ if (!__s) { \ __release_region(&ioport_resource, (start), (n), (name)); \ __r = NULL; \ } \ } \ __r; }) best regards, -- yashi