Pull two more MMC fixes from Ulf Hansson: "MMC core: - Fix block status codes MMC host: - sdhci-xenon: Fix SD bus voltage select" * tag 'mmc-v4.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-xenon: add set_power callback mmc: block: Fix block status codes
Unified · Split
| @@ -1213,7 +1213,7 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req) · 1212 unmodified lines | ||
| 1213 | 1213 | break; |
| 1214 | 1214 | } |
| 1215 | 1215 | mq_rq->drv_op_result = ret; |
| 1216 | − blk_end_request_all(req, ret); | |
| 1216 | + blk_end_request_all(req, ret ? BLK_STS_IOERR : BLK_STS_OK); | |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) |
| @@ -1718,9 +1718,9 @@ static bool mmc_blk_rw_cmd_err(struct mmc_blk_data *md, struct mmc_card *card, · 498 unmodified lines | ||
| 1718 | 1718 | if (err) |
| 1719 | 1719 | req_pending = old_req_pending; |
| 1720 | 1720 | else |
| 1721 | − req_pending = blk_end_request(req, 0, blocks << 9); | |
| 1721 | + req_pending = blk_end_request(req, BLK_STS_OK, blocks << 9); | |
| 1722 | 1722 | } else { |
| 1723 | − req_pending = blk_end_request(req, 0, brq->data.bytes_xfered); | |
| 1723 | + req_pending = blk_end_request(req, BLK_STS_OK, brq->data.bytes_xfered); | |
| 1724 | 1724 | } |
| 1725 | 1725 | return req_pending; |
| 1726 | 1726 | } |
| @@ -210,8 +210,27 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host, · 209 unmodified lines | ||
| 210 | 210 | sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | +static void xenon_set_power(struct sdhci_host *host, unsigned char mode, | |
| 214 | + unsigned short vdd) | |
| 215 | +{ | |
| 216 | + struct mmc_host *mmc = host->mmc; | |
| 217 | + u8 pwr = host->pwr; | |
| 218 | + | |
| 219 | + sdhci_set_power_noreg(host, mode, vdd); | |
| 220 | + | |
| 221 | + if (host->pwr == pwr) | |
| 222 | + return; | |
| 223 | + | |
| 224 | + if (host->pwr == 0) | |
| 225 | + vdd = 0; | |
| 226 | + | |
| 227 | + if (!IS_ERR(mmc->supply.vmmc)) | |
| 228 | + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); | |
| 229 | +} | |
| 230 | + | |
| 213 | 231 | static const struct sdhci_ops sdhci_xenon_ops = { |
| 214 | 232 | .set_clock = sdhci_set_clock, |
| 233 | + .set_power = xenon_set_power, | |
| 215 | 234 | .set_bus_width = sdhci_set_bus_width, |
| 216 | 235 | .reset = xenon_reset, |
| 217 | 236 | .set_uhs_signaling = xenon_set_uhs_signaling, |