From: Tejun Heo <htejun@gmail.com>
To: Saeed Bishara <saeed@marvell.com>
Cc: Mark Lord <liml@rtr.ca>, Byron Bradley <byron.bbradley@gmail.com>,
jeff@garzik.org, linux-ide@vger.kernel.org, mlord@pobox.com
Subject: Re: sata_mv: problems using it as a platform_driver
Date: Tue, 12 Feb 2008 10:31:24 +0900 [thread overview]
Message-ID: <47B0F6EC.90301@gmail.com> (raw)
In-Reply-To: <47B04F05.4060505@marvell.com>
Saeed Bishara wrote:
>>> host->private_data = hpriv;
>>> hpriv->n_ports = n_ports;
>>>
>>> - host->iomap = NULL;
>>> hpriv->base = ioremap(res->start, res->end - res->start + 1);
>>> + host->iomap = &hpriv->base;
>>> hpriv->base -= MV_SATAHC0_REG_BASE;
>>>
>>> rc = mv_create_dma_pools(hpriv, &pdev->dev);
>> ..
>>
>> Well, that's definitely one way to attack it.
> the fix better be done by using the hpriv->base instead of iomap table:
> void __iomem *hc_mmio = mv_hc_base_from_port(
> - ap->host->iomap[MV_PRIMARY_BAR], hard_port);
> + mv_host_base(ap->host), hard_port);
> u32 hc_irq_cause, ipending;
Yeah, that's the right thing to do.
>> The original problem being, for a non-PCI device, there is no iomap[]
>> table.
>> sata_mv only ever uses iomap[MV_PRIMARY_BAR=0], so the above patch should
>> work around it just fine.
> Jeff, do the libata upper drivers use the other BARs? if not, then we can use pci_iomap to map BAR0, this way we can remove the iomap[] table and use one iomem pointer for pci and none-pci devices.
libata core layer _never_ touches those device specific stuff. Using
iomap directly is just a convenient way to access the address without
adding host private data for PCI controllers. If it doesn't fit, the
correct thing to do is to add proper host private data.
Thanks.
--
tejun
next prev parent reply other threads:[~2008-02-12 1:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-08 1:33 sata_mv: problems using it as a platform_driver Byron Bradley
2008-02-08 2:20 ` Byron Bradley
2008-02-08 4:42 ` Mark Lord
2008-02-11 13:35 ` Saeed Bishara
2008-02-12 1:31 ` Tejun Heo [this message]
2008-02-08 4:35 ` Mark Lord
2008-02-11 13:06 ` Saeed Bishara
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=47B0F6EC.90301@gmail.com \
--to=htejun@gmail.com \
--cc=byron.bbradley@gmail.com \
--cc=jeff@garzik.org \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=mlord@pobox.com \
--cc=saeed@marvell.com \
/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;
as well as URLs for NNTP newsgroup(s).