diff options
-rw-r--r-- | drivers/mmc/host/msm_sdcc.c | 105 |
1 files changed, 47 insertions, 58 deletions
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 042f21702988..68bce6460d96 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c | |||
@@ -127,7 +127,7 @@ msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd, | |||
127 | BUG_ON(!mrq); | 127 | BUG_ON(!mrq); |
128 | 128 | ||
129 | if (!(result & DMOV_RSLT_VALID)) { | 129 | if (!(result & DMOV_RSLT_VALID)) { |
130 | printk(KERN_ERR "msmsdcc: Invalid DataMover result\n"); | 130 | pr_err("msmsdcc: Invalid DataMover result\n"); |
131 | goto out; | 131 | goto out; |
132 | } | 132 | } |
133 | 133 | ||
@@ -136,14 +136,13 @@ msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd, | |||
136 | } else { | 136 | } else { |
137 | /* Error or flush */ | 137 | /* Error or flush */ |
138 | if (result & DMOV_RSLT_ERROR) | 138 | if (result & DMOV_RSLT_ERROR) |
139 | printk(KERN_ERR "%s: DMA error (0x%.8x)\n", | 139 | pr_err("%s: DMA error (0x%.8x)\n", |
140 | mmc_hostname(host->mmc), result); | 140 | mmc_hostname(host->mmc), result); |
141 | if (result & DMOV_RSLT_FLUSH) | 141 | if (result & DMOV_RSLT_FLUSH) |
142 | printk(KERN_ERR "%s: DMA channel flushed (0x%.8x)\n", | 142 | pr_err("%s: DMA channel flushed (0x%.8x)\n", |
143 | mmc_hostname(host->mmc), result); | 143 | mmc_hostname(host->mmc), result); |
144 | if (err) | 144 | if (err) |
145 | printk(KERN_ERR | 145 | pr_err("Flush data: %.8x %.8x %.8x %.8x %.8x %.8x\n", |
146 | "Flush data: %.8x %.8x %.8x %.8x %.8x %.8x\n", | ||
147 | err->flush[0], err->flush[1], err->flush[2], | 146 | err->flush[0], err->flush[1], err->flush[2], |
148 | err->flush[3], err->flush[4], err->flush[5]); | 147 | err->flush[3], err->flush[4], err->flush[5]); |
149 | if (!mrq->data->error) | 148 | if (!mrq->data->error) |
@@ -248,7 +247,7 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data) | |||
248 | host->dma.num_ents, host->dma.dir); | 247 | host->dma.num_ents, host->dma.dir); |
249 | 248 | ||
250 | if (n != host->dma.num_ents) { | 249 | if (n != host->dma.num_ents) { |
251 | printk(KERN_ERR "%s: Unable to map in all sg elements\n", | 250 | pr_err("%s: Unable to map in all sg elements\n", |
252 | mmc_hostname(host->mmc)); | 251 | mmc_hostname(host->mmc)); |
253 | host->dma.sg = NULL; | 252 | host->dma.sg = NULL; |
254 | host->dma.num_ents = 0; | 253 | host->dma.num_ents = 0; |
@@ -393,25 +392,24 @@ msmsdcc_data_err(struct msmsdcc_host *host, struct mmc_data *data, | |||
393 | unsigned int status) | 392 | unsigned int status) |
394 | { | 393 | { |
395 | if (status & MCI_DATACRCFAIL) { | 394 | if (status & MCI_DATACRCFAIL) { |
396 | printk(KERN_ERR "%s: Data CRC error\n", | 395 | pr_err("%s: Data CRC error\n", mmc_hostname(host->mmc)); |
397 | mmc_hostname(host->mmc)); | 396 | pr_err("%s: opcode 0x%.8x\n", __func__, |
398 | printk(KERN_ERR "%s: opcode 0x%.8x\n", __func__, | ||
399 | data->mrq->cmd->opcode); | 397 | data->mrq->cmd->opcode); |
400 | printk(KERN_ERR "%s: blksz %d, blocks %d\n", __func__, | 398 | pr_err("%s: blksz %d, blocks %d\n", __func__, |
401 | data->blksz, data->blocks); | 399 | data->blksz, data->blocks); |
402 | data->error = -EILSEQ; | 400 | data->error = -EILSEQ; |
403 | } else if (status & MCI_DATATIMEOUT) { | 401 | } else if (status & MCI_DATATIMEOUT) { |
404 | printk(KERN_ERR "%s: Data timeout\n", mmc_hostname(host->mmc)); | 402 | pr_err("%s: Data timeout\n", mmc_hostname(host->mmc)); |
405 | data->error = -ETIMEDOUT; | 403 | data->error = -ETIMEDOUT; |
406 | } else if (status & MCI_RXOVERRUN) { | 404 | } else if (status & MCI_RXOVERRUN) { |
407 | printk(KERN_ERR "%s: RX overrun\n", mmc_hostname(host->mmc)); | 405 | pr_err("%s: RX overrun\n", mmc_hostname(host->mmc)); |
408 | data->error = -EIO; | 406 | data->error = -EIO; |
409 | } else if (status & MCI_TXUNDERRUN) { | 407 | } else if (status & MCI_TXUNDERRUN) { |
410 | printk(KERN_ERR "%s: TX underrun\n", mmc_hostname(host->mmc)); | 408 | pr_err("%s: TX underrun\n", mmc_hostname(host->mmc)); |
411 | data->error = -EIO; | 409 | data->error = -EIO; |
412 | } else { | 410 | } else { |
413 | printk(KERN_ERR "%s: Unknown error (0x%.8x)\n", | 411 | pr_err("%s: Unknown error (0x%.8x)\n", |
414 | mmc_hostname(host->mmc), status); | 412 | mmc_hostname(host->mmc), status); |
415 | data->error = -EIO; | 413 | data->error = -EIO; |
416 | } | 414 | } |
417 | } | 415 | } |
@@ -566,8 +564,7 @@ static void msmsdcc_do_cmdirq(struct msmsdcc_host *host, uint32_t status) | |||
566 | cmd->error = -ETIMEDOUT; | 564 | cmd->error = -ETIMEDOUT; |
567 | } else if (status & MCI_CMDCRCFAIL && | 565 | } else if (status & MCI_CMDCRCFAIL && |
568 | cmd->flags & MMC_RSP_CRC) { | 566 | cmd->flags & MMC_RSP_CRC) { |
569 | printk(KERN_ERR "%s: Command CRC error\n", | 567 | pr_err("%s: Command CRC error\n", mmc_hostname(host->mmc)); |
570 | mmc_hostname(host->mmc)); | ||
571 | cmd->error = -EILSEQ; | 568 | cmd->error = -EILSEQ; |
572 | } | 569 | } |
573 | 570 | ||
@@ -759,8 +756,8 @@ msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
759 | if (ios->clock != host->clk_rate) { | 756 | if (ios->clock != host->clk_rate) { |
760 | rc = clk_set_rate(host->clk, ios->clock); | 757 | rc = clk_set_rate(host->clk, ios->clock); |
761 | if (rc < 0) | 758 | if (rc < 0) |
762 | printk(KERN_ERR | 759 | pr_err("%s: Error setting clock rate (%d)\n", |
763 | "Error setting clock rate (%d)\n", rc); | 760 | mmc_hostname(host->mmc), rc); |
764 | else | 761 | else |
765 | host->clk_rate = ios->clock; | 762 | host->clk_rate = ios->clock; |
766 | } | 763 | } |
@@ -848,9 +845,8 @@ msmsdcc_check_status(unsigned long data) | |||
848 | status = host->plat->status(mmc_dev(host->mmc)); | 845 | status = host->plat->status(mmc_dev(host->mmc)); |
849 | host->eject = !status; | 846 | host->eject = !status; |
850 | if (status ^ host->oldstat) { | 847 | if (status ^ host->oldstat) { |
851 | printk(KERN_INFO | 848 | pr_info("%s: Slot status change detected (%d -> %d)\n", |
852 | "%s: Slot status change detected (%d -> %d)\n", | 849 | mmc_hostname(host->mmc), host->oldstat, status); |
853 | mmc_hostname(host->mmc), host->oldstat, status); | ||
854 | if (status) | 850 | if (status) |
855 | mmc_detect_change(host->mmc, (5 * HZ) / 2); | 851 | mmc_detect_change(host->mmc, (5 * HZ) / 2); |
856 | else | 852 | else |
@@ -900,13 +896,13 @@ msmsdcc_command_expired(unsigned long _data) | |||
900 | mrq = host->curr.mrq; | 896 | mrq = host->curr.mrq; |
901 | 897 | ||
902 | if (!mrq) { | 898 | if (!mrq) { |
903 | printk(KERN_INFO "%s: Command expiry misfire\n", | 899 | pr_info("%s: Command expiry misfire\n", |
904 | mmc_hostname(host->mmc)); | 900 | mmc_hostname(host->mmc)); |
905 | spin_unlock_irqrestore(&host->lock, flags); | 901 | spin_unlock_irqrestore(&host->lock, flags); |
906 | return; | 902 | return; |
907 | } | 903 | } |
908 | 904 | ||
909 | printk(KERN_ERR "%s: Command timeout (%p %p %p %p)\n", | 905 | pr_err("%s: Command timeout (%p %p %p %p)\n", |
910 | mmc_hostname(host->mmc), mrq, mrq->cmd, | 906 | mmc_hostname(host->mmc), mrq, mrq->cmd, |
911 | mrq->data, host->dma.sg); | 907 | mrq->data, host->dma.sg); |
912 | 908 | ||
@@ -937,7 +933,7 @@ msmsdcc_init_dma(struct msmsdcc_host *host) | |||
937 | &host->dma.nc_busaddr, | 933 | &host->dma.nc_busaddr, |
938 | GFP_KERNEL); | 934 | GFP_KERNEL); |
939 | if (host->dma.nc == NULL) { | 935 | if (host->dma.nc == NULL) { |
940 | printk(KERN_ERR "Unable to allocate DMA buffer\n"); | 936 | pr_err("Unable to allocate DMA buffer\n"); |
941 | return -ENOMEM; | 937 | return -ENOMEM; |
942 | } | 938 | } |
943 | memset(host->dma.nc, 0x00, sizeof(struct msmsdcc_nc_dmadata)); | 939 | memset(host->dma.nc, 0x00, sizeof(struct msmsdcc_nc_dmadata)); |
@@ -980,7 +976,7 @@ msmsdcc_probe(struct platform_device *pdev) | |||
980 | 976 | ||
981 | /* must have platform data */ | 977 | /* must have platform data */ |
982 | if (!plat) { | 978 | if (!plat) { |
983 | printk(KERN_ERR "%s: Platform data not available\n", __func__); | 979 | pr_err("%s: Platform data not available\n", __func__); |
984 | ret = -EINVAL; | 980 | ret = -EINVAL; |
985 | goto out; | 981 | goto out; |
986 | } | 982 | } |
@@ -989,7 +985,7 @@ msmsdcc_probe(struct platform_device *pdev) | |||
989 | return -EINVAL; | 985 | return -EINVAL; |
990 | 986 | ||
991 | if (pdev->resource == NULL || pdev->num_resources < 2) { | 987 | if (pdev->resource == NULL || pdev->num_resources < 2) { |
992 | printk(KERN_ERR "%s: Invalid resource\n", __func__); | 988 | pr_err("%s: Invalid resource\n", __func__); |
993 | return -ENXIO; | 989 | return -ENXIO; |
994 | } | 990 | } |
995 | 991 | ||
@@ -1003,7 +999,7 @@ msmsdcc_probe(struct platform_device *pdev) | |||
1003 | "status_irq"); | 999 | "status_irq"); |
1004 | 1000 | ||
1005 | if (!cmd_irqres || !pio_irqres || !memres) { | 1001 | if (!cmd_irqres || !pio_irqres || !memres) { |
1006 | printk(KERN_ERR "%s: Invalid resource\n", __func__); | 1002 | pr_err("%s: Invalid resource\n", __func__); |
1007 | return -ENXIO; | 1003 | return -ENXIO; |
1008 | } | 1004 | } |
1009 | 1005 | ||
@@ -1071,8 +1067,7 @@ msmsdcc_probe(struct platform_device *pdev) | |||
1071 | 1067 | ||
1072 | ret = clk_set_rate(host->clk, msmsdcc_fmin); | 1068 | ret = clk_set_rate(host->clk, msmsdcc_fmin); |
1073 | if (ret) { | 1069 | if (ret) { |
1074 | printk(KERN_ERR "%s: Clock rate set failed (%d)\n", | 1070 | pr_err("%s: Clock rate set failed (%d)\n", __func__, ret); |
1075 | __func__, ret); | ||
1076 | goto clk_disable; | 1071 | goto clk_disable; |
1077 | } | 1072 | } |
1078 | 1073 | ||
@@ -1125,14 +1120,14 @@ msmsdcc_probe(struct platform_device *pdev) | |||
1125 | DRIVER_NAME " (slot)", | 1120 | DRIVER_NAME " (slot)", |
1126 | host); | 1121 | host); |
1127 | if (ret) { | 1122 | if (ret) { |
1128 | printk(KERN_ERR "Unable to get slot IRQ %d (%d)\n", | 1123 | pr_err("%s: Unable to get slot IRQ %d (%d)\n", |
1129 | host->stat_irq, ret); | 1124 | mmc_hostname(mmc), host->stat_irq, ret); |
1130 | goto clk_disable; | 1125 | goto clk_disable; |
1131 | } | 1126 | } |
1132 | } else if (plat->register_status_notify) { | 1127 | } else if (plat->register_status_notify) { |
1133 | plat->register_status_notify(msmsdcc_status_notify_cb, host); | 1128 | plat->register_status_notify(msmsdcc_status_notify_cb, host); |
1134 | } else if (!plat->status) | 1129 | } else if (!plat->status) |
1135 | printk(KERN_ERR "%s: No card detect facilities available\n", | 1130 | pr_err("%s: No card detect facilities available\n", |
1136 | mmc_hostname(mmc)); | 1131 | mmc_hostname(mmc)); |
1137 | else { | 1132 | else { |
1138 | init_timer(&host->timer); | 1133 | init_timer(&host->timer); |
@@ -1168,34 +1163,28 @@ msmsdcc_probe(struct platform_device *pdev) | |||
1168 | mmc_set_drvdata(pdev, mmc); | 1163 | mmc_set_drvdata(pdev, mmc); |
1169 | mmc_add_host(mmc); | 1164 | mmc_add_host(mmc); |
1170 | 1165 | ||
1171 | printk(KERN_INFO | 1166 | pr_info("%s: Qualcomm MSM SDCC at 0x%016llx irq %d,%d dma %d\n", |
1172 | "%s: Qualcomm MSM SDCC at 0x%016llx irq %d,%d dma %d\n", | 1167 | mmc_hostname(mmc), (unsigned long long)memres->start, |
1173 | mmc_hostname(mmc), (unsigned long long)memres->start, | 1168 | (unsigned int) cmd_irqres->start, |
1174 | (unsigned int) cmd_irqres->start, | 1169 | (unsigned int) host->stat_irq, host->dma.channel); |
1175 | (unsigned int) host->stat_irq, host->dma.channel); | 1170 | pr_info("%s: 4 bit data mode %s\n", mmc_hostname(mmc), |
1176 | printk(KERN_INFO "%s: 4 bit data mode %s\n", mmc_hostname(mmc), | 1171 | (mmc->caps & MMC_CAP_4_BIT_DATA ? "enabled" : "disabled")); |
1177 | (mmc->caps & MMC_CAP_4_BIT_DATA ? "enabled" : "disabled")); | 1172 | pr_info("%s: MMC clock %u -> %u Hz, PCLK %u Hz\n", |
1178 | printk(KERN_INFO "%s: MMC clock %u -> %u Hz, PCLK %u Hz\n", | 1173 | mmc_hostname(mmc), msmsdcc_fmin, msmsdcc_fmax, host->pclk_rate); |
1179 | mmc_hostname(mmc), msmsdcc_fmin, msmsdcc_fmax, host->pclk_rate); | 1174 | pr_info("%s: Slot eject status = %d\n", mmc_hostname(mmc), host->eject); |
1180 | printk(KERN_INFO "%s: Slot eject status = %d\n", mmc_hostname(mmc), | 1175 | pr_info("%s: Power save feature enable = %d\n", |
1181 | host->eject); | 1176 | mmc_hostname(mmc), msmsdcc_pwrsave); |
1182 | printk(KERN_INFO "%s: Power save feature enable = %d\n", | ||
1183 | mmc_hostname(mmc), msmsdcc_pwrsave); | ||
1184 | 1177 | ||
1185 | if (host->dma.channel != -1) { | 1178 | if (host->dma.channel != -1) { |
1186 | printk(KERN_INFO | 1179 | pr_info("%s: DM non-cached buffer at %p, dma_addr 0x%.8x\n", |
1187 | "%s: DM non-cached buffer at %p, dma_addr 0x%.8x\n", | 1180 | mmc_hostname(mmc), host->dma.nc, host->dma.nc_busaddr); |
1188 | mmc_hostname(mmc), host->dma.nc, host->dma.nc_busaddr); | 1181 | pr_info("%s: DM cmd busaddr 0x%.8x, cmdptr busaddr 0x%.8x\n", |
1189 | printk(KERN_INFO | 1182 | mmc_hostname(mmc), host->dma.cmd_busaddr, |
1190 | "%s: DM cmd busaddr 0x%.8x, cmdptr busaddr 0x%.8x\n", | 1183 | host->dma.cmdptr_busaddr); |
1191 | mmc_hostname(mmc), host->dma.cmd_busaddr, | ||
1192 | host->dma.cmdptr_busaddr); | ||
1193 | } else | 1184 | } else |
1194 | printk(KERN_INFO | 1185 | pr_info("%s: PIO transfer enabled\n", mmc_hostname(mmc)); |
1195 | "%s: PIO transfer enabled\n", mmc_hostname(mmc)); | ||
1196 | if (host->timer.function) | 1186 | if (host->timer.function) |
1197 | printk(KERN_INFO "%s: Polling status mode enabled\n", | 1187 | pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); |
1198 | mmc_hostname(mmc)); | ||
1199 | 1188 | ||
1200 | return 0; | 1189 | return 0; |
1201 | cmd_irq_free: | 1190 | cmd_irq_free: |