linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* request_region for no dynamic bus sizing
@ 2003-07-28 23:55 Yasushi SHOJI
  2003-07-29  0:52 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Yasushi SHOJI @ 2003-07-28 23:55 UTC (permalink / raw)
  To: linux-kernel

hello all,

I've been working on a cpu board (which is arm based, but not relevant
in this issue, IMO) which does _not_ have dynamic bus sizing
capability.

the way the board is setup is that there is memory region for both
8bit access and 16bit access for same bus address, so that one can use
either region for appropriate bus width access.

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?"

I just got sick fixing device driver everytime using on the board. ;p

tia,
--
        yashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: request_region for no dynamic bus sizing
  2003-07-28 23:55 request_region for no dynamic bus sizing Yasushi SHOJI
@ 2003-07-29  0:52 ` Alan Cox
  2003-07-29  1:53   ` Yasushi SHOJI
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2003-07-29  0:52 UTC (permalink / raw)
  To: yashi; +Cc: Linux Kernel Mailing List

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 ?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: request_region for no dynamic bus sizing
  2003-07-29  0:52 ` Alan Cox
@ 2003-07-29  1:53   ` Yasushi SHOJI
  0 siblings, 0 replies; 3+ messages in thread
From: Yasushi SHOJI @ 2003-07-29  1:53 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-29  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-28 23:55 request_region for no dynamic bus sizing Yasushi SHOJI
2003-07-29  0:52 ` Alan Cox
2003-07-29  1:53   ` Yasushi SHOJI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).