Author: tbm Date: Wed Feb 13 16:47:31 2008 New Revision: 10531 Log: add some sata_mv patches
Added: dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-dma.patch dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-platform_driver.patch Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 Added: dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-dma.patch ============================================================================== --- (empty file) +++ dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-dma.patch Wed Feb 13 16:47:31 2008 @@ -0,0 +1,89 @@ +will be in rc2 + + + + +From: Byron Bradley <[EMAIL PROTECTED]> +Date: Fri, 8 Feb 2008 01:33:12 +0000 (+0000) +Subject: sata_mv: platform driver allocs dma without create +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnico%2Forion.git;a=commitdiff_plain;h=86566e6e2940177f665d07cb9276ed751ad90e7e + +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 <[EMAIL PROTECTED]> +Signed-off-by: Mark Lord <[EMAIL PROTECTED]> +--- + +diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c +index 080b836..8b79f1e 100644 +--- a/drivers/ata/sata_mv.c ++++ b/drivers/ata/sata_mv.c +@@ -2879,6 +2879,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 +@@ -2932,6 +2952,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) +@@ -3068,26 +3092,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 Added: dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-platform_driver.patch ============================================================================== --- (empty file) +++ dists/trunk/linux-2.6/debian/patches/bugfix/sata_mv-platform_driver.patch Wed Feb 13 16:47:31 2008 @@ -0,0 +1,39 @@ +needs more work + + + + + +From: Byron Bradley <[EMAIL PROTECTED]> +Date: Fri, 8 Feb 2008 02:20:35 +0000 (+0000) +Subject: sata_mv: problems using it as a platform_driver +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnico%2Forion.git;a=commitdiff_plain;h=1c62b99e64caa0e96fe9d6d3a4f75f54db8f0c7f + +sata_mv: problems using it as a platform_driver + +On Fri, 8 Feb 2008, Byron Bradley wrote: + +> In mv_platform_probe() host->iomap is set to NULL but it is dereferenced +> in mv_start_dma(), I'm not sure what the fix for this is. + +The following patch makes this driver work although I have no idea if this +is the correct thing to do. Will this be OK for other devices using this +driver? The pointer only works because it is dereferenced as +iomap[MV_PRIMARY_BAR] and MV_PRIMARY_BAR = 0, will another offset ever be +used in the future? +--- + +diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c +index 8b79f1e..ef10578 100644 +--- a/drivers/ata/sata_mv.c ++++ b/drivers/ata/sata_mv.c +@@ -2948,8 +2948,8 @@ static int mv_platform_probe(struct platform_device *pdev) + 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); Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 ============================================================================== --- dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 (original) +++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 Wed Feb 13 16:47:31 2008 @@ -27,3 +27,6 @@ #+ bugfix/arm/disable-video_bt848.patch + bugfix/arm/disable-scsi_acard.patch #+ bugfix/arm/disable-ath5k.patch +#the following will be fixed before 2.6.25 is out: ++ bugfix/sata_mv-dma.patch ++ bugfix/sata_mv-platform_driver.patch _______________________________________________ Kernel-svn-changes mailing list Kernel-svn-changes@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes