aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 080b8362f8d6..04b571764aff 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1716,14 +1716,16 @@ static void mv_host_intr(struct ata_host *host, u32 relevant, unsigned int hc)
1716 VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n", 1716 VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n",
1717 hc, relevant, hc_irq_cause); 1717 hc, relevant, hc_irq_cause);
1718 1718
1719 for (port = port0; port < port0 + last_port; port++) { 1719 for (port = port0; port < last_port; port++) {
1720 struct ata_port *ap = host->ports[port]; 1720 struct ata_port *ap = host->ports[port];
1721 struct mv_port_priv *pp = ap->private_data; 1721 struct mv_port_priv *pp;
1722 int have_err_bits, hard_port, shift; 1722 int have_err_bits, hard_port, shift;
1723 1723
1724 if ((!ap) || (ap->flags & ATA_FLAG_DISABLED)) 1724 if ((!ap) || (ap->flags & ATA_FLAG_DISABLED))
1725 continue; 1725 continue;
1726 1726
1727 pp = ap->private_data;
1728
1727 shift = port << 1; /* (port * 2) */ 1729 shift = port << 1; /* (port * 2) */
1728 if (port >= MV_PORTS_PER_HC) { 1730 if (port >= MV_PORTS_PER_HC) {
1729 shift++; /* skip bit 8 in the HC Main IRQ reg */ 1731 shift++; /* skip bit 8 in the HC Main IRQ reg */
@@ -2879,6 +2881,26 @@ done:
2879 return rc; 2881 return rc;
2880} 2882}
2881 2883
2884static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
2885{
2886 hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
2887 MV_CRQB_Q_SZ, 0);
2888 if (!hpriv->crqb_pool)
2889 return -ENOMEM;
2890
2891 hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
2892 MV_CRPB_Q_SZ, 0);
2893 if (!hpriv->crpb_pool)
2894 return -ENOMEM;
2895
2896 hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
2897 MV_SG_TBL_SZ, 0);
2898 if (!hpriv->sg_tbl_pool)
2899 return -ENOMEM;
2900
2901 return 0;
2902}
2903
2882/** 2904/**
2883 * mv_platform_probe - handle a positive probe of an soc Marvell 2905 * mv_platform_probe - handle a positive probe of an soc Marvell
2884 * host 2906 * host
@@ -2932,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev)
2932 hpriv->base = ioremap(res->start, res->end - res->start + 1); 2954 hpriv->base = ioremap(res->start, res->end - res->start + 1);
2933 hpriv->base -= MV_SATAHC0_REG_BASE; 2955 hpriv->base -= MV_SATAHC0_REG_BASE;
2934 2956
2957 rc = mv_create_dma_pools(hpriv, &pdev->dev);
2958 if (rc)
2959 return rc;
2960
2935 /* initialize adapter */ 2961 /* initialize adapter */
2936 rc = mv_init_host(host, chip_soc); 2962 rc = mv_init_host(host, chip_soc);
2937 if (rc) 2963 if (rc)
@@ -3068,26 +3094,6 @@ static void mv_print_info(struct ata_host *host)
3068 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); 3094 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
3069} 3095}
3070 3096
3071static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
3072{
3073 hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
3074 MV_CRQB_Q_SZ, 0);
3075 if (!hpriv->crqb_pool)
3076 return -ENOMEM;
3077
3078 hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
3079 MV_CRPB_Q_SZ, 0);
3080 if (!hpriv->crpb_pool)
3081 return -ENOMEM;
3082
3083 hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
3084 MV_SG_TBL_SZ, 0);
3085 if (!hpriv->sg_tbl_pool)
3086 return -ENOMEM;
3087
3088 return 0;
3089}
3090
3091/** 3097/**
3092 * mv_pci_init_one - handle a positive probe of a PCI Marvell host 3098 * mv_pci_init_one - handle a positive probe of a PCI Marvell host
3093 * @pdev: PCI device found 3099 * @pdev: PCI device found