Re: PCI IO regions and IDE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/9/07, Rene Herman <rene.herman@xxxxxxxxx> wrote:
On 01/09/2007 12:32 PM, Bahadir Balban wrote:
Not very clearly formulated, but "tries to access the IO region [...] in
physical" sounds like you are directly adressing using physical (bus)
addresses?

Yes that is what I meant. With the advice from a former reply, I
advanced the discussion more specifically in the arm-kernel mailing
list since the platform was ARM. But the ata code in 2.6.19 that
causes the oops is as follows, from libata-sff.c:

struct ata_pci_init_native_mode(...)
{
  unsigned long bmdma;
  ...
  bmdma = pci_resource_start(pdev, 4);
  /* Memory reference to a direct physical address. */
  if (inb(bmdma + 2) & 8)
  ...
}

Note that the kernel _always_ speaks virtual adresses -- to
talk to IO you need to ioremap() the physical adresses (in this case,
the adresses you get from the PCI BARs). So, "look into ioremap()" might
be the advice you need.

Rene.

This is what I expect to see for a memory region. A driver would
normally claim it by request_mem_region() and then ioremap(). But in
the above code it is directly used. That's why it confused me.
Furthermore, the problem with ioremap() for IO is that you can have a
single page of IO region shared by multiple devices in byte
granularity. This would cause multiple virtual mappings of the same
page, although I'm not sure if this would be a problem. If someone
could clarify how PCI IO is used in linux that would help.

Thanks,
Bahadir

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux