lkml.org 
[lkml]   [2011]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: PATA_ARTOP reads byte from PCI IO port without mapping it to the right address.
On Wed, Mar 30, 2011 at 12:26 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> unsigned long io = pci_resource_start(pdev, 4);           // This
>> returns 0x1400 on my machine
>
> That is the PCI port address.
>
>>                  u8 reg;
>>
>>                  ppi[0] = &info_628x;
>>                  if (inb(io) & 0x10)
>>          // This reads from 0x1400, which isn't were the port actually
>> is in the processors address
>
> This reads from I/O port 0x1400 - your inb logic and I/O port mapping on
> the platform is responsible for making that work.

Indeed. We do _not_ expect inb/outb to do the equivalent of ioremap()
etc, since the IO port range is just 64kB. The arch code is supposed
to do whatever mapping it needs statically at bootup, and just make
inb/outb honor that mapping.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-03-30 22:07    [W:0.064 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site