From: Mark Lord <liml@rtr.ca>
To: Byron Bradley <byron.bbradley@gmail.com>, saeed@marvell.com
Cc: linux-ide@vger.kernel.org, mlord@pobox.com, jeff@garzik.org,
linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: sata_mv: problems using it as a platform_driver
Date: Thu, 07 Feb 2008 23:35:40 -0500 [thread overview]
Message-ID: <47ABDC1C.9050507@rtr.ca> (raw)
In-Reply-To: <alpine.DEB.1.00.0802080113560.16853@git.byronbradley.co.uk>
Byron Bradley wrote:
> I'm having problems getting the sata_mv driver working as a platform
> driver on the QNAP TS-209 and the Linkstation/Kurobox (both are Marvell
> Orion 88f5182 based devices). First of all it would oops in
> mv_port_start() while calling dma_pool_alloc(), the patch to fix this is
> at the end of this email.
..
Ouch. I'd say this is proof-positive that Saeed did not even test his
latest patches. Your fix below looks straightforward and correct.
..
> From: Byron Bradley <byron.bbradley@gmail.com>
> Subject: [PATCH] sata_mv: platform driver allocs dma without create
>
> When the sata_mv driver is used as a platform driver,
> mv_create_dma_pools() is never called so it fails when trying
> to alloc in mv_pool_start().
>
> Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
..
Signed-off-by: Mark Lord <mlord@pobox.com>
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index f5333ce..04b5717 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -2881,6 +2881,26 @@ done:
> return rc;
> }
>
> +static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
> +{
> + hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
> + MV_CRQB_Q_SZ, 0);
> + if (!hpriv->crqb_pool)
> + return -ENOMEM;
> +
> + hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
> + MV_CRPB_Q_SZ, 0);
> + if (!hpriv->crpb_pool)
> + return -ENOMEM;
> +
> + hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
> + MV_SG_TBL_SZ, 0);
> + if (!hpriv->sg_tbl_pool)
> + return -ENOMEM;
> +
> + return 0;
> +}
> +
> /**
> * mv_platform_probe - handle a positive probe of an soc Marvell
> * host
> @@ -2934,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev)
> hpriv->base = ioremap(res->start, res->end - res->start + 1);
> hpriv->base -= MV_SATAHC0_REG_BASE;
>
> + rc = mv_create_dma_pools(hpriv, &pdev->dev);
> + if (rc)
> + return rc;
> +
> /* initialize adapter */
> rc = mv_init_host(host, chip_soc);
> if (rc)
> @@ -3070,26 +3094,6 @@ static void mv_print_info(struct ata_host *host)
> scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
> }
>
> -static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
> -{
> - hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
> - MV_CRQB_Q_SZ, 0);
> - if (!hpriv->crqb_pool)
> - return -ENOMEM;
> -
> - hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
> - MV_CRPB_Q_SZ, 0);
> - if (!hpriv->crpb_pool)
> - return -ENOMEM;
> -
> - hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
> - MV_SG_TBL_SZ, 0);
> - if (!hpriv->sg_tbl_pool)
> - return -ENOMEM;
> -
> - return 0;
> -}
> -
> /**
> * mv_pci_init_one - handle a positive probe of a PCI Marvell host
> * @pdev: PCI device found
next prev parent reply other threads:[~2008-02-08 4:35 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
2008-02-08 4:35 ` Mark Lord [this message]
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=47ABDC1C.9050507@rtr.ca \
--to=liml@rtr.ca \
--cc=byron.bbradley@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--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).