All of lore.kernel.org
 help / color / mirror / Atom feed
* ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia?
@ 2009-11-24 21:37 Dominik Brodowski
  2009-11-24 23:16 ` Peter Stuge
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dominik Brodowski @ 2009-11-24 21:37 UTC (permalink / raw)
  To: x86; +Cc: Komuro, linux-pcmcia, linux-kernel

Hej!

One of the most problematic issues with the whole 16-bit PCMCIA subsystem on
the x86 architecture is the following: cards request iomem or ioport
resources, but the PCMCIA subsystem does and can not know reliably at what
addresses iomem and ioport resources may be used, without interfering with
any third hardware.

Currently, we utilize two approaches to correctly "guess" which iomem and
ioport resource areas are safe to use[*]:

- If the PCMCIA bridge resides behind a PCI-PCI bridge or a PCI root bridge
  with specific memory or I/O windows, these resoruces -- if not registered
  otherwise -- are made available to PCMCIA devices. This works great on
  modern hardware, and hasn't caused us any major hassles since its
  introduction in 2.6.13 or so.

- Userspace (pcmcia-cs or pcmciautils) parses /etc/pcmcia/config.opts and
  registers a couple of memory and I/O resources.

  This latter configuration file most often contains 
	include port 0x100-0x3af
	include memory 0xc0000-0xfffff
	include memory 0xa0000000-0xa0ffffff

And so Komuro (CCed) suggested to add these default resource entries to the
kernel, so that it can later use parts of these resource areas to enable
PCMCIA devices without userspace interaction.

Do you think it would be safe to enable these areas by (kernel) default on
x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
would be a boot option to disable this feature, and some tests are run on the
iomem and ioport resource areas.

Best,
	Dominik

[*] In addition, there are some tests which are run on iomem and ioport
resources before marking them as available to PCMCIA devices, but let's
ignore this aspect for the moment.

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

* Re: ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia?
  2009-11-24 21:37 ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia? Dominik Brodowski
@ 2009-11-24 23:16 ` Peter Stuge
  2009-11-25 11:36 ` Alan Cox
  2009-11-25 11:56 ` Komuro
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Stuge @ 2009-11-24 23:16 UTC (permalink / raw)
  To: x86, Komuro, linux-pcmcia, linux-kernel

Dominik Brodowski wrote:
> 	include port 0x100-0x3af
> 	include memory 0xc0000-0xfffff
> 	include memory 0xa0000000-0xa0ffffff
..
> Do you think it would be safe to enable these areas by (kernel)
> default on x86?

c0000-fffff is option ROM and BIOS land. Maybe every BIOS out there
is being a good boy/girl and actually adds entries to e820 or similar
but I would kindof like to stay away from the region anyway.

0xa0000000 is 2.5GB, so it's doomed on systems with >=2.5GB RAM. :(


//Peter

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

* Re: ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia?
  2009-11-24 21:37 ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia? Dominik Brodowski
  2009-11-24 23:16 ` Peter Stuge
@ 2009-11-25 11:36 ` Alan Cox
  2009-11-25 11:56 ` Komuro
  2 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2009-11-25 11:36 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: x86, Komuro, linux-pcmcia, linux-kernel

>   This latter configuration file most often contains 
> 	include port 0x100-0x3af
> 	include memory 0xc0000-0xfffff
> 	include memory 0xa0000000-0xa0ffffff

Which crashes older thinkpads, some ATI chipset systems and
usually anything containing an NE2000 clone in ISA space.

> And so Komuro (CCed) suggested to add these default resource entries to the
> kernel, so that it can later use parts of these resource areas to enable
> PCMCIA devices without userspace interaction.
> 
> Do you think it would be safe to enable these areas by (kernel) default on
> x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
> would be a boot option to disable this feature, and some tests are run on the
> iomem and ioport resource areas.

The problem you have is that you change the ordering.

If you load the ne2k ISA driver before pcmcia (as occurs now because of
it being done from user space) the resources get claimed first. If you do
it the other way around and test then merely reading an I/O register
mapped to an NE2K or most NE2K clones crashes the machine.

Are there any modern systems where the PCI based autoconfig is
insufficient, or is this just ancient stuff  ?

Alan

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

* Re: Re: ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia?
  2009-11-24 21:37 ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia? Dominik Brodowski
  2009-11-24 23:16 ` Peter Stuge
  2009-11-25 11:36 ` Alan Cox
@ 2009-11-25 11:56 ` Komuro
  2009-11-28 16:48   ` Dominik Brodowski
  2 siblings, 1 reply; 5+ messages in thread
From: Komuro @ 2009-11-25 11:56 UTC (permalink / raw)
  To: Peter Stuge; +Cc: x86, Komuro, linux-pcmcia, linux-kernel


Hi,

>c0000-fffff is option ROM and BIOS land. Maybe every BIOS out there
>is being a good boy/girl and actually adds entries to e820 or similar
>but I would kindof like to stay away from the region anyway.
>
>0xa0000000 is 2.5GB, so it's doomed on systems with >=2.5GB RAM. :(
>
>
>//Peter

(1)
The i82365(ISA-pcmcia controller) and some older card-bus controller
need the c000-fffff area to access the CIS instead of high memory area
(1MB above).

(2) 
Most of the PC that need the PCMCIA card is not so new.
and have less than 2.5GB.

Best Regards
Komuro


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

* Re: Re: ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia?
  2009-11-25 11:56 ` Komuro
@ 2009-11-28 16:48   ` Dominik Brodowski
  0 siblings, 0 replies; 5+ messages in thread
From: Dominik Brodowski @ 2009-11-28 16:48 UTC (permalink / raw)
  To: Komuro, Alan Cox, x86, linux-pcmcia, linux-kernel; +Cc: Peter Stuge

Hey,

On Wed, Nov 25, 2009 at 08:56:50PM +0900, Komuro wrote:
> > Do you think it would be safe to enable these areas by (kernel) default on
> > x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
> > would be a boot option to disable this feature, and some tests are run on the
> > iomem and ioport resource areas.
> 
> The problem you have is that you change the ordering.
> 
> If you load the ne2k ISA driver before pcmcia (as occurs now because of
> it being done from user space) the resources get claimed first. If you do
> it the other way around and test then merely reading an I/O register
> mapped to an NE2K or most NE2K clones crashes the machine.

... and even adding a late_initcall() has its problems.

> Are there any modern systems where the PCI based autoconfig is
> insufficient, or is this just ancient stuff  ?

I'm not familiar with embedded stuff, but usually PCI-based autoconfig
should be sufficient nowadays. Therefore, the only workable way seems to be
an optional module parameter

rsrc_nonstatic.include_io=0x100,0x3af,0x3e0,0x4ff,0x800,0x820,0xc00,0xcf7,0xa00,0xaff
rsrc_nonstatic.include_mem=0xc0000,0xfffff,0xa0000000,0xa0ffffff,0x60000000,0x60ffffff

or something like that. Thanks for the input!

Best,
	Dominik

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

end of thread, other threads:[~2009-11-28 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 21:37 ioports 0x100-0x3af and iomem 0xd000-0xdffff, 0xa0000000-0xa0ffffff -- safe to use on x86 for pcmcia? Dominik Brodowski
2009-11-24 23:16 ` Peter Stuge
2009-11-25 11:36 ` Alan Cox
2009-11-25 11:56 ` Komuro
2009-11-28 16:48   ` Dominik Brodowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.