From: Becky Bruce <beckyb@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/8] drivers/block/ahci: Fix pci mapping bug
Date: Tue, 3 Feb 2009 18:10:55 -0600 [thread overview]
Message-ID: <1233706256-13878-8-git-send-email-beckyb@kernel.crashing.org> (raw)
In-Reply-To: <1233706256-13878-1-git-send-email-beckyb@kernel.crashing.org>
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: Becky Bruce <beckyb@kernel.crashing.org>
---
drivers/block/ahci.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 2445e8c..e1b66fd 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -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
| ATA_FLAG_NO_LEGACY
| ATA_FLAG_MMIO
@@ -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,
+ PCI_REGION_MEM);
/* Take from kernel:
* JMicron-specific fixup:
--
1.5.6.6
next prev parent reply other threads:[~2009-02-04 0:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-04 0:10 [U-Boot] [PATCH 00/08 V2] Allow PCI bus address, PA, and VA to differ Becky Bruce
2009-02-04 0:10 ` [U-Boot] [PATCH 1/8] mpc8641hpcn: Set up outbound pci windows before inbound Becky Bruce
2009-02-04 19:38 ` Jon Loeliger
2009-02-05 5:52 ` [U-Boot] 86xx maintainership change? Kumar Gala
2009-02-05 7:51 ` Wolfgang Denk
2009-02-09 15:50 ` [U-Boot] [PATCH 1/8] mpc8641hpcn: Set up outbound pci windows before inbound Kumar Gala
2009-02-09 19:14 ` Becky Bruce
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 2/8] drivers/pci: Create pci_map_bar function Becky Bruce
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 3/8] powerpc: Move duplicated BAT defines to mmu.h Becky Bruce
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 4/8] mpc86xx: Add support to populate addr map based on BATs Becky Bruce
2009-02-04 19:35 ` Jon Loeliger
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 5/8] mpc8641hpcn: Clean up PCI mapping concepts Becky Bruce
2009-02-04 19:36 ` Jon Loeliger
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 6/8] MPC8641HPCN: Enable CONFIG_ADDR_MAP Becky Bruce
2009-02-04 19:43 ` Jon Loeliger
2009-02-09 23:32 ` Wolfgang Denk
2009-02-04 0:10 ` Becky Bruce [this message]
2009-02-09 23:32 ` [U-Boot] [PATCH 7/8] drivers/block/ahci: Fix pci mapping bug Wolfgang Denk
2009-02-04 0:10 ` [U-Boot] [PATCH 8/8] mpc8641hpcn: Change PCI MEM pci bus address Becky Bruce
2009-02-04 19:37 ` Jon Loeliger
2009-02-09 23:32 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233706256-13878-8-git-send-email-beckyb@kernel.crashing.org \
--to=beckyb@kernel.crashing.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox