LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sata_mv: platform driver allocs dma without create
@ 2008-02-10 21:17 Byron Bradley
  2008-02-11 19:31 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Byron Bradley @ 2008-02-10 21:17 UTC (permalink / raw)
  To: jgarzik, linux-ide; +Cc: linux-kernel, saeed, mlord

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>
Acked-by: Mark Lord <mlord@pobox.com>
---

Mark, based on the comment from Andrew Morton on the "sata_mv: fix loop
with last port" patch I have changed your Signed-off-by to an Acked-by.
Hopefully thats correct.

 drivers/ata/sata_mv.c |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

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
-- 
1.5.4.rc2.38.gd6da3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sata_mv: platform driver allocs dma without create
  2008-02-10 21:17 [PATCH] sata_mv: platform driver allocs dma without create Byron Bradley
@ 2008-02-11 19:31 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-02-11 19:31 UTC (permalink / raw)
  To: Byron Bradley; +Cc: linux-ide, linux-kernel, saeed, mlord

Byron Bradley wrote:
> 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>
> Acked-by: Mark Lord <mlord@pobox.com>
> ---
> 
> Mark, based on the comment from Andrew Morton on the "sata_mv: fix loop
> with last port" patch I have changed your Signed-off-by to an Acked-by.
> Hopefully thats correct.

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-11 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10 21:17 [PATCH] sata_mv: platform driver allocs dma without create Byron Bradley
2008-02-11 19:31 ` Jeff Garzik

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).