* drivers/mmc/host/meson-gx-mmc.c:1097 meson_mmc_probe() warn: missing error code 'ret'
@ 2021-06-28 16:35 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-28 16:35 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 15588 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Krzysztof Kozlowski <krzk@kernel.org>
CC: Ulf Hansson <ulf.hansson@linaro.org>
Hi Krzysztof,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 62fb9874f5da54fdb243003b386128037319b219
commit: 54d8454436a205682bd89d66d8d9eedbc8452d15 mmc: host: Enable compile testing of multiple drivers
date: 10 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 10 months ago
config: microblaze-randconfig-m031-20210628 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/mmc/host/meson-gx-mmc.c:1097 meson_mmc_probe() warn: missing error code 'ret'
vim +/ret +1097 drivers/mmc/host/meson-gx-mmc.c
51c5d8447bd71b Kevin Hilman 2016-10-19 1037
51c5d8447bd71b Kevin Hilman 2016-10-19 1038 static int meson_mmc_probe(struct platform_device *pdev)
51c5d8447bd71b Kevin Hilman 2016-10-19 1039 {
51c5d8447bd71b Kevin Hilman 2016-10-19 1040 struct resource *res;
51c5d8447bd71b Kevin Hilman 2016-10-19 1041 struct meson_host *host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1042 struct mmc_host *mmc;
bb364890323cca Remi Pommarel 2019-01-11 1043 int ret;
51c5d8447bd71b Kevin Hilman 2016-10-19 1044
51c5d8447bd71b Kevin Hilman 2016-10-19 1045 mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
51c5d8447bd71b Kevin Hilman 2016-10-19 1046 if (!mmc)
51c5d8447bd71b Kevin Hilman 2016-10-19 1047 return -ENOMEM;
51c5d8447bd71b Kevin Hilman 2016-10-19 1048 host = mmc_priv(mmc);
51c5d8447bd71b Kevin Hilman 2016-10-19 1049 host->mmc = mmc;
51c5d8447bd71b Kevin Hilman 2016-10-19 1050 host->dev = &pdev->dev;
51c5d8447bd71b Kevin Hilman 2016-10-19 1051 dev_set_drvdata(&pdev->dev, host);
51c5d8447bd71b Kevin Hilman 2016-10-19 1052
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1053 /* The G12A SDIO Controller needs an SRAM bounce buffer */
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1054 host->dram_access_quirk = device_property_read_bool(&pdev->dev,
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1055 "amlogic,dram-access-quirk");
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1056
51c5d8447bd71b Kevin Hilman 2016-10-19 1057 /* Get regulators and the supported OCR mask */
51c5d8447bd71b Kevin Hilman 2016-10-19 1058 host->vqmmc_enabled = false;
51c5d8447bd71b Kevin Hilman 2016-10-19 1059 ret = mmc_regulator_get_supply(mmc);
fa54f3e359d6d0 Wolfram Sang 2017-10-14 1060 if (ret)
51c5d8447bd71b Kevin Hilman 2016-10-19 1061 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1062
51c5d8447bd71b Kevin Hilman 2016-10-19 1063 ret = mmc_of_parse(mmc);
51c5d8447bd71b Kevin Hilman 2016-10-19 1064 if (ret) {
dc012058d79aa7 Kevin Hilman 2017-01-25 1065 if (ret != -EPROBE_DEFER)
51c5d8447bd71b Kevin Hilman 2016-10-19 1066 dev_warn(&pdev->dev, "error parsing DT: %d\n", ret);
51c5d8447bd71b Kevin Hilman 2016-10-19 1067 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1068 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1069
df06981514d43f Nan Li 2018-04-03 1070 host->data = (struct meson_mmc_data *)
df06981514d43f Nan Li 2018-04-03 1071 of_device_get_match_data(&pdev->dev);
df06981514d43f Nan Li 2018-04-03 1072 if (!host->data) {
df06981514d43f Nan Li 2018-04-03 1073 ret = -EINVAL;
df06981514d43f Nan Li 2018-04-03 1074 goto free_host;
df06981514d43f Nan Li 2018-04-03 1075 }
df06981514d43f Nan Li 2018-04-03 1076
19c6beaa064c4b Jerome Brunet 2018-05-15 1077 ret = device_reset_optional(&pdev->dev);
89280d0963fdb6 Krzysztof Kozlowski 2020-09-02 1078 if (ret)
89280d0963fdb6 Krzysztof Kozlowski 2020-09-02 1079 return dev_err_probe(&pdev->dev, ret, "device reset failed\n");
19c6beaa064c4b Jerome Brunet 2018-05-15 1080
51c5d8447bd71b Kevin Hilman 2016-10-19 1081 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
51c5d8447bd71b Kevin Hilman 2016-10-19 1082 host->regs = devm_ioremap_resource(&pdev->dev, res);
51c5d8447bd71b Kevin Hilman 2016-10-19 1083 if (IS_ERR(host->regs)) {
51c5d8447bd71b Kevin Hilman 2016-10-19 1084 ret = PTR_ERR(host->regs);
51c5d8447bd71b Kevin Hilman 2016-10-19 1085 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1086 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1087
bb364890323cca Remi Pommarel 2019-01-11 1088 host->irq = platform_get_irq(pdev, 0);
bb364890323cca Remi Pommarel 2019-01-11 1089 if (host->irq <= 0) {
51c5d8447bd71b Kevin Hilman 2016-10-19 1090 ret = -EINVAL;
51c5d8447bd71b Kevin Hilman 2016-10-19 1091 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1092 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1093
1e03331d6b4340 Jerome Brunet 2017-08-28 1094 host->pinctrl = devm_pinctrl_get(&pdev->dev);
1e03331d6b4340 Jerome Brunet 2017-08-28 1095 if (IS_ERR(host->pinctrl)) {
1e03331d6b4340 Jerome Brunet 2017-08-28 1096 ret = PTR_ERR(host->pinctrl);
1e03331d6b4340 Jerome Brunet 2017-08-28 @1097 goto free_host;
1e03331d6b4340 Jerome Brunet 2017-08-28 1098 }
1e03331d6b4340 Jerome Brunet 2017-08-28 1099
1e03331d6b4340 Jerome Brunet 2017-08-28 1100 host->pins_clk_gate = pinctrl_lookup_state(host->pinctrl,
1e03331d6b4340 Jerome Brunet 2017-08-28 1101 "clk-gate");
1e03331d6b4340 Jerome Brunet 2017-08-28 1102 if (IS_ERR(host->pins_clk_gate)) {
1e03331d6b4340 Jerome Brunet 2017-08-28 1103 dev_warn(&pdev->dev,
1e03331d6b4340 Jerome Brunet 2017-08-28 1104 "can't get clk-gate pinctrl, using clk_stop bit\n");
1e03331d6b4340 Jerome Brunet 2017-08-28 1105 host->pins_clk_gate = NULL;
1e03331d6b4340 Jerome Brunet 2017-08-28 1106 }
1e03331d6b4340 Jerome Brunet 2017-08-28 1107
51c5d8447bd71b Kevin Hilman 2016-10-19 1108 host->core_clk = devm_clk_get(&pdev->dev, "core");
51c5d8447bd71b Kevin Hilman 2016-10-19 1109 if (IS_ERR(host->core_clk)) {
51c5d8447bd71b Kevin Hilman 2016-10-19 1110 ret = PTR_ERR(host->core_clk);
51c5d8447bd71b Kevin Hilman 2016-10-19 1111 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1112 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1113
51c5d8447bd71b Kevin Hilman 2016-10-19 1114 ret = clk_prepare_enable(host->core_clk);
51c5d8447bd71b Kevin Hilman 2016-10-19 1115 if (ret)
51c5d8447bd71b Kevin Hilman 2016-10-19 1116 goto free_host;
51c5d8447bd71b Kevin Hilman 2016-10-19 1117
51c5d8447bd71b Kevin Hilman 2016-10-19 1118 ret = meson_mmc_clk_init(host);
51c5d8447bd71b Kevin Hilman 2016-10-19 1119 if (ret)
ce473d5b49d6ef Michał Zegan 2017-03-14 1120 goto err_core_clk;
51c5d8447bd71b Kevin Hilman 2016-10-19 1121
3c39e2ca88016f Jerome Brunet 2017-08-28 1122 /* set config to sane default */
3c39e2ca88016f Jerome Brunet 2017-08-28 1123 meson_mmc_cfg_init(host);
3c39e2ca88016f Jerome Brunet 2017-08-28 1124
51c5d8447bd71b Kevin Hilman 2016-10-19 1125 /* Stop execution */
51c5d8447bd71b Kevin Hilman 2016-10-19 1126 writel(0, host->regs + SD_EMMC_START);
51c5d8447bd71b Kevin Hilman 2016-10-19 1127
74858655cbff05 Jerome Brunet 2017-08-28 1128 /* clear, ack and enable interrupts */
51c5d8447bd71b Kevin Hilman 2016-10-19 1129 writel(0, host->regs + SD_EMMC_IRQ_EN);
74858655cbff05 Jerome Brunet 2017-08-28 1130 writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
74858655cbff05 Jerome Brunet 2017-08-28 1131 host->regs + SD_EMMC_STATUS);
74858655cbff05 Jerome Brunet 2017-08-28 1132 writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
74858655cbff05 Jerome Brunet 2017-08-28 1133 host->regs + SD_EMMC_IRQ_EN);
51c5d8447bd71b Kevin Hilman 2016-10-19 1134
bb364890323cca Remi Pommarel 2019-01-11 1135 ret = request_threaded_irq(host->irq, meson_mmc_irq,
eb4d8112774657 Jerome Brunet 2019-04-23 1136 meson_mmc_irq_thread, IRQF_ONESHOT,
83e418a805d880 Martin Blumenstingl 2019-02-09 1137 dev_name(&pdev->dev), host);
51c5d8447bd71b Kevin Hilman 2016-10-19 1138 if (ret)
bd911ec467c674 Jerome Brunet 2017-08-28 1139 goto err_init_clk;
51c5d8447bd71b Kevin Hilman 2016-10-19 1140
e5e4a3eb131f79 Heiner Kallweit 2017-03-25 1141 mmc->caps |= MMC_CAP_CMD23;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1142 if (host->dram_access_quirk) {
27a5e7d36d3839 Neil Armstrong 2020-06-08 1143 /* Limit segments to 1 due to low available sram memory */
27a5e7d36d3839 Neil Armstrong 2020-06-08 1144 mmc->max_segs = 1;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1145 /* Limit to the available sram memory */
27a5e7d36d3839 Neil Armstrong 2020-06-08 1146 mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN /
27a5e7d36d3839 Neil Armstrong 2020-06-08 1147 mmc->max_blk_size;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1148 } else {
efe0b669716314 Heiner Kallweit 2017-02-07 1149 mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1150 mmc->max_segs = SD_EMMC_DESC_BUF_LEN /
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1151 sizeof(struct sd_emmc_desc);
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1152 }
efe0b669716314 Heiner Kallweit 2017-02-07 1153 mmc->max_req_size = mmc->max_blk_count * mmc->max_blk_size;
79ed05e329c34c Heiner Kallweit 2017-04-07 1154 mmc->max_seg_size = mmc->max_req_size;
efe0b669716314 Heiner Kallweit 2017-02-07 1155
d5f758f2df8015 Jerome Brunet 2019-04-23 1156 /*
d5f758f2df8015 Jerome Brunet 2019-04-23 1157 * At the moment, we don't know how to reliably enable HS400.
d5f758f2df8015 Jerome Brunet 2019-04-23 1158 * From the different datasheets, it is not even clear if this mode
d5f758f2df8015 Jerome Brunet 2019-04-23 1159 * is officially supported by any of the SoCs
d5f758f2df8015 Jerome Brunet 2019-04-23 1160 */
d5f758f2df8015 Jerome Brunet 2019-04-23 1161 mmc->caps2 &= ~MMC_CAP2_HS400;
d5f758f2df8015 Jerome Brunet 2019-04-23 1162
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1163 if (host->dram_access_quirk) {
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1164 /*
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1165 * The MMC Controller embeds 1,5KiB of internal SRAM
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1166 * that can be used to be used as bounce buffer.
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1167 * In the case of the G12A SDIO controller, use these
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1168 * instead of the DDR memory
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1169 */
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1170 host->bounce_buf_size = SD_EMMC_SRAM_DATA_BUF_LEN;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1171 host->bounce_buf = host->regs + SD_EMMC_SRAM_DATA_BUF_OFF;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1172 host->bounce_dma_addr = res->start + SD_EMMC_SRAM_DATA_BUF_OFF;
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1173 } else {
51c5d8447bd71b Kevin Hilman 2016-10-19 1174 /* data bounce buffer */
4136fcb547d2ba Heiner Kallweit 2017-02-07 1175 host->bounce_buf_size = mmc->max_req_size;
51c5d8447bd71b Kevin Hilman 2016-10-19 1176 host->bounce_buf =
51c5d8447bd71b Kevin Hilman 2016-10-19 1177 dma_alloc_coherent(host->dev, host->bounce_buf_size,
51c5d8447bd71b Kevin Hilman 2016-10-19 1178 &host->bounce_dma_addr, GFP_KERNEL);
51c5d8447bd71b Kevin Hilman 2016-10-19 1179 if (host->bounce_buf == NULL) {
51c5d8447bd71b Kevin Hilman 2016-10-19 1180 dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n");
51c5d8447bd71b Kevin Hilman 2016-10-19 1181 ret = -ENOMEM;
bb364890323cca Remi Pommarel 2019-01-11 1182 goto err_free_irq;
51c5d8447bd71b Kevin Hilman 2016-10-19 1183 }
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1184 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1185
79ed05e329c34c Heiner Kallweit 2017-04-07 1186 host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
79ed05e329c34c Heiner Kallweit 2017-04-07 1187 &host->descs_dma_addr, GFP_KERNEL);
79ed05e329c34c Heiner Kallweit 2017-04-07 1188 if (!host->descs) {
79ed05e329c34c Heiner Kallweit 2017-04-07 1189 dev_err(host->dev, "Allocating descriptor DMA buffer failed\n");
79ed05e329c34c Heiner Kallweit 2017-04-07 1190 ret = -ENOMEM;
79ed05e329c34c Heiner Kallweit 2017-04-07 1191 goto err_bounce_buf;
79ed05e329c34c Heiner Kallweit 2017-04-07 1192 }
79ed05e329c34c Heiner Kallweit 2017-04-07 1193
51c5d8447bd71b Kevin Hilman 2016-10-19 1194 mmc->ops = &meson_mmc_ops;
51c5d8447bd71b Kevin Hilman 2016-10-19 1195 mmc_add_host(mmc);
51c5d8447bd71b Kevin Hilman 2016-10-19 1196
51c5d8447bd71b Kevin Hilman 2016-10-19 1197 return 0;
51c5d8447bd71b Kevin Hilman 2016-10-19 1198
79ed05e329c34c Heiner Kallweit 2017-04-07 1199 err_bounce_buf:
acdc8e71d9bb0b Neil Armstrong 2019-05-27 1200 if (!host->dram_access_quirk)
79ed05e329c34c Heiner Kallweit 2017-04-07 1201 dma_free_coherent(host->dev, host->bounce_buf_size,
79ed05e329c34c Heiner Kallweit 2017-04-07 1202 host->bounce_buf, host->bounce_dma_addr);
bb364890323cca Remi Pommarel 2019-01-11 1203 err_free_irq:
bb364890323cca Remi Pommarel 2019-01-11 1204 free_irq(host->irq, host);
bd911ec467c674 Jerome Brunet 2017-08-28 1205 err_init_clk:
bd911ec467c674 Jerome Brunet 2017-08-28 1206 clk_disable_unprepare(host->mmc_clk);
ce473d5b49d6ef Michał Zegan 2017-03-14 1207 err_core_clk:
51c5d8447bd71b Kevin Hilman 2016-10-19 1208 clk_disable_unprepare(host->core_clk);
ce473d5b49d6ef Michał Zegan 2017-03-14 1209 free_host:
51c5d8447bd71b Kevin Hilman 2016-10-19 1210 mmc_free_host(mmc);
51c5d8447bd71b Kevin Hilman 2016-10-19 1211 return ret;
51c5d8447bd71b Kevin Hilman 2016-10-19 1212 }
51c5d8447bd71b Kevin Hilman 2016-10-19 1213
:::::: The code at line 1097 was first introduced by commit
:::::: 1e03331d6b4340461efefab8b1dee874009ad950 mmc: meson-gx: work around clk-stop issue
:::::: TO: Jerome Brunet <jbrunet@baylibre.com>
:::::: CC: Ulf Hansson <ulf.hansson@linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29281 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-28 16:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 16:35 drivers/mmc/host/meson-gx-mmc.c:1097 meson_mmc_probe() warn: missing error code 'ret' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.