Re: Questions about ioport-assignments

2010-04-16 Thread Komuro
Hi,

 Wolfram wrote:
 
 - Is it just a buggy card if it works at 0x300 but not 0xc300
   (or is it maybe a problem with Linux assigning the io area)?
 - Why is IOAddrLines forced to 16 (and thus alignment to 0x1), but only
   if BasePort1 is 0?
 

In this case, 
start = 0xc000, 
align_data-mask = 0x3ff, 
align_data-offset = 0x300
then ret becomes 0xc300;

but ret should be 0x300.

static resource_size_t pcmcia_common_align(struct pcmcia_align_data *align_data,
resource_size_t start)
{
resource_size_t ret;
/*
 * Ensure that we have the correct start address
 */
ret = (start  ~align_data-mask) + align_data-offset;
if (ret  start)
ret += align_data-mask + 1;

return ret;
}

Best Regards
Komuro

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Questions about ioport-assignments

2010-04-16 Thread Dominik Brodowski
On Fri, Apr 16, 2010 at 10:21:35PM +0900, Komuro wrote:
 Hi,
 
  Wolfram wrote:
  
  - Is it just a buggy card if it works at 0x300 but not 0xc300
(or is it maybe a problem with Linux assigning the io area)?
  - Why is IOAddrLines forced to 16 (and thus alignment to 0x1), but 
  only
if BasePort1 is 0?
  
 
 In this case, 
 start = 0xc000, 
 align_data-mask = 0x3ff, 
 align_data-offset = 0x300
 then ret becomes 0xc300;
 
 but ret should be 0x300.

That's not pcmcia_common_align()s fault -- but this line in alloc_io_space:

align = (*base) ? (lines ? 1lines : 0) : 1;

Should we try replacing it with

align = lines ? 1  lines : 0;

unconditionally?

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Questions about ioport-assignments

2010-04-16 Thread Komuro
Hi,

That's not pcmcia_common_align()s fault -- but this line in alloc_io_space:

   align = (*base) ? (lines ? 1lines : 0) : 1;

Should we try replacing it with

   align = lines ? 1  lines : 0;

unconditionally?


In this case, *base = 0x300
So 
align = (*base) ? (lines ? 1lines : 0) : 1;
is correct.

Actually, lines defines the max ioport,
not align.

if lines = 10, the max ioport is 0x3ff.
if lines = 16, the max ioport is 0x.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Questions about ioport-assignments

2010-04-16 Thread Komuro
Hi,

sorry, lines seems to be align.

but some devices with lines=10,
it means max io-port = 0x3ff.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Questions about ioport-assignments

2010-04-16 Thread Wolfram Sang
 sorry, lines seems to be align.
 
 but some devices with lines=10,
 it means max io-port = 0x3ff.

This would lead to consider the CIS of the card broken and override it? (And
the fact that it used to work was just Linux doing the assignment wrong back
then?)

Regards,

   Wolfram

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia