Commit 1785dbee authored by Becky Bruce's avatar Becky Bruce Committed by Wolfgang Denk
Browse files

drivers/block/ahci: Fix pci mapping bug

The code assumes that the pci bus address and the virtual
address used to access a region are the same, but they might
not be.  Fix this assumption.
Signed-off-by: default avatarBecky Bruce <>
parent d591a80e
......@@ -251,7 +251,6 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
static int ahci_init_one(pci_dev_t pdev)
u32 iobase;
u16 vendor;
int rc;
......@@ -261,9 +260,6 @@ static int ahci_init_one(pci_dev_t pdev)
memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
probe_ent->dev = pdev;
pci_read_config_dword(pdev, AHCI_PCI_BAR, &iobase);
iobase &= ~0xf;
probe_ent->host_flags = ATA_FLAG_SATA
......@@ -272,7 +268,8 @@ static int ahci_init_one(pci_dev_t pdev)
probe_ent->pio_mask = 0x1f;
probe_ent->udma_mask = 0x7f; /*Fixme,assume to support UDMA6 */
probe_ent->mmio_base = iobase;
probe_ent->mmio_base = (u32)pci_map_bar(pdev, AHCI_PCI_BAR,
/* Take from kernel:
* JMicron-specific fixup:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment